@opentok/client 2.33.0-alpha.21 → 2.33.0-alpha.22
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/js/opentok.d.ts +2 -1
- package/dist/js/opentok.js +21 -17
- package/dist/js/opentok.js.map +1 -1
- package/dist/js/opentok.min.js +4 -4
- package/dist/js/opentok.min.js.map +1 -1
- package/package.json +1 -1
package/dist/js/opentok.min.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license OpenTok.js 2.33.0
|
|
2
|
+
* @license OpenTok.js 2.33.0 a2a5318be
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2010-2025 TokBox, Inc.
|
|
5
5
|
* Subject to the applicable Software Development Kit (SDK) License Agreement:
|
|
6
6
|
* https://www.vonage.com/legal/communications-apis/terms-of-use/
|
|
7
7
|
*
|
|
8
|
-
* Date:
|
|
8
|
+
* Date: Mon, 22 Dec 2025 11:15:07 GMT
|
|
9
9
|
*/
|
|
10
10
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OT=t():e.OT=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=370)}([function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){(function(t){
|
|
11
11
|
/*!
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* @license Licensed under MIT license
|
|
15
15
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
16
16
|
* @version v4.2.8+1e68dce6
|
|
17
|
-
*/var n;n=function(){"use strict";function e(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=void 0,o=void 0,a=function(e,t){h[r]=e,h[r+1]=t,2===(r+=2)&&(o?o(g):m())},l="undefined"!=typeof window?window:void 0,c=l||{},s=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),u="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function A(){var e=setTimeout;return function(){return e(g,1)}}var h=new Array(1e3);function g(){for(var e=0;e<r;e+=2)(0,h[e])(h[e+1]),h[e]=void 0,h[e+1]=void 0;r=0}var Q,F,p,U,m=void 0;function b(e,t){var n=this,r=new this.constructor(f);void 0===r[Z]&&J(r);var i=n._state;if(i){var o=arguments[i-1];a((function(){return S(i,r,o,n._result)}))}else W(n,r,e,t);return r}function B(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(f);return I(t,e),t}d?m=function(){return t.nextTick(g)}:s?(F=0,p=new s(g),U=document.createTextNode(""),p.observe(U,{characterData:!0}),m=function(){U.data=F=++F%2}):u?((Q=new MessageChannel).port1.onmessage=g,m=function(){return Q.port2.postMessage(0)}):m=void 0===l?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(g)}:A()}catch(e){return A()}}():A();var Z=Math.random().toString(36).substring(2);function f(){}function R(t,n,r){n.constructor===t.constructor&&r===b&&n.constructor.resolve===B?function(e,t){1===t._state?V(e,t._result):2===t._state?C(e,t._result):W(t,void 0,(function(t){return I(e,t)}),(function(t){return C(e,t)}))}(t,n):void 0===r?V(t,n):e(r)?function(e,t,n){a((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?I(e,n):V(e,n))}),(function(t){r||(r=!0,C(e,t))}),e._label);!r&&i&&(r=!0,C(e,i))}),e)}(t,n,r):V(t,n)}function I(e,t){if(e===t)C(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)V(e,t);else{var n=void 0;try{n=t.then}catch(t){return void C(e,t)}R(e,t,n)}var r,i}function y(e){e._onerror&&e._onerror(e._result),E(e)}function V(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&a(E,e))}function C(e,t){void 0===e._state&&(e._state=2,e._result=t,a(y,e))}function W(e,t,n,r){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+1]=n,i[o+2]=r,0===o&&e._state&&a(E,e)}function E(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,o=e._result,a=0;a<t.length;a+=3)r=t[a],i=t[a+n],r?S(n,r,i,o):i(o);e._subscribers.length=0}}function S(t,n,r,i){var o=e(r),a=void 0,l=void 0,c=!0;if(o){try{a=r(i)}catch(e){c=!1,l=e}if(n===a)return void C(n,new TypeError("A promises callback cannot return that same promise."))}else a=i;void 0!==n._state||(o&&c?I(n,a):!1===c?C(n,l):1===t?V(n,a):2===t&&C(n,a))}var v=0;function J(e){e[Z]=v++,e._state=void 0,e._result=void 0,e._subscribers=[]}var N=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(f),this.promise[Z]||J(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?V(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&V(this.promise,this._result))):C(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===B){var i=void 0,o=void 0,a=!1;try{i=e.then}catch(e){a=!0,o=e}if(i===b&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===G){var l=new n(f);a?C(l,o):R(l,e,i),this._willSettleAt(l,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===e?C(r,n):this._result[t]=n),0===this._remaining&&V(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;W(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),G=function(){function t(e){this[Z]=v++,this._result=this._state=void 0,this._subscribers=[],f!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){I(e,t)}),(function(t){C(e,t)}))}catch(t){C(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this.constructor;return e(t)?this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return G.prototype.then=b,G.all=function(e){return new N(this,e).promise},G.race=function(e){var t=this;return n(e)?new t((function(n,r){for(var i=e.length,o=0;o<i;o++)t.resolve(e[o]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},G.resolve=B,G.reject=function(e){var t=new this(f);return C(t,e),t},G._setScheduler=function(e){o=e},G._setAsap=function(e){a=e},G._asap=a,G.polyfill=function(){var e=void 0;if(void 0!==(void 0!==typeof window?window:global))e=void 0!==typeof window?window:global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=G},G.Promise=G,G},e.exports=n()}).call(this,n(25))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(425)),o=r(n(58)),a=r(n(130));const l=(0,o.default)(e=>{const t={};return Object.keys(a.default).forEach(n=>{const r=a.default[n].method,o=(0,i.default)(`OpenTok:${e}:${n.toLowerCase()}`);o.log=console[r].bind(console),t[n.toLowerCase()]=o}),t});l.setLogLevel=e=>{let t;try{t=(void 0!==typeof window?window:global).localStorage.debug}catch(e){t=""}const n=[...Object.keys(a.default).map(t=>`${e>=a.default[t].priority?"":"-"}(autogen)?OpenTok:*:${t.toLowerCase()}`),...(t||"").split(/[\s,]/).filter(e=>-1===e.indexOf("(autogen)?"))].filter(e=>e).join(",");i.default.enable(n)};var c=l;t.default=c},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(481)).default.parse();t.default=i},function(e,t,n){e.exports=n(421)},function(e,t,n){(function(t){function n(e,n,r,i,o,a,l){try{var c=e[a](l),s=c.value}catch(e){return void r(e)}c.done?n(s):t.resolve(s).then(i,o)}e.exports=function(e){return function(){var r=this,i=arguments;return new t((function(t,o){var a=e.apply(r,i);function l(e){n(a,t,o,l,c,"next",e)}function c(e){n(a,t,o,l,c,"throw",e)}l(void 0)}))}}}).call(this,n(1))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default={AUTHENTICATION_ERROR:"OT_AUTHENTICATION_ERROR",BADLY_FORMED_RESPONSE:"OT_BADLY_FORMED_RESPONSE",CHROME_MICROPHONE_ACQUISITION_ERROR:"OT_CHROME_MICROPHONE_ACQUISITION_ERROR",CONNECT_FAILED:"OT_CONNECT_FAILED",CONNECTION_LIMIT_EXCEEDED:"OT_CONNECTION_LIMIT_EXCEEDED",CONSTRAINTS_NOT_SATISFIED:"OT_CONSTRAINTS_NOT_SATISFIED",CREATE_PEER_CONNECTION_FAILED:"OT_CREATE_PEER_CONNECTION_FAILED",DISCONNECTED:"OT_DISCONNECTED",EMPTY_RESPONSE_BODY:"OT_EMPTY_RESPONSE_BODY",GET_RTC_STATS_REPORT_NOT_SUPPORTED:"OT_GET_RTC_STATS_REPORT_NOT_SUPPORTED",HARDWARE_UNAVAILABLE:"OT_HARDWARE_UNAVAILABLE",ICE_WORKFLOW_FAILED:"OT_ICE_WORKFLOW_FAILED",INVALID_HTTP_STATUS:"OT_INVALID_HTTP_STATUS",INVALID_PARAMETER:"OT_INVALID_PARAMETER",INVALID_SESSION_ID:"OT_INVALID_SESSION_ID",MEDIA_ERR_ABORTED:"OT_MEDIA_ERR_ABORTED",MEDIA_ERR_DECODE:"OT_MEDIA_ERR_DECODE",MEDIA_ERR_NETWORK:"OT_MEDIA_ERR_NETWORK",MEDIA_ERR_SRC_NOT_SUPPORTED:"OT_MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ENDED:"OT_MEDIA_ENDED",NO_DEVICES_FOUND:"OT_NO_DEVICES_FOUND",NO_VALID_CONSTRAINTS:"OT_NO_VALID_CONSTRAINTS",NOT_CONNECTED:"OT_NOT_CONNECTED",NOT_FOUND:"OT_NOT_FOUND",NOT_SUPPORTED:"OT_NOT_SUPPORTED",PEER_CONNECTION_NOT_CONNECTED:"OT_PEER_CONNECTION_NOT_CONNECTED",PERMISSION_DENIED:"OT_PERMISSION_DENIED",RATE_LIMIT_EXCEEDED:"OT_RATE_LIMIT_EXCEEDED",REPORT_ISSUE_FAILED:"OT_REPORT_ISSUE_FAILED",SCREEN_SHARING_EXTENSION_NOT_INSTALLED:"OT_SCREEN_SHARING_EXTENSION_NOT_INSTALLED",SCREEN_SHARING_EXTENSION_NOT_REGISTERED:"OT_SCREEN_SHARING_EXTENSION_NOT_REGISTERED",SCREEN_SHARING_NOT_SUPPORTED:"OT_SCREEN_SHARING_NOT_SUPPORTED",SET_REMOTE_DESCRIPTION_FAILED:"OT_SET_REMOTE_DESCRIPTION_FAILED",FAILED_SET_CONFIGURATION:"OT_FAILED_SET_CONFIGURATION",SOCKET_ALREADY_CONNECTED_CONNECTING:"OT_SOCKET_ALREADY_CONNECTED_CONNECTING",SOCKET_CLOSE_ABNORMAL:"OT_SOCKET_CLOSE_ABNORMAL",SOCKET_CLOSE_CONNECT_EXCEPTION:"OT_SOCKET_CLOSE_CONNECT_EXCEPTION",SOCKET_CLOSE_CONNECTIVITY_LOSS:"OT_SOCKET_CLOSE_CONNECTIVITY_LOSS",SOCKET_CLOSE_FALLBACK_CODE:"OT_SOCKET_CLOSE_FALLBACK_CODE",SOCKET_CLOSE_INCONSISTENT_DATA:"OT_SOCKET_CLOSE_INCONSISTENT_DATA",SOCKET_CLOSE_NO_STATUS:"OT_SOCKET_CLOSE_NO_STATUS",SOCKET_CLOSE_POLICY_VIOLATION:"OT_SOCKET_CLOSE_POLICY_VIOLATION",SOCKET_CLOSE_GOING_AWAY:"OT_SOCKET_CLOSE_GOING_AWAY",SOCKET_CLOSE_PROTOCOL_ERROR:"OT_SOCKET_CLOSE_PROTOCOL_ERROR",SOCKET_CLOSE_TIMEOUT:"OT_SOCKET_CLOSE_TIMEOUT",SOCKET_CLOSE_TOO_LARGE:"OT_SOCKET_CLOSE_TOO_LARGE",SOCKET_CLOSE_UNEXPECTED_CONDITION:"OT_SOCKET_CLOSE_UNEXPECTED_CONDITION",SOCKET_CLOSE_UNSUPPORTED:"OT_SOCKET_CLOSE_UNSUPPORTED",STREAM_CREATE_FAILED:"OT_STREAM_CREATE_FAILED",STREAM_DESTROYED:"OT_STREAM_DESTROYED",STREAM_LIMIT_EXCEEDED:"OT_STREAM_LIMIT_EXCEEDED",STREAM_NOT_FOUND:"OT_STREAM_NOT_FOUND",UNABLE_TO_SUBSCRIBE:"OT_UNABLE_TO_SUBSCRIBE",TERMS_OF_SERVICE_FAILURE:"OT_TERMS_OF_SERVICE_FAILURE",TIMEOUT:"OT_TIMEOUT",CANCEL:"OT_CANCEL",UNABLE_TO_CAPTURE_MEDIA:"OT_UNABLE_TO_CAPTURE_MEDIA",UNABLE_TO_CAPTURE_SCREEN:"OT_UNABLE_TO_CAPTURE_SCREEN",UNEXPECTED_ERROR_CODE:"OT_UNEXPECTED_ERROR_CODE",UNEXPECTED_HTTP_STATUS:"OT_UNEXPECTED_HTTP_STATUS",UNEXPECTED_SERVER_RESPONSE:"OT_UNEXPECTED_SERVER_RESPONSE",UNKNOWN_HTTP_ERROR:"OT_UNKNOWN_HTTP_ERROR",UNSUPPORTED_BROWSER:"OT_UNSUPPORTED_BROWSER",USER_MEDIA_ACCESS_DENIED:"OT_USER_MEDIA_ACCESS_DENIED",XDOMAIN_OR_PARSING_ERROR:"OT_XDOMAIN_OR_PARSING_ERROR",API_KEY_DISABLED:"OT_API_KEY_DISABLED",UNABLE_TO_ACCESS_MEDIA_ENGINE:"OT_UNABLE_TO_ACCESS_MEDIA_ENGINE",SET_PROXY_URL_TIMING_ERROR:"OT_SET_PROXY_URL_TIMING_ERROR",PROXY_URL_ALREADY_SET_ERROR:"OT_PROXY_URL_ALREADY_SET_ERROR",SET_VIDEO_SOURCE_FAILURE:"OT_SET_VIDEO_SOURCE_FAILURE",INVALID_VIDEO_SOURCE:"OT_INVALID_VIDEO_SOURCE",REQUESTED_DEVICE_PERMISSION_DENIED:"OT_REQUESTED_DEVICE_PERMISSION_DENIED",INVALID_AUDIO_OUTPUT_SOURCE:"OT_INVALID_AUDIO_OUTPUT_SOURCE",INVALID_ENCRYPTION_SECRET:"OT_INVALID_ENCRYPTION_SECRET"}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){const t=new a.default;t.on("newListener",e=>{t.emit(e+":added")}),t.on("removeListener",e=>{t.emit(e+":removed")});const n={eventsDispatched:{},on(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.on(e,(0,c.default)(n,r))}):Object.keys(e).forEach(r=>{t.on(r,(0,c.default)(e[r],n))}),this},off(e,n,r){return"string"==typeof e?this.off(e.split(" "),n,r):Array.isArray(e)?e.forEach(e=>{n&&(0,o.default)(n)?t.removeListener(e,(0,c.default)(n,r)):t.removeAllListeners(e)}):e?Object.keys(e).forEach(r=>{t.removeListener(r,(0,c.default)(e[r],n))}):t.removeAllListeners(),this},once(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.once(e,(0,c.default)(n,r))}):Object.keys(e).forEach(r=>{t.once(r,(0,c.default)(e[r],n))}),this},dispatchEvent(e){if(!e.type)throw new Error("dispatchEvent: Event has no type");return e.target||(e.target=this),this.trigger(e.type,e),this},dispatchEventOnce(e,t){this.isEventDispatched(e.type,t)||(this.dispatchEvent(e),this.eventsDispatched[e.type]?this.eventsDispatched[e.type].push(t):this.eventsDispatched[e.type]=[t])},isEventDispatched(e,t){var n;return null==(n=this.eventsDispatched[e])?void 0:n.includes(t)},trigger(e){try{for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.emit(e,...r)}catch(e){s.error("An error occurred in an event handler",e)}return this},emit(){return e.trigger(...arguments)},addEventListener:(t,n,r)=>(s.warn("The addEventListener() method is deprecated. Use on() or once() instead."),e.on(t,n,r)),removeEventListener:(t,n,r)=>(s.warn("The removeEventListener() method is deprecated. Use off() instead."),e.off(t,n,r)),listenerCount:e=>t.listenerCount(e)};return(0,i.default)(e,n)};var i=r(n(10)),o=r(n(18)),a=r(n(11)),l=r(n(2)),c=r(n(428));const s=(0,l.default)("Events")},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(147)),o=r(n(264)),a=r(n(7)),l=r(n(2)),c=r(n(3)),s=r(n(266)),d=r(n(265)),u=r(n(267)),A=r(n(579)),h=r(n(269)),g=r(n(272)),Q=r(n(593)),F=r(n(153));o.default.logging=(0,l.default)("OT.$"),o.default.env=c.default,o.default.ElementCollection=d.default,o.default.ajax=u.default,o.default.statable=A.default,o.default.Analytics=h.default,o.default.Collection=g.default,o.default.domExtras=Q.default,o.default.Error=F.default,(0,s.default)(o.default,"useLogHelpers",{value(e){const t=(0,l.default)("useLogHelpersDeprecatedMixin");return Object.keys(t).forEach(n=>{e[n]=t[n]}),e},name:"OT.useLogHelpers",getWarning:"Please use an external library for your debugging needs"}),o.default.defaults=i.default,(0,s.default)(o.default,"eventing",{value:a.default,name:"OT.$.eventing",getWarning:"Please use an external library to create an event emitter."}),Object.keys(o.default).forEach(e=>{const t=o.default[e]._attachToOTHelpers||{};Object.keys(t).forEach(n=>{!Object.hasOwnProperty.call(o.default,n)||"util"===e&&"bind"===n||console.warn(`More than one module is trying to define ${n} on OTHelpers.`),o.default[n]=t[n]})});var p=o.default;t.default=p},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={JS_EXCEPTION:2e3,AUTHENTICATION_ERROR:1004,INVALID_SESSION_ID:1005,CONNECT_FAILED:1006,CONNECT_REJECTED:1007,CONNECTION_TIMEOUT:1008,NOT_CONNECTED:1010,INVALID_PARAMETER:1011,P2P_CONNECTION_FAILED:1013,API_RESPONSE_FAILURE:1014,PEER_CONNECTION_NOT_CONNECTED:1015,TERMS_OF_SERVICE_FAILURE:1026,CONNECTION_LIMIT_EXCEEDED:1027,UNABLE_TO_PUBLISH:1500,UNABLE_TO_SUBSCRIBE:1501,UNSUPPORTED_VIDEO_CODEC:1502,UNABLE_TO_FORCE_DISCONNECT:1520,UNABLE_TO_FORCE_UNPUBLISH:1530,UNABLE_TO_FORCE_MUTE:1540,PUBLISHER_ICE_WORKFLOW_FAILED:1553,SUBSCRIBER_ICE_WORKFLOW_FAILED:1554,STREAM_LIMIT_EXCEEDED:1605,UNEXPECTED_SERVER_RESPONSE:2001,REPORT_ISSUE_ERROR:2011,SET_PROXY_URL_TIMING_ERROR:2021,PROXY_URL_ALREADY_SET_ERROR:2022,GET_RTC_STATS_REPORT_NOT_SUPPORTED:2031,ANVIL_BADLY_FORMED_RESPONSE:3001,ANVIL_INVALID_HTTP_STATUS:3002,ANVIL_XDOMAIN_OR_PARSING_ERROR:3003,ANVIL_UNKNOWN_HTTP_ERROR:3004,ANVIL_UNEXPECTED_ERROR_CODE:3005,ANVIL_EMPTY_RESPONSE_BODY:3006,ANVIL_CONNECT_FAILED:3007,UNABLE_TO_ACCESS_MEDIA_ENGINE:5001};t.default=r},function(e,t,n){var r=n(87),i=n(44),o=n(210),a=n(29),l=n(70),c=n(34),s=Object.prototype.hasOwnProperty,d=o((function(e,t){if(l(t)||a(t))i(t,c(t),e);else for(var n in t)s.call(t,n)&&r(e,n,t[n])}));e.exports=d},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=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 o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,n){return new t((function(t,r){function i(t){e.removeListener(n,o),r(t)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),t([].slice.call(arguments))}F(e,n,o,{once:!0}),"error"!==n&&function(e,t,n){"function"==typeof e.on&&F(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 l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,o,a,l;if(c(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),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=s(e))>0&&a.length>i&&!a.warned){a.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=a.length,l=d,console&&console.warn&&console.warn(l)}return e}function u(){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 A(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(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):Q(i,i.length)}function g(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 Q(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function F(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 l},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=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||o(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 s(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var s=c.length,d=Q(c,s);for(n=0;n<s;++n)i(d[n],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,A(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,A(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,o,a;if(c(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){a=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,a||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 h(this,e,!0)},a.prototype.rawListeners=function(e){return h(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(1))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";var r,i=n(225),o=Object.prototype.toString,a=(r=Object.create(null),function(e){var t=o.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function l(e){return e=e.toLowerCase(),function(t){return a(t)===e}}function c(e){return Array.isArray(e)}function s(e){return void 0===e}var d=l("ArrayBuffer");function u(e){return"number"==typeof e}function A(e){return null!==e&&"object"==typeof e}function h(e){if("object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var g=l("Date"),Q=l("File"),F=l("Blob"),p=l("FileList");function U(e){return"[object Function]"===o.call(e)}var m=l("URLSearchParams");function b(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var B,Z=(B="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return B&&e instanceof B});var f,R=l("HTMLFormElement"),I=(f=Object.prototype.hasOwnProperty,function(e,t){return f.call(e,t)});e.exports={isArray:c,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return e&&("function"==typeof FormData&&e instanceof FormData||"[object FormData]"===o.call(e)||U(e.toString)&&"[object FormData]"===e.toString())},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:u,isObject:A,isPlainObject:h,isEmptyObject:function(e){return e&&0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype},isUndefined:s,isDate:g,isFile:Q,isBlob:F,isFunction:U,isStream:function(e){return A(e)&&U(e.pipe)},isURLSearchParams:m,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function e(){var t={};function n(n,r){h(t[r])&&h(n)?t[r]=e(t[r],n):h(n)?t[r]=e({},n):c(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)b(arguments[r],n);return t},extend:function(e,t,n){return b(t,(function(t,r){e[r]=n&&"function"==typeof t?i(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var i,o,a,l={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)a=i[o],r&&!r(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==n&&Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:l,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(c(e))return e;var t=e.length;if(!u(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:Z,isFileList:p,forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var i=n.value;t.call(e,i[0],i[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:R,hasOwnProperty:I}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.Errors||o.default,n=e.OTErrorClass||i.default,r=Object.keys(t).map(e=>t[e]);return function(e,t,i){if(-1===r.indexOf(e))return new Error(`Attempt to use invalid error name (${e}). Original message: ${t.message}`);if(!(t instanceof Error||/^\[object .*Error\]$/.test(Object.prototype.toString.call(t))))return new Error("Did not pass Error as second argument: "+t);const o=new n(void 0,t.message);if(o.name=e,!t.stack)try{throw t}catch(e){}return o.stack=t.stack,i&&(o.code=i),o}};var i=r(n(23)),o=r(n(6))},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(192),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.logging||(0,a.default)("Events"),n={ExceptionEvent:function(e,t,n,r,i,o,a){return new l.default(e,!1,{error:a,message:t,title:n,code:r,component:i,target:o})},IssueReportedEvent:function(e,t){return new l.default(e,!1,{issueId:t})},EnvLoadedEvent:function(e){return new l.default(e,!1)}};let r=!1;n.ConnectionEvent=function(e){function n(t,n,r){return e.call(this,t,!1,{connection:n,reason:r})||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"connections",get:function(){return r||(t.warn("OT.ConnectionEvent connections property is deprecated, use connection instead."),r=!0),[this.connection]}}]),n}(l.default);let s=!1;n.StreamEvent=function(e){function n(t,n,r,i){return e.call(this,t,i,{stream:n,reason:r})||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"streams",get:function(){return s||(t.warn("OT.StreamEvent streams property is deprecated, use stream instead."),s=!0),[this.stream]}}]),n}(l.default);let d=!1,u=!1,A=!1;return n.SessionConnectEvent=function(e){function n(t){return e.call(this,t,!1)||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"connections",get:function(){return d||(t.warn("OT.SessionConnectedEvent no longer includes connections. Listen for connectionCreated events instead."),d=!0),[]}},{key:"streams",get:function(){return u||(t.warn("OT.SessionConnectedEvent no longer includes streams. Listen for streamCreated events instead."),u=!0),[]}},{key:"archives",get:function(){return A||(t.warn("OT.SessionConnectedEvent no longer includes archives. Listen for archiveStarted events instead."),A=!0),[]}}]),n}(l.default),n.SessionReconnectingEvent=function(){return new l.default(c.default.SESSION_RECONNECTING,!1)},n.SessionReconnectedEvent=function(){return new l.default(c.default.SESSION_RECONNECTED)},n.SessionDisconnectEvent=function(e,t,n){return new l.default(e,n,{reason:t})},n.StreamPropertyChangedEvent=function(e,t,n,r,i){return new l.default(e,!1,{stream:t,changedProperty:n,oldValue:r,newValue:i})},n.VideoDimensionsChangedEvent=function(e,t,n){return new l.default("videoDimensionsChanged",!1,{target:e,oldValue:t,newValue:n})},n.ArchiveEvent=function(e,t){return new l.default(e,!1,{id:t.id,name:t.name,status:t.status,archive:t})},n.ArchiveUpdatedEvent=function(e,t,n,r){return new l.default("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},n.SignalEvent=function(e,t,n){return new l.default(e?"signal:"+e:c.default.SIGNAL,!1,{data:t,from:n})},n.CpuPerformanceChangedEvent=function(e){return new l.default("cpuPerformanceChanged",!1,{cpuPerformanceState:e})},n.QualityScoreChangedEvent=function(e){return new l.default("qualityScoreChanged",!1,{qualityScore:e})},n.CaptionReceivedEvent=function(e,t,n){return new l.default("caption",!1,{caption:e,streamId:t,isFinal:n})},n.PublisherCaptionsEnabled=function(e){return new l.default("publisherCaptionsEnabled",!1,{captionsEnabled:e})},n.MediaStreamAvailableEvent=function(e){return new l.default("mediaStreamAvailable",!1,{mediaStream:e})},n.StreamUpdatedEvent=function(e,t,n,r){return new l.default("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},n.DestroyedEvent=function(e,t,n){return new l.default(e,!1,{target:t,reason:n})},n.ConnectionStateChangedEvent=function(e,t,n){return new l.default(e,!1,{target:t,mediaMode:n})},n.VideoEnabledChangedEvent=function(e,t){return new l.default(e,!1,{reason:t.reason})},n.VideoDisableWarningEvent=function(e){return new l.default(e,!1)},n.AudioLevelUpdatedEvent=function(e){return new l.default(c.default.AUDIO_LEVEL_UPDATED,!1,{audioLevel:e})},n.AudioInputDeviceChangedEvent=function(e){return new l.default(c.default.AUDIO_INPUT_DEVICE_CHANGED,!1,{device:e})},n.MediaStoppedEvent=function(e,t){return new l.default(c.default.MEDIA_STOPPED,!0,{target:e,track:t})},n.MuteForcedEvent=function(e){return new l.default(c.default.MUTE_FORCED,!1,e)},n.VideoElementCreatedEvent=function(e){return new l.default(c.default.VIDEO_ELEMENT_CREATED,!1,{element:e})},n};var i=r(n(26)),o=r(n(24)),a=r(n(2)),l=r(n(148)),c=r(n(30))},function(e,t,n){var r=n(33),i=n(12);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(580),i=n(581),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(10)),o=r(n(77)),a=r(n(298)),l=r(n(149)),c=r(n(299)),s=r(n(2)),d=r(n(300));function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const h=(0,s.default)("SDPHelpers"),g={getSections:e=>e.split(/\r\n|\r|\n/).reduce((e,t)=>{const n=t.match(/^m=(\w+) \d+/);return n&&(e.sections[e.section=n[1]]=[]),e.sections[e.section].push(t),e},{sections:{header:[]},section:"header"}).sections,getCodecsFromSection:e=>({codecs:e[0].match(/m=\w+ \d+ [A-Z/]+ ([\d ]+)$/)[1].split(" "),codecMap:(0,i.default)(...e.filter(e=>e.match(/^a=rtpmap:\d+/)).map(e=>e.match(/^a=rtpmap:(\d+) ([\w-]+)/).splice(1)).map(e=>({[e[0]]:e[1]})))}),getCodecsAndCodecMap(e,t){const n=g.getSections(e)[t];if(!n)throw new Error("no mediaType "+t);return g.getCodecsFromSection(n)},getCodecs(e,t){const n=g.getCodecsAndCodecMap(e,t);return n.codecs.map(e=>n.codecMap[e]||"Unknown codec")},MediaDirection:d.default,iceCredentials:{ufrag:"a=ice-ufrag:",pwd:"a=ice-pwd:"},getMLineIndex:function(e,t){const n="m="+t;return(0,a.default)(e,e=>-1!==e.indexOf(n))},getMLine:function(e,t){const n=g.getMLineIndex(e,t);return n>-1?e[n]:void 0},hasMediaType:(e,t)=>{const n=new RegExp("^m="+t),r=e.split("\r\n");return(0,a.default)(r,e=>n.test(e))>=0},hasMLinePayloadType:function(e,t,n){const r=g.getMLine(e,t);return g.getMLinePayloadTypes(r,t).indexOf(n)>-1},getMLinePayloadTypes:function(e,t){const n=new RegExp(`^m=${t} \\d+(/\\d+)? [a-zA-Z0-9/]+(( [a-zA-Z0-9/]+)+)$`,"i"),r=e.match(n);return!r||r.length<2?[]:r[2].trim().split(" ")},splitSections:function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},getLinesPerSection:e=>g.splitSections(e).map(e=>g.getSDPLines(e)),replaceDirectionInSdpLines:(e,t,n)=>{const r=e.join("\r\n");return g.replaceDirection(r,t,n).split("\r\n")},replaceDirection:(e,t,n)=>{const r=new RegExp("a="+t,"g");return e.replace(r,"a="+n)},setSubscriberMediaSectionToInactive:e=>{const t=d.default.SENDONLY,n=d.default.INACTIVE;return g.replaceDirectionInSdpLines(e,t,n)},changeMediaDirection:function(e,t){const n=g.splitSections(e);let r=n.shift();const i=d.default.RECVONLY,o=d.default.INACTIVE,a=t===i?o:i;return n.forEach(e=>{const n=e.includes("m=video")?g.replaceDirection(e,a,t):e;r+=n}),r},removeTypesFromMLine:function(e,t){const n=/[0-9 ]*$/.exec(e)[0],r=n.split(" ").filter(e=>""!==e&&-1===t.indexOf(e));return e.replace(n," "+r.join(" "))},removeMediaEncoding:function(e,t,n){let r,i,o,a,l=e.split("\r\n");const c=g.getMLineIndex(l,t),s=c>-1?l[c]:void 0,d=[];if(-1===c)return l.join("\r\n");if(r=g.getMLinePayloadTypes(s,t),0===r.length)return l.join("\r\n");for(i=c;i<l.length;i++){const e=new RegExp(n,"i");0===l[i].indexOf("a=rtpmap:")&&(a=l[i].split(" "),2===a.length&&e.test(a[1])&&d.push(a[0].substr(9)))}if(!d.length)return l.join("\r\n");for(i=c;i<l.length;i++)if(0===l[i].indexOf("a=fmtp:"))for(a=l[i].split(" "),o=0;o<d.length;o++)2===a.length&&a[1]==="apt="+d[o]&&d.push(a[0].substr(7));return l=l.filter(e=>{for(let t=0;t<d.length;t++)if(0===e.indexOf(`a=rtpmap:${d[t]} `)||0===e.indexOf(`a=fmtp:${d[t]} `)||0===e.indexOf(`a=rtcp-fb:${d[t]} `))return!1;return!0}),d.length>0&&c>-1&&(l[c]=g.removeTypesFromMLine(s,d)),l.join("\r\n")},disableMediaType:function(e,t){const n=e.split("\r\n"),r=[];let i;n.forEach(e=>{let t=e;/^m=/.test(t)&&(i=void 0),i||(i=[],r.push(i)),i.push(t)});const o=new RegExp(`^m=${t} \\d+ ([^ ]+) [0-9 ]+$`),a=r.map(e=>{const n=e[0].match(o);return n?[`m=${t} 0 ${n[1]} 0`,"a=inactive",...e.filter(e=>/^c=/.test(e)||/^a=mid:/.test(e)||""===e)]:e});return[].concat(...a).join("\r\n")},removeVideoCodec:function(e,t){return g.removeMediaEncoding(e,"video",t)}},Q=function(e,t){let n=t.filterByName("ssrc-group:FID");switch(n=0===n.length?[]:n[0].value.split(" "),n.length){case 0:case 1:var r=t.find(e=>0===e.name.indexOf("rtpmap:")&&e.value.indexOf("rtx/90000")>-1);if(!r)return!1;var i=r.name.split(":")[1];return i.indexOf("/")>-1&&(i=i.split("/")[0]),g.hasMLinePayloadType(e,"video",i);default:return h.debug("SDP Helpers: There are more than two FIDs, RTX is definitely enabled"),!0}};g.getAttributesForMediaType=function(e,t){let n,r,i,a,l,c,s,d,u,A;const h=g.getMLineIndex(e,t),F=new RegExp(`m=(?!${t}).+ `,"i"),p=new RegExp("a=ssrc:\\d+ .*","i"),U=new RegExp("a=ssrc-group:(SIM|FID) (\\d+).*?","i"),m=new RegExp("a=([a-z0-9:/-]+) (.*)","i"),b=[];for(let t=h+1;t<e.length;t++){if(F.test(e[t])){void 0!==n&&(r=t-1);break}l=e[t].match(U),c=e[t].match(p),void 0===n&&(l||c)&&(n=t,l&&(a=/^(FID|SIM)$/.test(l[1])?l[2]:l[1])),s=e[t].match(`a=ssrc:${a} msid:(.+)`),s&&(d=s[1]);const o=p.test(e[t]),h=U.test(e[t]);void 0!==n&&(void 0!==r||o||h?t===e.length-1&&(r=t):r=t-1);const g=e[t].match(/a=mid:(.+)/);g&&(u=g[1],A=t),i=m.exec(e[t]),i&&3===i.length&&b.push({lineIndex:t,name:i[1],value:i[2]})}return b.ssrcStartIndex=n,b.ssrcEndIndex=r,b.msid=d,b.mid=u,b.midIndex=A,b.isUsingRTX=Q.bind(null,e,b),b.filterByName=function(e){return this.filter(t=>t.name===e)},b.getRtpNumber=e=>{const t=new RegExp("rtpmap:(.+)");return(0,o.default)(b.map(n=>{const r=n.name.match(t);return r&&n.value.indexOf(e)>=0?r[1]:null}),e=>null!==e)},b},g.modifyDtx=(e,t)=>{const n=e.split("\r\n");if(!g.getMLine(n,"audio"))return h.debug("No audio m-line, not enabling dtx."),e;const r=g.getAttributesForMediaType(n,"audio"),i=r.getRtpNumber("opus");if(!i)return h.debug("Could not find rtp number for opus, not enabling dtx."),e;const o=r.find(e=>e.name==="fmtp:"+i);if(!o)return h.debug("Could not find a=fmtp line for opus, not enabling dtx."),e;let a=n[o.lineIndex];const l=/usedtx=\d+([\s;]*)/;return l.test(o.value)?a=a.replace(l,t?"usedtx=1$1":""):t&&(a+="; usedtx=1"),a=a.replace(/[;\s]*$/,""),n[o.lineIndex]=a,n.join("\r\n")};const F=(e,t,n)=>{const r=t.split("\r\n");if(!g.getMLine(r,"audio"))return h.debug("No audio m-line, not enabling stereo."),t;const i=g.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return h.debug("Could not find rtp number for opus, not enabling stereo."),t;const a=i.find(e=>e.name==="fmtp:"+o);if(!a)return h.debug("Could not find a=fmtp line for opus, not enabling stereo."),t;let l,c=r[a.lineIndex];switch(e){case"send":l=/sprop-stereo=\d+([\s;]*)/,l.test(a.value)?c=c.replace(l,n?"sprop-stereo=1$1":""):n&&(c+="; sprop-stereo=1");break;case"receive":{l=/([^-])stereo=\d+([\s;]*)/;const e="stereo="+(n?"1":"0");l.test(a.value)?c=c.replace(l,`$1${e}$2`):c+="; "+e;break}default:throw new Error(`Invalid type ${e} passed into enableStereo`)}return c=c.replace(/[;\s]*$/,""),r[a.lineIndex]=c,r.join("\r\n")};g.modifySendStereo=F.bind(null,"send"),g.modifyReceiveStereo=F.bind(null,"receive"),g.setAudioBitrate=(e,t)=>{const n=g.getAudioBitrate(e);if(void 0!==n)return h.debug(`Audio bitrate already set to ${n}, not setting audio bitrate`),e;const r=e.split("\r\n");if(!g.getMLine(r,"audio"))return h.debug("No audio m-line, not setting audio bitrate"),e;const i=g.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return h.debug("Could not find rtp number for opus, not setting audio bitrate."),e;const a=i.find(e=>e.name==="fmtp:"+o);if(!a)return h.debug("Could not find a=fmtp line for opus, not setting audio bitrate."),e;let l=r[a.lineIndex];return l+="; maxaveragebitrate="+t,l=l.replace(/[;\s]*$/,""),r[a.lineIndex]=l,r.join("\r\n")},g.removeVideoOrientation=e=>{let t=e.split("\r\n");return t=t.filter(e=>!e.includes("urn:3gpp:video-orientation")),t.join("\r\n")},g.hasSendStereo=e=>/[\s;]sprop-stereo=1/.test(e),g.hasSendDtx=e=>/[\s;]usedtx=1/.test(e),g.hasOpusFec=e=>/[\s;]useinbandfec=1/.test(e),g.getAudioBitrate=e=>{const t=e.match(/[\s;]maxaveragebitrate=(\d+)/);if(t)return Number(t[1])},g.MAX_SSRCS=10,g.getSSRCGroupType=e=>["SIM","FID"].find(t=>e.filterByName("ssrc-group:"+t)[0]),g.getSSRCGroup=e=>{const t=g.getSSRCGroupType(e);return e.filterByName("ssrc-group:"+t)[0]},g.getSSRCGroupSSRCs=e=>{const t=g.getSSRCGroup(e);return t?t.value.split(" ").slice(0,g.MAX_SSRCS):[]},g.getAllowedSSRCs=(e,t)=>{const n=t.slice();return e.filterByName("ssrc-group:FID").forEach(e=>{const t=e.value.split(" ");(0,l.default)(n,t).length&&Array.prototype.push.apply(n,t)}),(0,c.default)(n)},g.filterExcessSSRCs=e=>{const t=e.split("\r\n"),n=g.getAttributesForMediaType(t,"video"),r=g.getSSRCGroupType(n),i=n.ssrcStartIndex;if(void 0===i)return e;let o;const a=e=>{let t=null;return e.match(/^a=ssrc:(\d+)/)&&(t=RegExp.$1),t};if(r){const e=g.getSSRCGroupSSRCs(n),i=["a=ssrc-group:"+r,...e].join(" ");t[n.find(e=>e.name.startsWith("ssrc-group:")).lineIndex]=i,o=g.getAllowedSSRCs(n,e)}else{o=[];n.ssrcStartIndex&&o.push(a(t[n.ssrcStartIndex]))}return t.filter((e,t)=>{if(t<i||t>n.ssrcEndIndex)return!0;if(t===i){if(!r){const t=a(e);return t?o.includes(t):!/^a=ssrc:(\d+)/.test(e)}return!0}const l=a(e);if(l)return o.includes(l);if(e.match(/^a=ssrc-group:FID (\d+)/)){const e=RegExp.$1;return o.includes(e)}return!e.match(/^a=ssrc-group:SIM /)}).join("\r\n")},g.enableSimulcast=function(e,t){let n,r;const i=e.split("\r\n");if(!g.getMLine(i,"video"))return h.debug("No video m-line, not enabling simulcast."),e;const o=g.getAttributesForMediaType(i,"video");if(o.filterByName("ssrc-group:SIM").length>0)return h.debug("Simulcast is already enabled in this SDP, not attempting to enable again."),g.filterExcessSSRCs(e);if(!o.msid)return h.debug("No local stream attached, not enabling simulcast."),e;const a=o.isUsingRTX(),l=[],c=[];for(r=0;r<t;++r)l.push(1e4+r),a&&c.push(2e4+r);if(n=["a=ssrc-group:SIM "+l.join(" ")],a)for(r=0;r<t;++r)n.push(`a=ssrc-group:FID ${l[r]} ${c[r]}`);for(r=0;r<t;++r)n.push(`a=ssrc:${l[r]} cname:localCname`,`a=ssrc:${l[r]} msid:${o.msid}`);if(a)for(r=0;r<t;++r)n.push(`a=ssrc:${c[r]} cname:localCname`,`a=ssrc:${c[r]} msid:${o.msid}`);return n.unshift(o.ssrcStartIndex,o.ssrcEndIndex-o.ssrcStartIndex+1),i.splice(...n),i.join("\r\n")},g.reprioritizeVideoCodec=function(e,t,n){const r=e.split("\r\n"),i=g.getMLineIndex(r,"video");if(-1===i)return e;const o=g.getMLinePayloadTypes(r[i],"video"),a=new RegExp("^a=rtpmap:(\\d+).* "+t,"i"),l=r.map(e=>e.match(a)).filter(e=>null!==e);if(0===l.length)return e;const c=l.map(e=>e[1]);let s=o.filter(e=>-1===c.indexOf(e));"top"===n?s.unshift(...c):"bottom"===n?s.push(...c):(h.error(`Unexpected location param: ${n}; not changing ${t} priority`),s=o);const d=r[i].replace(o.join(" "),s.join(" "));return r[i]=d,r.join("\r\n")},g.getSetupRole=e=>{for(var t,n=u(e.split(/\r\n|\r|\n/));!(t=n()).done;){const e=t.value.match(/^a=setup:(\w+)/);if(e)return e[1]}return""},g.setSetupRole=(e,t)=>e.split(/\r\n|\r|\n/).map(e=>e.match(/^a=setup:(\w+)/)?"a=setup:"+t:e).join("\r\n"),g.changeSetupRole=(e,t,n)=>e.split(/\r\n|\r|\n/).map(e=>e.includes("a=setup:"+t)?"a=setup:"+n:e).join("\r\n"),g.patterns={bundle:"a=group:BUNDLE",address:"c=IN IP4",rtcp:"a=rtcp:",direction:["a=inactive","a=sendonly","a=recvonly","a=sendrecv"],rsize:"a=rtcp-rsize",ssrc:"a=ssrc:",msid:"a=msid:",extension:"a=extmap:",candidate:"a=candidate:"},g.getIndexStartingWith=(e,t,n)=>{const r=e.slice(n),i=t.map(e=>r.findIndex(t=>t.includes(e))).filter(e=>e>-1);return i.length?n+Math.min(...i):e.length},g.getLastIndexPriorTo=(e,t,n)=>e.slice(0,n).map(e=>e.includes(t)).lastIndexOf(!0),g.includesAny=(e,t)=>{for(let n=0;n<t.length;n++)if(e.includes(t[n]))return!0;return!1},g.isVersionLine=e=>/^o=/.test(e),g.getVersionLine=e=>e.find(g.isVersionLine),g.getVersion=e=>{const t=g.getVersionLine(e);if(void 0===t)return;const n=Number(t.match(/ (\d+) IN /)[1]);return Number.isInteger(n)?n:void 0},g.updateVersion=(e,t,n)=>{const r=[...e],i=r.findIndex(e=>g.isVersionLine(e));return i>=0&&(r[i]=r[i].replace(` ${t} `,` ${n} `)),r},g.isBundleLine=e=>e.includes(g.patterns.bundle),g.getBundleLine=e=>e.find(g.isBundleLine),g.createBundleLine=e=>`${g.patterns.bundle} ${e.join(" ")}`,g.updateBundleLine=(e,t)=>{const n=[...e],r=g.createBundleLine(t),i=n.findIndex(e=>g.isBundleLine(e));return i>=0&&(n[i]=r),n},g.parseMLine=e=>{const t=e.match(/^(m=(?:audio|video)) (\d+) (.+)/),n=t[1];return{port:t[2],transport:t[3],mediaType:n}},g.disableTrack=e=>{const t=g.parseMLine(e);return`${t.mediaType} 0 ${t.transport}`},g.isDisabledMediaSection=e=>{let t=e[0];return/^m=(?:video|audio) 0 RTP\/SAVPF 0/.test(t)},g.getDisabledSectionForMid=e=>[`m=${e.includes("a")?"audio":"video"} 0 RTP/SAVPF 0`],g.getEnabledTracks=e=>g.getBundleLine(e).match(new RegExp(`^${g.patterns.bundle} (.+)$`))[1].split(" "),g.getDisabledTracks=(e,t)=>e.filter(e=>!t.includes(e)),g.getTrackSection=(e,t)=>{const n=e.findIndex(e=>e.includes("a=mid:"+t)),r=t.includes("a")?"audio":"video",i=g.getLastIndexPriorTo(e,"m="+r,n),o=g.getIndexStartingWith(e,["m=audio","m=video"],n),a=e.slice(i,o);return{mid:t,sdp:a}},g.getHeaders=e=>{const t=e.findIndex(e=>e.includes("m=audio")||e.includes("m=video"));return e.slice(0,t)},g.getSDPLines=e=>e.split("\r\n").filter(e=>e),g.getTrackMids=e=>e.filter(e=>e.match(new RegExp("^a=mid:\\d+"))).map(e=>e.substring("a=mid:".length)),g.getTrackSections=e=>g.getTrackMids(e).map(t=>g.getTrackSection(e,t)),g.parseMantisSDP=e=>{const t=g.changeSetupRole(e,"actpass","passive");return g.parseSDP(t)},g.isMediaSectionDisabled=e=>{const t=g.parseMLine(e[0]).port;return 0===parseInt(t,10)},g.getSectionMid=e=>g.isMediaSectionDisabled(e)?null:g.getTrackMids(e)[0],g.parseSDP=e=>{const t=g.getLinesPerSection(e),n=t[0],r=t.slice(1);return{bundle:g.getBundleLine(n),version:g.getVersion(n),iceCredentials:g.getIceCredentials(n),tracks:g.getEnabledTracks(n),mediaSections:r,mids:r.map(g.getSectionMid),headers:n}},g.createSDP=(e,t)=>{const n=[...e];return t.forEach(e=>n.push(...e)),n.push(""),n.join("\r\n")},g.updateSDPWithNewOffer=(e,t)=>{const n=e.headers,r=e.version,i=e.mediaSections,o=g.getSDPLines(t),a=g.getVersion(o),l=g.getEnabledTracks(o),c={version:a,tracks:l,headers:g.updateBundleLine(g.updateVersion(n,r,a),l),mediaSections:g.disableTrackSections(l,i)};return c.mids=c.mediaSections.map(g.getSectionMid),c},g.isUfragLine=e=>e.includes(g.iceCredentials.ufrag),g.isPwdLine=e=>e.includes(g.iceCredentials.pwd),g.getIceCredentials=e=>{const t={};return e.forEach(e=>{g.isUfragLine(e)?t.ufrag=e:g.isPwdLine(e)&&(t.pwd=e)}),t},g.isExtensionLine=e=>e.includes(g.patterns.extension),g.getExtensions=e=>e.filter(g.isExtensionLine),g.updateIceCredentials=(e,t)=>e.map(e=>g.isUfragLine(e)?t.ufrag:g.isPwdLine(e)?t.pwd:e),g.isCandidateLine=e=>e.includes(g.patterns.candidate),g.updateCandidates=(e,t)=>{const n=e.some(g.isCandidateLine);let r=[...e];if(n){const e=t.filter(g.isCandidateLine);r=r.filter(e=>!g.isCandidateLine(e));const n=r.findIndex(e=>"a=end-of-candidates"===e);r.splice(n,0,...e)}return r},g.addIceCredentialsToSection=(e,t)=>{let n=t.ufrag,r=t.pwd;const i=[...e],o=i.findIndex(e=>e.startsWith("a=mid:"));return o>=0&&i.splice(o,0,n,r),i},g.addIceCandidatesToSection=(e,t)=>{const n=[...e],r=t.filter(e=>e.startsWith("a=candidate:")||"a=end-of-candidates"===e),i=n.findIndex(e=>e.startsWith("a=mid:"));return i>=0&&r.length&&n.splice(i,0,...r),n},g.addIceConfig=(e,t,n)=>{const r=[...e],i=e[0];if(!g.getIceCredentials(i).ufrag){const e=g.addIceCredentialsToSection(i,n);r[0]=g.addIceCandidatesToSection(e,t)}return r},g.updateHeadersInPartialSdp=(e,t,n)=>{if(!e.headers.length)return g.updateBundleLine(t.headers,n);let r=g.updateBundleLine(e.headers,n);return r=g.updateVersion(r,e.version,t.version),e.iceCredentials.ufrag!==t.iceCredentials.ufrag&&(r=g.updateIceCredentials(r,t.iceCredentials)),r},g.updateFirstEnabledMediaSection=(e,t)=>{const n=[...e.mediaSections],r=e.mids.findIndex(e=>null!==e);if(r>=0){const i=g.updateIceCredentials(n[r],t);n[r]=g.updateCandidates(i,e.headers)}return n};var p=g;t.default=p},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),a=r(n(3)),l=r(n(108)),c=r(n(263)),s=r(n(571));var d=function(t){void 0===t&&(t={});const n=t.getNativeEnumerateDevices||(0,c.default)(),r=t.getNativeMediaDevices||(0,s.default)(),d=(t.currentAudioOutputDevice||l.default).getCurrentAudioOutputDeviceId,u=t.env||a.default,A=t.global||(void 0!==typeof window?window:global),h={},g={audio:"audioInput",video:"videoInput",audioinput:"audioInput",videoinput:"videoInput",audiooutput:"audioOutput",audioInput:"audioInput",videoInput:"videoInput",audioOutput:"audioOutput"};return h.getNativeMediaDevices=()=>r(),h.hasEnumerateDevicesCapability=()=>"function"==typeof n(),h.hasDeviceChangeCapability=()=>{const e=r();return!(!e||!("ondevicechange"in e))},h.hasSetSinkIdCapability=()=>"setSinkId"in(null==A?void 0:A.HTMLMediaElement.prototype),h.hasAudioOutputApiSupport=()=>{const e=t.hasSetSinkIdCapability,n=void 0===e?h.hasSetSinkIdCapability:e,r=t.hasDeviceChangeCapability,i=void 0===r?h.hasDeviceChangeCapability:r;return n()&&i()},h.hasEnumerateDevicesBug=()=>u.isSafari&&13.1===u.version,h.getMediaDevices=()=>h.hasEnumerateDevicesCapability()?n()().then(e=>e.map(e=>({deviceId:e.deviceId||e.id,label:e.label,kind:g[e.kind]}))):e.reject(new Error("This browser does not support enumerateDevices APIs")),h.getInputMediaDevices=()=>h.getMediaDevices().then(e=>e.filter(e=>/^(audio|video)Input$/.test(e.kind))),h.getAudioOutputMediaDevices=()=>h.getMediaDevices().then(e=>e.filter(e=>"audioOutput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),h.getAudioInputMediaDevices=()=>h.getMediaDevices().then(e=>e.filter(e=>"audioInput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),h.shouldAskForDevices=()=>h.hasEnumerateDevicesCapability()?h.getInputMediaDevices().then(e=>{if(0===e.length)return{video:!0,audio:!0};const t=e.filter(e=>"audioInput"===e.kind),n=e.filter(e=>"videoInput"===e.kind);return h.hasEnumerateDevicesBug()&&0===n.length?{audio:!0,video:!0}:{video:n.length>0,audio:t.length>0,videoDevices:n,audioDevices:t}}).catch(()=>({video:!0,audio:!0})):e.resolve({video:!0,audio:!0}),h.getDefaultAudioOutputDeviceId=e=>{if(!Array.isArray(e)||0===e.length)return"";return(e.find(e=>"default"===e.deviceId)||e[0]).deviceId},h.hasDevice=(e,t)=>{let n=e;return Array.isArray(n)||(n=[]),n.some(e=>e.deviceId===t)},h.getActiveAudioOutputDevice=(0,o.default)(i.default.mark((function e(){var t,n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,h.getAudioOutputMediaDevices();case 3:t=e.sent,e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(0),e.t0;case 9:if(0!==t.length){e.next=11;break}return e.abrupt("return",{deviceId:null,label:null});case 11:return(n=t.find(e=>e.deviceId===d()))||(r=h.getDefaultAudioOutputDeviceId(t),n=t.find(e=>e.deviceId===r)),e.abrupt("return",n);case 14:case"end":return e.stop()}}),e,null,[[0,6]])}))),h};t.default=d}).call(this,n(1))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(7)),o=r(n(2)),a=r(n(17)),l=r(n(30)),c=r(n(585));const s=(0,o.default)("GlobalExceptionHandler"),d=(0,a.default)(),u=function(e,t){Error.call(this),this.code=e,this.message=t};(u.prototype=Object.create(Error.prototype)).constructor=u,(0,i.default)(u),u.getTitleByCode=function(e){return c.default[+e]},u.handleJsException=e=>{let t=e.error,n=e.errorMsg,r=e.code,i=e.target,o=e.analytics;if(!i)throw new Error("handleJsException requires target");const a=()=>void 0!==r?r:t&&t.code,c=()=>void 0!==n?n:t&&t.message,A=u.getTitleByCode(a());s.error(`OT.exception :: title: ${A} (${a()}) msg: ${c()}`);try{const e={partnerId:i.session?i.session.apiKey:i.apiKey,sessionId:i.session?i.session.sessionId:i.sessionId};o.logError(a(),"tb.exception",A,{details:c()},e);const n=new d.ExceptionEvent(l.default.EXCEPTION,c(),A,a(),i,i,t);if(t)n.stack=t.stack;else try{throw new Error}catch(e){n.stack=e.stack}u.dispatchEvent(n)}catch(e){s.error("OT.exception :: Failed to dispatch exception - "+e.toString())}};var A=u;t.default=A},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(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:a}catch(e){r=a}}();var c,s=[],d=!1,u=-1;function A(){d&&c&&(d=!1,c.length?s=c.concat(s):u=-1,s.length&&h())}function h(){if(!d){var e=l(A);d=!0;for(var t=s.length;t;){for(c=s,s=[];++u<t;)c&&c[u].run();u=-1,t=s.length}c=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!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 g(e,t){this.fun=e,this.array=t}function Q(){}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];s.push(new g(e,t)),1!==s.length||d||l(h)},g.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=Q,i.addListener=Q,i.once=Q,i.off=Q,i.removeListener=Q,i.removeAllListeners=Q,i.emit=Q,i.prependListener=Q,i.prependOnceListener=Q,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){function n(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)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(272));var o={publishers:new i.default("guid"),subscribers:new i.default("widgetId"),sessions:new i.default};t.default=o},function(e,t,n){"use strict";t.__esModule=!0,t.MEDIUM=t.LOW=t.CongestionLevels=t.CRITICAL=void 0;t.CRITICAL=2;t.MEDIUM=1;t.LOW=0;const r={CRITICAL:2,MEDIUM:1,LOW:0};t.CongestionLevels=r},function(e,t,n){var r=n(18),i=n(120);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default={ACTIVE:"active",INACTIVE:"inactive",UNKNOWN:"unknown",PER_SESSION:"perSession",PER_STREAM:"perStream",EXCEPTION:"exception",ISSUE_REPORTED:"issueReported",SESSION_CONNECTED:"sessionConnected",SESSION_RECONNECTING:"sessionReconnecting",SESSION_RECONNECTED:"sessionReconnected",SESSION_DISCONNECTED:"sessionDisconnected",STREAM_CREATED:"streamCreated",STREAM_DESTROYED:"streamDestroyed",CONNECTION_CREATED:"connectionCreated",CONNECTION_DESTROYED:"connectionDestroyed",SIGNAL:"signal",STREAM_PROPERTY_CHANGED:"streamPropertyChanged",MICROPHONE_LEVEL_CHANGED:"microphoneLevelChanged",RESIZE:"resize",SETTINGS_BUTTON_CLICK:"settingsButtonClick",DEVICE_INACTIVE:"deviceInactive",INVALID_DEVICE_NAME:"invalidDeviceName",ACCESS_ALLOWED:"accessAllowed",ACCESS_DENIED:"accessDenied",ACCESS_DIALOG_OPENED:"accessDialogOpened",ACCESS_DIALOG_CLOSED:"accessDialogClosed",AUDIO_INPUT_DEVICE_CHANGED:"audioInputDeviceChanged",ECHO_CANCELLATION_MODE_CHANGED:"echoCancellationModeChanged",MEDIA_STOPPED:"mediaStopped",PUBLISHER_DESTROYED:"destroyed",MUTE_FORCED:"muteForced",SUBSCRIBER_DESTROYED:"destroyed",SUBSCRIBER_CONNECTED:"connected",SUBSCRIBER_DISCONNECTED:"disconnected",SUBSCRIBER_CAPTION_RECEIVED:"captionReceived",DEVICES_DETECTED:"devicesDetected",DEVICES_SELECTED:"devicesSelected",CLOSE_BUTTON_CLICK:"closeButtonClick",MICLEVEL:"microphoneActivityLevel",MICGAINCHANGED:"microphoneGainChanged",ENV_LOADED:"envLoaded",ENV_UNLOADED:"envUnloaded",AUDIO_LEVEL_UPDATED:"audioLevelUpdated",VIDEO_ELEMENT_CREATED:"videoElementCreated"}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),a=r(n(26)),l=r(n(7)),c=r(n(273)),s=r(n(269)),d=r(n(152)),u=r(n(48)),A=r(n(586)),h=r(n(588)),g=r(n(591)),Q=r(n(592));const F=(0,u.default)();let p=function(){function e(e){let t=void 0===e?{}:e,n=t.staticConfig,r=void 0===n?F.onlyLocal():n,i=t.sessionInfo,o=void 0===i?new d.default:i,a=t.ajax,l=t.queue,c=t.getUserAgentClientHintData,s=void 0===c?g.default:c,u=t.userAgentData,A=void 0===u?"undefined"!=typeof navigator&&navigator.userAgentData:u;this.getTurnServerName=e=>{let t,n;if(!e||"object"!=typeof e)return t;return(Array.isArray(e)?e:[e]).forEach(e=>{const r=e.urls||e.url;(Array.isArray(r)?r:[r]).forEach(e=>{const r=e.indexOf(":")+1,i=e.lastIndexOf(":");e.includes("turns")?n=e.substring(r,i):t=e.substring(r,i)})}),n||t},this.ajax=a,this.queue=l,this.sessionInfo=o,this.getUserAgentClientHintData=s,this.userAgentData=A,this.staticConfig=r}var t=e.prototype;return t._getCachedUserAgentData=function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.cachedUserAgentData){e.next=4;break}return e.next=3,this.getUserAgentClientHintData(this.userAgentData);case 3:this.cachedUserAgentData=e.sent;case 4:return e.abrupt("return",this.cachedUserAgentData);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),e._getSourceUrl=function(){var e;return null==(e=(void 0!==typeof window?window:global).location)?void 0:e.href},t.commonQoSFields=function(){const t=this._analytics.proxyUrl,n=this.sessionInfo.messagingURL,r=e._getSourceUrl();return{clientVersion:this.staticConfig.clientVersion,buildHash:this.staticConfig.buildHash,source:(0,Q.default)(r),logVersion:"2",apiServer:this.staticConfig.apiUrl,clientSystemTime:(new Date).getTime(),sessionId:this.sessionInfo.sessionId,mediaServerName:this.sessionInfo.mediaServerName,relayServer:this.getTurnServerName(this.sessionInfo.iceServers),p2p:this.sessionInfo.p2pEnabled,messagingServer:this.sessionInfo.messagingServer,messagingUrl:(0,A.default)(t,n),version:this.staticConfig.version,partnerId:this.sessionInfo.partnerId}},t._getCommonDataFields=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.default.getAsync();case 2:return t=e.sent,e.next=5,this._getCachedUserAgentData();case 5:return n=e.sent,e.abrupt("return",Object.assign({guid:t},this.commonQoSFields(),n));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.logError=function(t,n,r,i,o){void 0===o&&(o={}),this._getCommonDataFields().then(a=>{const l=[t,n,r,i,Object.assign({},a,o)];e.emit("logError",...l),this._analytics.logError(...l)})},t.logEvent=function(t,n,r){void 0===t&&(t={}),this._getCommonDataFields().then(i=>{const o=Object.assign({},i,t);e.emit("logEvent",o),this._analytics.logEvent(o,!1,n,r)})},t.logQOS=function(t){void 0===t&&(t={}),this._getCommonDataFields().then(n=>{const r=Object.assign({duration:0},n,t);(0,h.default)(r),e.emit("logQOS",r),this._analytics.logQOS(r)})},(0,a.default)(e,[{key:"staticConfig",get:function(){return this._staticConfig},set:function(e){this._staticConfig=e,this._analytics=new s.default({loggingUrl:this.staticConfig.loggingUrl,ajax:this.ajax,queue:this.queue})}}]),e}();t.default=p,(0,l.default)(p),e.exports=p},function(e,t,n){"use strict";var r=!0,i=!0;function o(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}e.exports={extractVersion:o,wrapPeerConnectionEvent:function(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var o=function(e){var t=n(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);var r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(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})}},disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(i=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){i&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=o(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)n.browser="chrome",n.version=o(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=o(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=o(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return n}}},function(e,t,n){var r=n(43),i=n(382),o=n(383),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(196),i=n(122),o=n(29);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){"use strict";var r=n(46);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var r=n(59),i=n(217),o=n(133),a=n(218),l=n(219);(e.exports=function(e,t){var n,i,c,s,d;return arguments.length<2||"string"!=typeof e?(s=t,t=e,e=null):s=arguments[2],r(e)?(n=l.call(e,"c"),i=l.call(e,"e"),c=l.call(e,"w")):(n=c=!0,i=!1),d={value:t,configurable:n,enumerable:i,writable:c},s?o(a(s),d):d}).gs=function(e,t,n){var c,s,d,u;return"string"!=typeof e?(d=n,n=t,t=e,e=null):d=arguments[3],r(t)?i(t)?r(n)?i(n)||(d=n,n=void 0):n=void 0:(d=t,t=n=void 0):t=void 0,r(e)?(c=l.call(e,"c"),s=l.call(e,"e")):(c=!0,s=!1),u={get:t,set:n,configurable:c,enumerable:s},d?o(a(d),u):u}},function(e,t,n){var r=n(538),i=n(546),o=n(92),a=n(15),l=n(551);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):l(e)}},function(e,t){e.exports=function(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(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={SDK:"sdk",SDK_RAW:"sdk_raw",WATCH_AUDIO_ACQUISITION:"watch_audio_acquisition",TEST_ONLY_GET_FRAMES_ENCODED:"test_only_get_frames_encoded",CONGESTION_LEVEL:"congestion_level",NETWORK_QUALITY:"network_quality",SENDER_SIDE_STATS:"sender_side_stats",MOS_SCORE:"mos_score",QOS:"qos",SUBSCRIBER_AUDIO_WATCHER:"subscriber_audio_watcher",SUBSCRIBER_VIDEO_WATCHER:"subscriber_video_watcher",PUBLISHER_VIDEO_WATCHER:"publisher_video_watcher"};t.default=r},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e,t){let n;const r=t||{};e.setDisplayMode=function(e){const t=e||"auto";n!==t&&(i.default.removeClass(this.domElement,"OT_mode-"+n),i.default.addClass(this.domElement,"OT_mode-"+t),n=t)},e.getDisplayMode=function(){return n},e.showAfterLoading=function(){i.default.removeClass(this.domElement,"OT_hide-forced")},e.hideWhileLoading=function(){i.default.addClass(this.domElement,"OT_hide-forced")},e.destroy=function(){return r.onDestroy&&r.onDestroy(this.domElement),this.domElement&&i.default.removeElement(this.domElement),e},e.appendTo=function(t){return this.domElement=i.default.createElement(r.nodeName||"div",r.htmlAttributes,r.htmlContent),r.onCreate&&r.onCreate(this.domElement),e.setDisplayMode(r.mode),"auto"===r.mode&&(i.default.addClass(e.domElement,"OT_mode-on-hold"),setTimeout(()=>{i.default.removeClass(e.domElement,"OT_mode-on-hold")},2e3)),t.appendChild(this.domElement),e}};var i=r(n(8))},function(e,t,n){var r=n(81);e.exports=function(e){return r(e,4)}},function(e,t,n){var r=n(381),i=n(386);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(16).Symbol;e.exports=r},function(e,t,n){var r=n(87),i=n(65);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var l=-1,c=t.length;++l<c;){var s=t[l],d=o?o(n[s],e[s],s,n,e):void 0;void 0===d&&(d=e[s]),a?i(n,s,d):r(n,s,d)}return n}},function(e,t,n){var r=n(410),i=n(117),o=n(411),a=n(204),l=n(205),c=n(33),s=n(193),d=s(r),u=s(i),A=s(o),h=s(a),g=s(l),Q=c;(r&&"[object DataView]"!=Q(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=Q(new i)||o&&"[object Promise]"!=Q(o.resolve())||a&&"[object Set]"!=Q(new a)||l&&"[object WeakMap]"!=Q(new l))&&(Q=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?s(n):"";if(r)switch(r){case d:return"[object DataView]";case u:return"[object Map]";case A:return"[object Promise]";case h:return"[object Set]";case g:return"[object WeakMap]"}return t}),e.exports=Q},function(e,t,n){"use strict";var r=n(431)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";e.exports=n(445)()?n(95).Symbol:n(448)},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(26)),o=r(n(224)),a=r(n(509)),l=r(n(560)),c=r(n(64)),s=r(n(2)),d=r(n(107));const u=(0,s.default)("StaticConfig"),A=(0,l.default)(["apiURL","assetURL","cdnURL","sessionInfoOverrides","loggingURL"]),h={apiUrl:"apiURL",loggingUrl:"loggingURL"},g=(0,a.default)(e=>h[e]);var Q=function(t){let n=void 0===t?{}:t,r=n.axios,a=void 0===r?o.default:r,l=n.properties,s=void 0===l?{version:"v2.33.0",buildHash:"efe610234",minimumVersion:{firefox:52,chrome:49},debug:!1,websiteURL:"http://www.tokbox.com",configURL:"https://config.opentok.com",ipWhitelistConfigURL:"",cdnURL:"",loggingURL:"https://hlg.tokbox.com/prod",apiURL:"https://anvil.opentok.com",vonageApiURL:""}:l;const h=(0,c.default)(s);return function(){function t(e){Object.defineProperty(this,"config",{value:Object.freeze((0,c.default)(e))})}return t.onlyLocal=function(e){void 0===e&&(e=!0),!e&&s.vonageApiURL&&(h.apiURL=s.vonageApiURL);const n=(0,c.default)((void 0!==typeof window?window:global).OTProperties);return new t(Object.assign({},h,A(n)))},t.get=function(n){let r=n.partnerId,i=n.token,o=n.useIpWhitelistConfigUrl,l=n.proxyUrl;return(()=>{const t=this.onlyLocal();if(!t.configUrl)return e.resolve({});if(!0===o&&!t.ipWhitelistConfigUrl)return e.resolve({});let n=!0===o?t.ipWhitelistConfigUrl:t.configUrl;return n=(0,d.default)(n,l),a.get(`${n}/project/${r}/config.json`,{headers:{"X-TB-TOKEN-AUTH":i}}).then(e=>e.data)})().then(e=>{const n=(0,c.default)((void 0!==typeof window?window:global).OTProperties);return new t(Object.assign({},h,A(n),g(e)))}).catch(t=>(u.error("could not reach Config Service",t),e.reject(new Error("could not reach Config Service"))))},(0,i.default)(t,[{key:"configUrl",get:function(){return this.config.configURL}},{key:"ipWhitelistConfigUrl",get:function(){return this.config.ipWhitelistConfigURL}},{key:"apiUrl",get:function(){return this.config.apiURL}},{key:"loggingUrl",get:function(){return this.config.loggingURL}},{key:"apiEnabled",get:function(){return void 0===this.config.apiEnabled||this.config.apiEnabled}},{key:"version",get:function(){return this.config.version}},{key:"clientVersion",get:function(){return"js-"+(this.version||"unknown").replace("v","")}},{key:"buildHash",get:function(){return this.config.buildHash}},{key:"minimumVersion",get:function(){return this.config.minimumVersion}},{key:"websiteUrl",get:function(){return this.config.websiteURL}},{key:"debug",get:function(){return"true"===this.config.debug||!0===this.config.debug}},{key:"sessionInfoOverrides",get:function(){return this.config.sessionInfoOverrides}},{key:"cdnUrl",get:function(){return this.config.cdnURL||`${(void 0!==typeof window?window:global).location.protocol}//${(void 0!==typeof window?window:global).location.host}`}},{key:"assetUrl",get:function(){return this.config.assetURL||`${this.cdnUrl}/webrtc/${this.version}`}}]),t}()};t.default=Q}).call(this,n(1))},function(e,t,n){"use strict";var r=n(13);function i(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){a[e]={value:e}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,n,a,l,c){var s=Object.create(o);return r.toFlatObject(e,s,(function(e){return e!==Error.prototype})),i.call(s,e.message,t,n,a,l),s.cause=e,s.name=e.name,c&&Object.assign(s,c),s},e.exports=i},function(e,t,n){var r=n(72);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(561),i=n(144)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){if(r.now)return r.timing.navigationStart+r.now();return Date.now()};const r=(void 0!==typeof window?window:global).performance||{}},function(e,t,n){var r=n(628);e.exports=function(e){return r(2,e)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(53)),o=r(n(636)),a=r(n(3)),l=r(n(637));const c=function(e){void 0===e&&(e={});const t=e.env||a.default,n=e.hasGetUserMediaCapability||o.default,r=e.hasPeerConnectionCapability||l.default;return"Node"===t.name||n()&&r()},s=(0,i.default)(()=>c());var d={check:c,once:s};t.default=d},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(196),i=n(405),o=n(29);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(118);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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 a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){const t=[];return{on(n,r){for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];if(t.push({eventName:n,handler:r,args:o}),e.on)e.on(n,r);else{if(!e.addEventListener)throw new Error("Object does not support events",e);e.addEventListener(n,r,...o)}},off(t,n){if(e.off)e.off(t,n);else{if(!e.removeEventListener)throw new Error("Object does not support events",e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];e.removeEventListener(t,n,...i)}},once(n,r){for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];t.push({eventName:n,handler:r,args:o}),e.once(n,r)},removeAll(){t.forEach(e=>{let t=e.eventName,n=e.handler,r=e.args;this.off(t,n,...r)}),t.splice(0,t.length)}}}},function(e,t,n){var r=n(105);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){var r=n(15),i=n(143),o=n(257),a=n(63);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(548);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(81);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(194);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(400),i=n(19),o=Object.prototype,a=o.hasOwnProperty,l=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!l.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){var r=n(16),i=n(401),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,l=a&&a.exports===o?r.Buffer:void 0,c=(l?l.isBuffer:void 0)||i;e.exports=c}).call(this,n(88)(e))},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){var r=n(33),i=n(19);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.getProxyUrl=t.errorMessages=t.clearProxyUrl=void 0,t.setProxyUrl=function(e){const t=n(31),r=s.default,A=new t,h=a.default.sessions.length()>0,g=a.default.publishers.length()>0;let Q;if(h){const e=a.default.sessions.find(e=>"connected"===e.currentState);Q=e?e.sessionId:a.default.sessions.find().sessionId}else Q="";const F={sessionId:Q,apiKey:r.value};if(g||h){const e=(0,l.default)()(c.default.SET_PROXY_URL_TIMING_ERROR,new Error(u.SET_PROXY_URL_TIMING_ERROR),i.default.SET_PROXY_URL_TIMING_ERROR);o.default.handleJsException({error:e,target:F,analytics:A})}else if(d){const e=(0,l.default)()(c.default.PROXY_URL_ALREADY_SET_ERROR,new Error(u.PROXY_URL_ALREADY_SET_ERROR),i.default.PROXY_URL_ALREADY_SET_ERROR);o.default.handleJsException({error:e,target:F,analytics:A})}else d=e};var i=r(n(9)),o=r(n(23)),a=r(n(27)),l=r(n(14)),c=r(n(6)),s=r(n(74));let d;const u={SET_PROXY_URL_TIMING_ERROR:"The proxyUrl was set after a session or publisher was created.",PROXY_URL_ALREADY_SET_ERROR:"The proxyUrl has already been set. Setting it again will not have any effect."};t.errorMessages=u;t.getProxyUrl=()=>d;t.clearProxyUrl=()=>{d=null}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i,o=r(n(8));let a;if("Node"===(null==o.default||null==(i=o.default.env)?void 0:i.name))a="";else{var l,c;const e=null==(l=Array.prototype.slice.call(document.getElementsByTagName("script")))||null==(c=l.pop())?void 0:c.getAttribute("src");a=(e&&e.match(/[?&]apikey=([^&]+)/i)||[])[1]||""}var s={value:a};t.default=s},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t,n){void 0===n&&(n=1/0);let r=null,i=!1,o=1;const a=1e3/t,l=()=>{!i||o>n||(o+=1,e(),r=setTimeout(l,a))};this.start=()=>{i||(i=!0,setTimeout(l,a))},this.stop=()=>{(void 0!==typeof window?window:global).clearTimeout(r),i=!1}}},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});const n=t.hasValidPeerConnection||f.default,r=t.applySdpTransform||R.default,x=t.createPeerConnection||I.default,M=t.env||Q.default,H=t.sdpTransformDefaults||y.default,K=t.getSynchronizationSources||V.default,L=t.IceCandidateProcessor||C.default,z=t.logging||g.default,O=t.offerProcessor||W.default,j=t.PeerConnectionChannels||E.default,P=t.subscribeProcessor||S.default,_=v.default,q=t.changeMediaDirection||J.default,$=q.changeMediaDirectionToInactive,ee=q.changeMediaDirectionToRecvOnly,te=t.StatsCache||N.default,ne=t.Qos||G.default,re=t.global||(void 0!==typeof window?window:global),ie=t.debounce||d.default,oe=t.needsToSwapH264Profiles||X.default.once,ae=(0,Z.default)(),le=t.NativeRTCIceCandidate||re.RTCIceCandidate,ce=t.NativeRTCSessionDescription||re.RTCSessionDescription,se=t.Errors||k.default,de=t.OTErrorClass||p.default,ue=t.ExceptionCodes||F.default,Ae=t.hasPictureInPictureBug||T.default,he=t.createRtcStatsReportParser||D.default,ge=()=>{};return function(t){void 0===t&&(t={});let d=!1;const g=t,Q=g.iceConfig,F=void 0===Q?{servers:[]}:Q,p=g.isPublisher,Z=g.offerOverrides,f=g.answerOverrides,R=g.p2p,I=g.codecFlags,y=g.sourceStreamId,V=g.keyStore,C=g.sFrameClientStore,W=g.isE2ee,E=g.sessionId,S=g.preferredVideoCodecs;let v,J=t,N=J.logAnalyticsEvent,G=void 0===N?ge:N,X=J.sendMessage,k=!1;const T=oe();let D,q,Qe=0,Fe=!1,pe={};const Ue=he(),me=new _(G),be=(0,m.default)();function Be(e,t){if(!d){if(["candidate","offer","answer","pranswer"].indexOf(e)>-1){const n="candidate"===e?t.candidate:t.sdp;d=-1!==n.indexOf("typ relay")}}X(e,t)}const Ze=(0,Y.default)();G("createPeerConnection","Attempt");const fe={};fe.id=(0,A.default)();const Re=z("PeerConnection:"+fe.id);Re.debug("construct",{id:fe.id,options:t});const Ie=H,ye=(0,u.default)(t,["isPublisher","logAnalyticsEvent","offerOverrides","answerOverrides","sendMessage"]);let Ve,Ce,We,Ee,Se,ve=[];const Je=()=>{var e;if(M.isLegacyElectron||M.isLegacyFirefox||M.isAndroidWebView&&M.version<139)return;if(null==(e=Ve)||!e.getTransceivers)return;const t=(null!=S&&S.length?S:[]).concat("vp8"),n=null==window.RTCRtpSender.getCapabilities?void 0:window.RTCRtpSender.getCapabilities("video");if(!n||!Array.isArray(n.codecs))return;const r=e=>String(e).split("/").pop().toUpperCase(),i=t.map(r),o=new Array(i.length),a=[];n.codecs.forEach(e=>{const t=i.indexOf((e=>r(e.mimeType||e.name||""))(e));t>-1?(o[t]||(o[t]=[])).push(e):a.push(e)});const l=o.filter(Boolean).flat().concat(a);Ve.getTransceivers().filter(e=>{var t,n;return"video"===(null==e||null==(t=e.sender)||null==(n=t.track)?void 0:n.kind)&&"function"==typeof e.setCodecPreferences}).forEach(e=>{try{e.setCodecPreferences(l)}catch(t){const n=l.filter(e=>/^video\//i.test(e.mimeType||"")&&!/\/(rtx|red|ulpfec)$/i.test(e.mimeType||""));n.length&&e.setCodecPreferences(n)}})},Ne=(()=>{let e=ye.overrideSimulcastEnabled||!1;return{get:()=>e,set(t){const n=Boolean(t)&&ye.capableSimulcastStreams>1;n!==e&&void 0===ye.overrideSimulcastEnabled&&(e=n,fe.generateOfferAndSend())}}})();let Ge;const Xe=()=>{Ge&&(clearTimeout(Ge),Ge=null)},ke=(()=>{let e=!1;return{get:()=>e,set(t){const n=Boolean(t);n!==e&&(e=n,e?(Xe(),fe.iceConnectionStateIsConnected()?(Re.debug("iceRestart is going to wait until we disconnect or negotiationNeeded and then restart ice"),Ge=setTimeout(()=>{ke.set(!1)},1e4)):_e()):(Xe(),_e.cancel()))},run:()=>(e&&(Xe(),_e()),e)}})(),Te={clean(){delete this.promise,delete this.resolve,delete this.reject}};Te.promise=new e((e,t)=>{Te.resolve=e,Te.reject=t});let Ye=new L,we="new";Object.defineProperty(fe,"signalingState",{get:()=>Ve.signalingState,set:e=>(Ve.signalingState=e,e)}),(0,h.default)(fe),fe.addOptions=e=>{G=e.logAnalyticsEvent},fe.startEncryption=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ae({sessionId:E,connectionId:t});case 4:return n=e.sent,e.next=7,C.createSender(n);case 7:return D=e.sent,e.next=10,V.get();case 10:return r=e.sent,e.next=13,D.setSenderEncryptionKey(r);case 13:q=e=>{D.setSenderEncryptionKey(e)},V.on("keyChanged",q),Ve.getTransceivers().forEach(function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D.encrypt(n,t.sender);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fe.once("iceConnected",(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"",t={pcc:parseInt((0,Y.default)()-Ze,10),hasRelayCandidates:d,proxyInfo:""},Ve&&Ve.proxyInfo&&(t.proxyInfo=Ve.proxyInfo),G("createPeerConnection","Success",t);case 4:case"end":return e.stop()}}),e)})))),fe.startDecryption=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(fe.iceConnectionStateIsConnected()){e.next=3;break}return fe.once("iceConnected",()=>fe.startDecryption(t,n)),e.abrupt("return");case 3:return e.next=5,ae({sessionId:E,connectionId:t});case 5:return r=e.sent,o=n.receiver,e.next=9,De(r);case 9:return a=e.sent,e.prev=10,e.next=13,null==a?void 0:a.decrypt(r,o);case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(10),Re.error(e.t0);case 18:case"end":return e.stop()}}),e,null,[[10,15]])})));return function(t,n){return e.apply(this,arguments)}}(),Te.resolve();const De=function(){var t=(0,o.default)(i.default.mark((function t(n){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!pe[n]){t.next=2;break}return t.abrupt("return",pe[n]);case 2:return pe[n]=new e(function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V.get();case 2:if(r=e.sent,o=C.getReceiver(n)){e.next=9;break}return e.next=7,C.createReceiver(n);case 7:(o=e.sent).addReceiver(n);case 9:o.setReceiverEncryptionKey(n,r),V.on("keyChanged",e=>{o.setReceiverEncryptionKey(n,e)}),o.addEventListener("decryptFailed",()=>{fe.trigger("decryptFailed")}),o.addEventListener("decryptionRestored",()=>{fe.trigger("decryptRestored")}),t(o);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.abrupt("return",pe[n]);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),xe=e=>{if(Re.debug("internalCreatePeerConnection: called"),Ve)return Re.debug("internalCreatePeerConnection: resolving synchronously"),void e.call(null,null,Ve);if(ve.push(e),!(ve.length>1)){if(Re.debug(`Creating peer connection config "${JSON.stringify(ye)}".`),0===F.servers.length&&(Re.error("No ice servers present"),G("Error","noIceServers")),"relay"===F.transportPolicy){const e=e=>e&&0===e.indexOf("turn");F.servers=F.servers.map(t=>{const n=(0,c.default)(t);return Array.isArray(n.urls)||(n.urls=[n.urls]),n.urls=n.urls.filter(e),0===n.urls.length?void 0:n}).filter(e=>void 0!==e)}ye.iceTransportPolicy=F.transportPolicy,ye.iceServers=F.servers,W&&(ye.forceEncodedVideoInsertableStreams=!0,ye.forceEncodedAudioInsertableStreams=!0,ye.encodedInsertableStreams=!0),n(re.RTCPeerConnection).then(e=>{if(!e)throw Re.error("createPeerConnection: Invalid RTCPeerConnection object"),new Error("Failed to create valid RTCPeerConnection object");return x({window:re,config:ye})}).then(function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Me(null,t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e=>Me(e))}},Me=(e,t)=>{if(e)return qe({reason:"Failed to create PeerConnection, exception: "+e,prefix:"NewPeerConnection"}),void(ve=[]);Re.debug("OT attachEventsToPeerConnection"),Ve=t,nt.setPeerConnection(t),Ye&&Ye.setPeerConnection(t),Ce=new j(Ve),ye.channels&&Ce.addMany(ye.channels);const n=(e=>{let t=e.sendMessage,n=e.logging;const r={};return e=>{e.candidate?(r[e.candidate.sdpMid]=e.candidate.sdpMLineIndex,t("candidate",{candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid||"",sdpMLineIndex:e.candidate.sdpMLineIndex||0})):n.debug("IceCandidateForwarder: No more ICE candidates.")}})({sendMessage:Be,logging:Re}),r=e=>{var t;(Te.resolve(),t=e.candidate,"relay"!==F.transportPolicy||null==t||-1!==t.candidate.indexOf("typ relay"))?n(e):Re.debug("Ignore candidate",e.candidate.candidate)},a=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Oe(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();let l=Ve.iceConnectionState;const c=e=>{Ve?(Re.debug("iceconnectionstatechange",Ve.iceConnectionState),"connected"===Ve.iceConnectionState?("disconnected"===l&&fe.clearFailedTimeout(),fe.emit("iceConnected"),ke.set(!1)):"completed"===Ve.iceConnectionState&&M.isLegacyEdge&&setTimeout(()=>rt.startCollecting(),1e3)):Re.debug("iceconnectionstatechange on peerConnection that no longer exists",fe);const t=e.target.iceConnectionState;fe.trigger("iceConnectionStateChange",t),G("attachEventsToPeerConnection","iceconnectionstatechange",t),"disconnected"===t&&(ke.run()?Re.debug("Restarting ice!"):(0,B.default)()||(Se=setTimeout(()=>{G("attachEventsToPeerConnection","iceconnectionstatechange","failed"),l="failed",fe.trigger("iceConnectionStateChange","failed")},1e4))),"disconnected"!==l&&"failed"===t&&qe({reason:"The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",prefix:"ICEWorkflow"}),l=t},s=()=>{G("peerConnection:negotiationNeeded","Event"),p&&fe.generateOfferAndSend(),fe.trigger("negotiationNeeded")};Ve.addEventListener("track",a),Ve.addEventListener("icecandidate",r),Ve.addEventListener("signalingstatechange",Le),Ve.addEventListener("negotiationneeded",s),Ve.addEventListener("iceconnectionstatechange",c),be.add(()=>{Ve&&(Ve.removeEventListener("track",a),Ve.removeEventListener("icecandidate",r),Ve.removeEventListener("signalingstatechange",Le),Ve.removeEventListener("negotiationneeded",s),Ve.removeEventListener("iceconnectionstatechange",c))}),He(null)},He=()=>{for(;ve.length;)ve.shift().call(null)},Ke=()=>{Ye&&(Ye.destroy(),Ye=null),ve=[],rt.stopCollecting(),be.releaseAll(),Te.clean(),nt.destroy(),null!==Ve&&(Ve.destroy&&Ve.destroy(),Ve=null,fe.trigger("close")),fe.off()},Le=e=>{const t=e.target.signalingState;if(fe.emit("signalingStateChange",t),"stable"===t&&fe.emit("signalingStateStable"),t&&t!==we)switch(we=t,Re.debug("stateChange: "+we),we){case"closed":Ke()}},ze=()=>{let e;if(Ve.getRemoteStreams)e=Ve.getRemoteStreams();else{if(!Ve.remoteStreams)throw new Error("Invalid Peer Connection object implements no method for retrieving remote streams");e=Ve.remoteStreams}return Array.prototype.slice.call(e)},Oe=e=>{var t;const n=e.track,r=e.transceiver,i=e.stream||(null==(t=e.streams)?void 0:t[0]);G("createPeerConnection","TrackAdded"),fe.trigger("trackAdded",{stream:i,track:n,transceiver:r})},je=(e,t,n)=>{k=!1,qe({reason:`PeerConnection.offerProcessor ${e}: ${t}`,prefix:n})},Pe=e=>{if(k)return void(v=e);k=!0,G("peerConnection:processOffer","Event");const t=new ce({type:"offer",sdp:e.content.sdp}),n=e=>{k=!1,Ye&&Ye.process(),Be("answer",e),M.isLegacyEdge||rt.startCollecting(),v&&(Pe(v),v=null)},r=e=>fe.trigger("remoteVideoSupported",e);xe(()=>{O(Ve,re.RTCPeerConnection,re.RTCSessionDescription,ce,Ie,t,I,R,n,je,r,T,y)})};fe.setSendMessage=e=>{X=e},fe.generateOfferAndSend=()=>{fe.generateOffer(e=>{Re.debug("processSubscribe: sending offer"),Be("offer",e)})};const _e=ie(fe.generateOfferAndSend,2e3);fe.generateOffer=ie((function(e){void 0===e&&(e=()=>{}),me.enqueueOfferAnswer(()=>(e=>{var t,n;if("closed"===(null==(t=Ve)||null==(n=t.signalingState)?void 0:n.toLowerCase()))return;G("peerConnection:processSubscribe","Event"),Re.debug("processSubscribe: Sending offer to subscriber.");let r=Ne.get()?ye.capableSimulcastStreams:1;"P2P"===y&&!R&&(r=1),xe(()=>{P({peerConnection:Ve,NativeRTCSessionDescription:ce,sdpTransforms:Ie,numSimulcastStreams:r,removeVideoOrientation:Ae(),offerOverrides:Z,offerConstraints:{iceRestart:ke.get()},replaceBaselineProfile:T}).then(t=>{Re.debug("processSubscribe: got offer, waiting for _readyToCompleteOffer"),We=t,Te.promise.then(()=>e(We))},e=>{qe({reason:`subscribeProcessor ${e.message}: ${e.reason}`,prefix:e.prefix})}),ke.set(!1)})})(e))}),100);const qe=e=>{let t=e.reason,n=e.prefix;Re.error(t,"in state",Ve?{connectionState:Ve.connectionState,iceConnectionState:Ve.iceConnectionState,iceGatheringState:Ve.iceGatheringState,signalingState:Ve.signalingState}:"(none)"),fe.trigger("error",{reason:t,prefix:n})};function $e(e){this.track=e}fe.addTrack=(t,n)=>{const r=new e((e,t)=>{xe(n=>{if(n)return t(n);e()})}).then(()=>{if(Ve.addTrack)return Ve.addTrack(t,n);const e=Ve.getLocalStreams()[0];if(void 0===e)throw new Error("PeerConnection has no existing streams, cannot addTrack");e.addTrack(t),fe.generateOfferAndSend()}).then(()=>new e(e=>{fe.once("signalingStateStable",()=>{e()})}));return(0,a.default)(r,15e3,"Renegotiation timed out")},fe.setIceConfig=e=>{try{M.isFirefox&&(e.certificates=Ve.getConfiguration().certificates),Ve.setConfiguration(e)}catch(e){throw new U.default("A peer connection failed to set configuration with "+e.message,se.FAILED_SET_CONFIGURATION)}return ke.set(!0),Ve},fe.removeTrack=t=>{const n=e.resolve().then(()=>t instanceof $e?(Ve.getLocalStreams()[0].removeTrack(t.track),void fe.generateOfferAndSend()):Ve.removeTrack(t)).then(()=>new e(e=>{fe.once("signalingStateStable",()=>{e()})}));return(0,a.default)(n,15e3,"Renegotiation timed out")},fe.addLocalStream=t=>new e((e,n)=>{xe(r=>{if(r)n(r);else{try{t.getTracks&&t.getTracks().forEach(e=>Ve.addTrack(e,t))}catch(e){return void n(e)}try{Je()}catch(e){Re.error(e)}e()}})}),fe.getLocalStreams=()=>Ve.getLocalStreams(),fe.getSenders=()=>Ve.getSenders?Ve.getSenders():Ve.getLocalStreams()[0].getTracks().map(e=>new $e(e)),fe.disconnect=()=>{var e;Ye&&(Ye.destroy(),Ye=null),null!=(e=Ve)&&e.signalingState&&"closed"!==Ve.signalingState.toLowerCase()&&(Ve.close(),"function"==typeof q&&V.off("keyChanged",q),D=null,pe=null,setTimeout(Ke))},fe.iceRestart=()=>ke.set(!0),fe.clearFailedTimeout=()=>clearTimeout(Se);const et=t=>{const n=t?$:ee;return new e(e=>{me.enqueueOfferAnswer((0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n(Ve);case 2:me.setResolved(),e();case 4:case"end":return t.stop()}}),t)}))))})};fe.changeMediaDirectionToRecvOnly=()=>et(!1),fe.changeMediaDirectionToInactive=()=>et(!0),fe.processMessage=(e,t)=>{switch(Re.debug(`processMessage: Received ${e} from ${t.fromAddress}`,t),Re.debug(t),e){case"generateoffer":t.content&&void 0!==t.content.simulcastEnabled&&Ne.set(t.content.simulcastEnabled),fe.generateOfferAndSend(),i();break;case"offer":Pe(t),i();break;case"answer":case"pranswer":(e=>{G("peerConnection:processAnswer","Event");const t=e=>{"function"==typeof e.includes&&e.includes("Failed to parse SessionDescription. a=extmap-allow-mixed Expects at least 2 fields.")&&(e="SessionDescription issue has been fixed in Chrome 71 and above. Please update your browser."),qe({reason:"Error while setting RemoteDescription "+e,prefix:"SetRemoteDescription"})};e.content.sdp?(Ee=new ce({type:"answer",sdp:r(Ie,"remote","answer",(0,l.default)({replaceBaselineProfile:T},f),e.content.sdp).local}),Ve.setRemoteDescription(Ee).then(()=>{Re.debug("processAnswer: setRemoteDescription Success"),Ye&&Ye.process()}).catch(t),me.setResolved(),M.isLegacyEdge||rt.startCollecting()):t("Weird answer message, no SDP.")})(t);break;case"candidate":var n=new le(t.content);Ye&&Ye.addIceCandidate(n).catch(e=>{Re.warn(`Error while adding ICE candidate: ${JSON.stringify(n)}: ${e.toString()}`)});break;default:Re.debug(`processMessage: Received an unexpected message of type ${e} from ${t.fromAddress}: ${JSON.stringify(t)}`)}function i(){Qe+=1,rt.handleOfferMessageReceived(),Qe>1&&(G("Renegotiation","Attempt"),Fe=!0)}return fe};const tt=e=>Ve.getTransceivers().filter(t=>e.includes(t.mid));fe.getTransceivers=()=>Ve.getTransceivers(),fe.stopTransceivers=e=>{const t=tt(e);var n;(n=t,n.sort((e,t)=>e.mid<t.mid?1:e.mid>t.mid?-1:0)).forEach(e=>e.stop())},fe.setTransceiversToInactive=e=>{tt(e).forEach(e=>{e.direction=w.default.INACTIVE})},fe.remoteStreams=()=>Ve?ze():[],fe.remoteTracks=()=>Ve?Ve.getReceivers?Array.prototype.slice.apply(Ve.getReceivers()).map(e=>e.track):Array.prototype.concat.apply([],ze().map(e=>e.getTracks())):[],fe.remoteDescription=()=>Ve.remoteDescription,fe.getStats=(e,t,n)=>{if(Ve)nt.getRtcStatsReport(e,t).then(e=>n(null,Ue(e))).catch(n);else{const e=ue.PEER_CONNECTION_NOT_CONNECTED;n(new U.default(de.getTitleByCode(e),se.PEER_CONNECTION_NOT_CONNECTED,{code:e}))}},fe.getRtcStatsReport=(e,t,n)=>{if(Ve)nt.getRtcStatsReport(e,t).then(e=>n(null,e)).catch(n);else{const e=ue.PEER_CONNECTION_NOT_CONNECTED;n(new U.default(de.getTitleByCode(e),se.PEER_CONNECTION_NOT_CONNECTED,{code:e}))}},fe.getSynchronizationSources=e=>{if(!p){if(!Ve){const t=ue.PEER_CONNECTION_NOT_CONNECTED;return void e(new U.default(de.getTitleByCode(t),se.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}K(Ve,e)}};fe.getDataChannel=(e,t,n)=>{Ve?function e(t,n,r,i){let o;const a=Ce.get(n,r);if(!a){if(t>0)return void setTimeout(e.bind(null,t-1,n,r,i),200);o=new U.default(`A channel with that label and options could not be found. Label:${n}. Options: ${JSON.stringify(r)}`)}i(o,a)}(100,e,t,n):n(new U.default("Cannot create a DataChannel before there is a connection."))},fe.getSourceStreamId=()=>y,fe.iceConnectionStateIsConnected=()=>Ve&&["connected","completed"].indexOf(Ve.iceConnectionState)>-1,fe.hasTrack=e=>Ve.getSenders().some(t=>t.track===e),fe.findAndReplaceTrack=(t,n)=>e.resolve().then(()=>{const r=Ve.getSenders().filter(e=>e.track===t)[0];if(!r)return e.resolve();if("function"!=typeof r.replaceTrack)throw new Error("Sender does not support replaceTrack");return r.replaceTrack(n)}),fe.hasRelayCandidates=()=>d,fe.getNegotiatedCodecs=()=>{if(!Ve.localDescription||!Ve.remoteDescription)return null;const e=e=>(0,s.default)(b.default.getCodecs(Ve.localDescription.sdp,e),b.default.getCodecs(Ve.remoteDescription.sdp,e));return{audio:e("audio"),video:e("video")}},fe.on("signalingStateStable",()=>{Fe&&(Fe=!1,G("Renegotiation","Success",fe.getNegotiatedCodecs()))}),fe.on("error",e=>{let t=e.prefix;Fe&&-1!==["CreateOffer","SetRemoteDescription"].indexOf(t)&&(Fe=!1,G("Renegotiation","Failure"))}),fe.on("close",()=>{Fe&&(Fe=!1,G("Renegotiation","Cancel"))});const nt=new te,rt=new ne(nt,p);return rt.on("stats",e=>{e.dataChannels=Ce.sampleQos(),fe.trigger("qos",{parsedStats:e,simulcastEnabled:Ne.get()})}),fe}};var i=r(n(4)),o=r(n(5)),a=r(n(165)),l=r(n(10)),c=r(n(64)),s=r(n(149)),d=r(n(167)),u=r(n(297)),A=r(n(20)),h=r(n(7)),g=r(n(2)),Q=r(n(3)),F=r(n(9)),p=r(n(23)),U=r(n(153)),m=r(n(168)),b=r(n(21)),B=r(n(78)),Z=r(n(655)),f=r(n(657)),R=r(n(169)),I=r(n(658)),y=r(n(660)),V=r(n(661)),C=r(n(662)),W=r(n(664)),E=r(n(666)),S=r(n(668)),v=r(n(672)),J=r(n(674)),N=r(n(675)),G=r(n(303)),X=r(n(679)),k=r(n(6)),T=r(n(680)),Y=r(n(52)),w=r(n(300)),D=r(n(306))}).call(this,n(1))},function(e,t,n){var r=n(652)(n(298));e.exports=r},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(3));t.default=()=>!((i.default.isChrome||i.default.isElectron)&&i.default.version>=90||i.default.isSamsung&&i.default.version>=20||i.default.isOpera&&i.default.version>=76||i.default.isIosWebView||i.default.isAndroidWebView)&&(i.default.isChrome&&i.default.version>71||i.default.isSamsung&&i.default.version>=13||i.default.isChromiumEdge&&i.default.version<90||i.default.isOpera&&i.default.version>58)},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={ACTIVE_VIDEO:0,ACTIVE_VIDEO_WITH_WARNING:1,SUSPENDED_VIDEO:2};t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.messages=t.default=t.codes=void 0;const r={1e3:"The connection successfully completed the purpose for which it was created.",1001:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.",1002:"The endpoint is terminating the connection due to a protocol error. (CLOSE_PROTOCOL_ERROR)",1003:"The connection is being terminated because the endpoint has indicated that reconnections are not available. (CLOSE_UNSUPPORTED)",1005:"Indicates that no status code was provided even though one was expected. (CLOSE_NO_STATUS)",1006:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected. (CLOSE_ABNORMAL)",1007:"Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message)",1008:"Indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy",1009:"Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process (CLOSE_TOO_LARGE)",1011:"Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request",4001:"Connectivity loss was detected as it was too long since the socket received the last PONG message",4010:"Timed out while waiting for the Rumor socket to connect.",4020:"Error code unavailable.",4030:"Exception was thrown during Rumor connection, possibly because of a blocked port."};t.messages=r;const i={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,CLOSE_INCONSISTENT_DATA:1007,CLOSE_POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,CLOSE_UNEXPECTED_CONDITION:1011,CLOSE_CONNECTIVITY_LOSS:4001,CLOSE_TIMEOUT:4010,CLOSE_FALLBACK_CODE:4020,CLOSE_CONNECT_EXCEPTION:4030,ALREADY_CONNECTED_CONNECTING:null};t.codes=i;var o={messages:r,codes:i};t.default=o},function(e,t,n){var r=n(82),i=n(119),o=n(87),a=n(195),l=n(404),c=n(198),s=n(57),d=n(407),u=n(409),A=n(201),h=n(203),g=n(45),Q=n(412),F=n(413),p=n(208),U=n(15),m=n(67),b=n(417),B=n(12),Z=n(419),f=n(34),R=n(56),I={};I["[object Arguments]"]=I["[object Array]"]=I["[object ArrayBuffer]"]=I["[object DataView]"]=I["[object Boolean]"]=I["[object Date]"]=I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Map]"]=I["[object Number]"]=I["[object Object]"]=I["[object RegExp]"]=I["[object Set]"]=I["[object String]"]=I["[object Symbol]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I["[object Error]"]=I["[object Function]"]=I["[object WeakMap]"]=!1,e.exports=function e(t,n,y,V,C,W){var E,S=1&n,v=2&n,J=4&n;if(y&&(E=C?y(t,V,C,W):y(t)),void 0!==E)return E;if(!B(t))return t;var N=U(t);if(N){if(E=Q(t),!S)return s(t,E)}else{var G=g(t),X="[object Function]"==G||"[object GeneratorFunction]"==G;if(m(t))return c(t,S);if("[object Object]"==G||"[object Arguments]"==G||X&&!C){if(E=v||X?{}:p(t),!S)return v?u(t,l(E,t)):d(t,a(E,t))}else{if(!I[G])return C?t:{};E=F(t,G,S)}}W||(W=new r);var k=W.get(t);if(k)return k;W.set(t,E),Z(t)?t.forEach((function(r){E.add(e(r,n,y,r,t,W))})):b(t)&&t.forEach((function(r,i){E.set(i,e(r,n,y,i,t,W))}));var T=N?void 0:(J?v?h:A:v?R:f)(t);return i(T||t,(function(r,i){T&&(r=t[i=r]),o(E,i,e(r,n,y,i,t,W))})),E}},function(e,t,n){var r=n(83),i=n(376),o=n(377),a=n(378),l=n(379),c=n(380);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=i,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=l,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(371),i=n(372),o=n(373),a=n(374),l=n(375);function c(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])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=l,e.exports=c},function(e,t,n){var r=n(55);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(42)(Object,"create");e.exports=r},function(e,t,n){var r=n(395);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(65),i=n(55),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},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){var r=n(402),i=n(69),o=n(121),a=o&&o.isTypedArray,l=a?i(a):r;e.exports=l},function(e,t,n){var r=n(12),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){var r=n(92),i=n(211),o=n(128);e.exports=function(e,t){return o(i(e,t,r),e+"")}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===i}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===i)||!1}},function(e,t,n){"use strict";e.exports=n(446)()?globalThis:n(447)},function(e,t,n){"use strict";(function(e){t.__esModule=!0,t.default=function(t){return new e(e=>setTimeout(e,t))}}).call(this,n(1))},function(e,t,n){"use strict";(function(t){var r=n(13),i=n(49),o=n(489);function a(e){return r.isPlainObject(e)||r.isArray(e)}function l(e){return r.endsWith(e,"[]")?e.slice(0,-2):e}function c(e,t,n){return e?e.concat(t).map((function(e,t){return e=l(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var s=r.toFlatObject(r,{},null,(function(e){return/^is[A-Z]/.test(e)}));e.exports=function(e,n,d){if(!r.isObject(e))throw new TypeError("target must be an object");n=n||new(o||FormData);var u,A=(d=r.toFlatObject(d,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.isUndefined(t[e])}))).metaTokens,h=d.visitor||U,g=d.dots,Q=d.indexes,F=(d.Blob||"undefined"!=typeof Blob&&Blob)&&((u=n)&&r.isFunction(u.append)&&"FormData"===u[Symbol.toStringTag]&&u[Symbol.iterator]);if(!r.isFunction(h))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(r.isDate(e))return e.toISOString();if(!F&&r.isBlob(e))throw new i("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(e)||r.isTypedArray(e)?F&&"function"==typeof Blob?new Blob([e]):t.from(e):e}function U(e,t,i){var o=e;if(e&&!i&&"object"==typeof e)if(r.endsWith(t,"{}"))t=A?t:t.slice(0,-2),e=JSON.stringify(e);else if(r.isArray(e)&&function(e){return r.isArray(e)&&!e.some(a)}(e)||r.isFileList(e)||r.endsWith(t,"[]")&&(o=r.toArray(e)))return t=l(t),o.forEach((function(e,i){!r.isUndefined(e)&&null!==e&&n.append(!0===Q?c([t],i,g):null===Q?t:t+"[]",p(e))})),!1;return!!a(e)||(n.append(c(i,t,g),p(e)),!1)}var m=[],b=Object.assign(s,{defaultVisitor:U,convertValue:p,isVisitable:a});if(!r.isObject(e))throw new TypeError("data must be an object");return function e(t,i){if(!r.isUndefined(t)){if(-1!==m.indexOf(t))throw Error("Circular reference detected in "+i.join("."));m.push(t),r.forEach(t,(function(t,o){!0===(!(r.isUndefined(t)||null===t)&&h.call(n,t,r.isString(o)?o.trim():o,i,b))&&e(t,i?i.concat(o):[o])})),m.pop()}}(e),n}}).call(this,n(228).Buffer)},function(e,t,n){"use strict";var r=n(49);function i(e,t,n){r.call(this,null==e?"canceled":e,r.ERR_CANCELED,t,n),this.name="CanceledError"}n(13).inherits(i,r,{__CANCEL__:!0}),e.exports=i},function(e,t,n){var r=n(90),i=n(12);e.exports=function(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=r(e.prototype),o=e.apply(n,t);return i(o)?o:n}}},function(e,t,n){var r=n(525);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t,n){var r=n(531);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(118),i=n(541),o=n(542);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(62),i=n(50);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},function(e,t,n){var r=n(260),i=n(34);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(261));const o=e=>e.replace(/\/$/,"");var a=(e,t)=>{if(!t)return e;const n=i.default.parse(t),r=i.default.parse(e);if(!n.protocol||!r.protocol)return e;const a=n.protocol.match(/^https/),l=r.protocol.match(/^ws/i);return`${o(`${(l?"ws":"http")+(a?"s":"")}://${n.host}${n.pathname}`)}/${o(`${r.host}${r.pathname}${r.search||""}`)}`};t.default=a},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;let r="";var i={getCurrentAudioOutputDeviceId:()=>r,setCurrentAudioOutputDeviceId:e=>{r=e}};t.default=i},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e,t){const n={};Object.keys(t).forEach(r=>{n[r]=((e,t,n)=>{if(t&&!n)return()=>t.call(e);if(t&&n)return r=>(void 0!==r&&n.call(e,r),t.call(e));return t=>{void 0!==t&&n.call(e,t)}})(e,t[r].get,t[r].set)}),(0,i.default)(e,n)};var i=r(n(10))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(209));var o=function(e){let t=(void 0===e?{}:e).NativeVideoElementWrapper;const n=void 0===t?(0,i.default)():t;return function(e){let t=void 0===e?{}:e,r=t.fallbackText,i=void 0===r?"Sorry, Web RTC is not available in your browser":r,o=t.fitMode,a=t.muted,l=t._inject,c=t.widgetType;return new n({fallbackText:i,fitMode:o,muted:a,defaultAudioVolume:50,_inject:l,widgetType:c})}};t.default=o},function(e,t,n){"use strict";function r(e){return e.map(e=>({url:e.url,urls:e.urls||[e.url],username:e.username,credential:e.credential}))}t.__esModule=!0,t.adaptIceServers=r,t.parseIceServers=function(e){let t;try{t=JSON.parse(e.data).content.iceServers}catch(e){return[]}return r(t)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(3));t.default=()=>"Chrome"===i.default.name&&i.default.version>=58||"Samsung"===i.default.name&&i.default.version>=7||i.default.isIosWebView&&i.default.iOSVersion>=11||i.default.isAndroidWebView&&i.default.androidVersion>=4.4||-1!==["Firefox","Edge","Safari","Opera"].indexOf(i.default.name)},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){let t=null,n=!1;const r=()=>{n&&(e(),t=window.requestAnimationFrame(r))};this.start=()=>{n||(n=!0,t=window.requestAnimationFrame(r))},this.stop=()=>{window.cancelAnimationFrame(t),n=!1}}},function(e,t,n){"use strict";t.__esModule=!0,t.ONE_SECOND_IN_MS=t.ONE_MINUTE_IN_MS=void 0;t.ONE_SECOND_IN_MS=1e3;t.ONE_MINUTE_IN_MS=6e4},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationError=t.default=void 0;var r=o(n(717)),i=o(n(331));function o(e){return e&&e.__esModule?e:{default:e}}t.default=r.default,t.CancellationError=i.default},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i,o,a=r(n(54)),l=r(n(3));const c=!!window.crypto,s=!!window.RTCRtpScriptTransform&&!l.default.isFirefox,d=!(null==(i=window.RTCRtpSender)||!i.prototype.createEncodedStreams)||!(null==(o=window.RTCRtpSender)||!o.prototype.createdEncodedVideoStreams)||s,u=!!window.Worker,A=()=>c&&d&&u;t.default=function(e){void 0===e&&(e={});const t=e.hasOpenTokSupport||a.default.once,n=e.isE2eeSupported||A;return t()&&n()}},function(e,t,n){var r=n(42)(n(16),"Map");e.exports=r},function(e,t,n){var r=n(387),i=n(394),o=n(396),a=n(397),l=n(398);function c(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])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=l,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(192),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,l=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l}).call(this,n(88)(e))},function(e,t,n){var r=n(70),i=n(403),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(408),i=n(199),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,l=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=l},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t,n){var r=n(197)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(206);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){e.exports=function(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(e,t,n){var r=n(423),i=n(212)(r);e.exports=i},function(e,t,n){var r=n(55),i=n(29),o=n(68),a=n(12);e.exports=function(e,t,n){if(!a(n))return!1;var l=typeof t;return!!("number"==l?i(n)&&o(t,n.length):"string"==l&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={error:{priority:1,method:"error"},warn:{priority:2,method:"warn"},info:{priority:3,method:"info"},log:{priority:4,method:"log"},debug:{priority:5,method:"debug"},spam:{priority:6,method:"log"}};t.default=r},function(e,t,n){"use strict";e.exports=n(214)()?Object.setPrototypeOf:n(215)},function(e,t,n){"use strict";var r=n(59),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!r(e)&&hasOwnProperty.call(i,typeof e)}},function(e,t,n){"use strict";e.exports=n(437)()?Object.assign:n(438)},function(e,t,n){"use strict";(function(t){var r=n(13),i=n(229),o=n(49),a=n(230),l=n(97),c=n(494),s=n(135),d=n(231),u={"Content-Type":"application/x-www-form-urlencoded"};function A(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var h,g={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(h=n(232)),h),transformRequest:[function(e,t){i(t,"Accept"),i(t,"Content-Type");var n,o=t&&t["Content-Type"]||"",a=o.indexOf("application/json")>-1,s=r.isObject(e);if(s&&r.isHTMLForm(e)&&(e=new FormData(e)),r.isFormData(e))return a?JSON.stringify(d(e)):e;if(r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return A(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(s){if(-1!==o.indexOf("application/x-www-form-urlencoded"))return c(e,this.formSerializer).toString();if((n=r.isFileList(e))||o.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return l(n?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||a?(A(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&r.isString(e)&&(n&&!this.responseType||i)){var a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:s.classes.FormData,Blob:s.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){g.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){g.headers[e]=r.merge(u)})),e.exports=g}).call(this,n(25))},function(e,t,n){"use strict";e.exports=n(495)},function(e,t){e.exports={}},function(e,t,n){var r=n(238),i=n(514),o=n(515),a=n(240),l=n(529),c=n(244),s=n(530),d=n(247),u=n(248),A=n(101),h=Math.max;e.exports=function(e,t,n,g,Q,F,p,U){var m=2&t;if(!m&&"function"!=typeof e)throw new TypeError("Expected a function");var b=g?g.length:0;if(b||(t&=-97,g=Q=void 0),p=void 0===p?p:h(A(p),0),U=void 0===U?U:A(U),b-=Q?Q.length:0,64&t){var B=g,Z=Q;g=Q=void 0}var f=m?void 0:c(e),R=[e,t,n,g,Q,B,Z,F,p,U];if(f&&s(R,f),e=R[0],t=R[1],n=R[2],g=R[3],Q=R[4],!(U=R[9]=void 0===R[9]?m?0:e.length:h(R[9]-b,0))&&24&t&&(t&=-25),t&&1!=t)I=8==t||16==t?o(e,t,U):32!=t&&33!=t||Q.length?a.apply(void 0,R):l(e,t,n,g);else var I=i(e,t,n);return u((f?r:d)(I,R),e,t)}},function(e,t,n){var r=n(90),i=n(139);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&"__lodash_placeholder__"!==a||(e[n]="__lodash_placeholder__",o[i++]=n)}return o}},function(e,t,n){var r=n(33),i=n(125),o=n(19),a=Function.prototype,l=Object.prototype,c=a.toString,s=l.hasOwnProperty,d=c.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}},function(e,t,n){var r=n(540),i=n(19);e.exports=function e(t,n,o,a,l){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,l))}},function(e,t,n){var r=n(15),i=n(72),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(555),i=n(211),o=n(128);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){"use strict";let r;t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.AudioContext||(void 0!==typeof window?window:global).AudioContext||(void 0!==typeof window?window:global).webkitAudioContext;return function(){if(r=r||t&&new t,null==r)throw new Error("AudioContext could not be created, hardware limit reached.");return r}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;let r=function(){function e(e){this._analyser=null,this._timeDomainData=null,this._sourceNode=null,this._audioContext=e}var t=e.prototype;return t._initAudioAnalyser=function(e){this._analyser=this._audioContext.createAnalyser(),this._sourceNode=this._audioContext.createMediaStreamSource(e),this._sourceNode.connect(this._analyser),this._timeDomainData=new Uint8Array(this._analyser.frequencyBinCount)},t.webRTCStream=function(e){this._sourceNode&&this._sourceNode.disconnect(this._analyser),"suspended"===this._audioContext.state&&this._audioContext.resume(),this._initAudioAnalyser(e)},t.destroy=function(){this._sourceNode&&this._sourceNode.disconnect(this._analyser),this._timeDomainData=null},t.sample=function(e){if("function"==typeof e)throw new Error("sample no longer takes a callback");if(this._analyser&&this._timeDomainData){this._analyser.getByteTimeDomainData(this._timeDomainData);let e=0;for(let t=this._timeDomainData.length-1;t>=0;t-=1)e=Math.max(e,Math.abs(this._timeDomainData[t]-128));return e/128}return null},e}();t.default=r},function(e,t,n){var r=n(91),i=n(55),o=n(129),a=n(56),l=Object.prototype,c=l.hasOwnProperty,s=r((function(e,t){e=Object(e);var n=-1,r=t.length,s=r>2?t[2]:void 0;for(s&&o(t[0],t[1],s)&&(r=1);++n<r;)for(var d=t[n],u=a(d),A=-1,h=u.length;++A<h;){var g=u[A],Q=e[g];(void 0===Q||i(Q,l[g])&&!c.call(e,g))&&(e[g]=d[g])}return e}));e.exports=s},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(10)),o=r(n(149));const a=(0,r(n(2)).default)("Event");let l=function(){function e(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={}),this.type=e,this.cancelable=t,this._defaultPrevented=!1;const r=(0,o.default)(Object.keys(this),Object.keys(n));if(r.length>0)throw new Error("Cannot used reserved property names: "+r.join(","));(0,i.default)(this,n)}var t=e.prototype;return t.preventDefault=function(){this.cancelable?this._defaultPrevented=!0:a.warn("Event.preventDefault :: Trying to preventDefault on an event that isn't cancelable")},t.isDefaultPrevented=function(){return this._defaultPrevented},e}();t.default=l},function(e,t,n){var r=n(38),i=n(583),o=n(91),a=n(584),l=o((function(e){var t=r(e,a);return t.length&&t[0]===e[0]?i(t):[]}));e.exports=l},function(e,t){e.exports=function(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(e,t,n){var r=n(29),i=n(19);e.exports=function(e){return i(e)&&r(e)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(26)),o=r(n(64)),a=r(n(61));var l=function(){function e(e){void 0===e&&(e={}),Object.defineProperty(this,"_rawSessionInfo",{value:(0,o.default)(e)})}return(0,i.default)(e,[{key:"sessionId",get:function(){return this._rawSessionInfo.session_id}},{key:"partnerId",get:function(){return this._rawSessionInfo.partner_id}},{key:"messagingServer",get:function(){return this._rawSessionInfo.messaging_server_url}},{key:"mediaServerName",get:function(){return this._rawSessionInfo.media_server_hostname}},{key:"messagingURL",get:function(){return this._rawSessionInfo.messaging_url}},{key:"symphonyAddress",get:function(){return this._rawSessionInfo.symphony_address}},{key:"iceServers",get:function(){return this._rawSessionInfo.ice_servers}},{key:"simulcast",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.simulcast")}},{key:"e2ee",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.e2ee",!1)}},{key:"reconnection",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.reconnection",!1)}},{key:"renegotiation",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.renegotiation",!1)}},{key:"p2pEnabled",get:function(){return"enabled"===(0,a.default)(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"hybridSession",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.hybridSession",!1)}},{key:"isAdaptiveEnabled",get:function(){return"adaptive"===(0,a.default)(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"priorityVideoCodec",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.priorityVideoCodec","")}},{key:"h264",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.h264",!0)}},{key:"vp8",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.vp8",!0)}},{key:"vp9",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.vp9",!0)}},{key:"singlePeerConnection",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.singlePeerConnection",!1)}},{key:"clientCandidates",get:function(){const e=(0,a.default)(this._rawSessionInfo,"properties.clientCandidates");return"relayed"===e?"relay":e}}]),e}();t.default=l},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(12)),o=r(n(3));let a;const l=["description","fileName","lineNumber","message","name","number","stack"],c=function(e,t,n){switch(arguments.length){case 1:(0,i.default)(e)&&(n=e,t=void 0,e=void 0);break;case 2:(0,i.default)(t)&&(n=t,t=void 0)}if(n instanceof Error)for(let e=0,t=l.length;e<t;++e)this[l[e]]=n[l[e]];else if((0,i.default)(n))for(const e in n)n.hasOwnProperty(e)&&(this[e]=n[e]);if(!(this.fileName&&this.lineNumber&&this.columnNumber&&this.stack)){const e=a();!this.fileName&&e.fileName&&(this.fileName=e.fileName),!this.lineNumber&&e.lineNumber&&(this.lineNumber=e.lineNumber),!this.columnNumber&&e.columnNumber&&(this.columnNumber=e.columnNumber),!this.stack&&e.stack&&(this.stack=e.stack)}!this.message&&e&&(this.message=e),this.name&&"Error"!==this.name||!t||(this.name=t)};(c.prototype=Object.create(Error.prototype)).toString=function(){let e="";return this.fileName&&(e+=" "+this.fileName),this.lineNumber&&(e+=" "+this.lineNumber,this.columnNumber&&(e+=":"+this.columnNumber)),`<${this.name?this.name+" ":""}${this.message}${e}>`},c.prototype.valueOf=c.prototype.toString;const s=function(e,t){return t.slice(2).map(e=>{const t={fileName:e.getFileName(),linenumber:e.getLineNumber(),columnNumber:e.getColumnNumber()};return e.getFunctionName()&&(t.functionName=e.getFunctionName()),e.getMethodName()&&(t.methodName=e.getMethodName()),e.getThis()&&(t.self=e.getThis()),t})};a=function(){const e={};let t,n,r;switch(o.default.name){case"Firefox":case"Safari":try{(void 0!==typeof window?window:global).call.js.is.explody()}catch(e){r=e}t=(r.stack||"").split("\n"),t.shift(),t.shift(),e.stack=t,n=/@(.+?):([0-9]+)(:([0-9]+))?$/.exec(t[0]),n&&(e.fileName=n[1],e.lineNumber=parseInt(n[2],10),n.length>3&&(e.columnNumber=parseInt(n[4],10)));break;case"Chrome":case"Samsung":case"Node":case"Opera":var i=Error.prepareStackTrace;Error.prepareStackTrace=s,r=new Error,e.stack=r.stack,Error.prepareStackTrace=i;var a=e.stack[0];e.lineNumber=a.lineNumber,e.columnNumber=a.columnNumber,e.fileName=a.fileName,a.functionName&&(e.functionName=a.functionName),a.methodName&&(e.methodName=a.methodName),a.self&&(e.self=a.self);break;default:r=new Error,r.stack&&(e.stack=r.stack.split("\n"))}return r.message&&(e.message=r.message),e};var d=c;t.default=d},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default=()=>document.createElement("video")},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){return{ROTATED_NORMAL:0,ROTATED_LEFT:270,ROTATED_RIGHT:90,ROTATED_UPSIDE_DOWN:180}}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){if(void 0!==e.adapter||l.default.isLegacyEdge)return e;const t=(e=>{const t={},n=(e,t,n)=>{n.forEach(n=>{let r=n.key,i=n.type,o=t[r];if(void 0!==o){switch(i){case"function":o=((e,t)=>{if("function"!=typeof t)return c.warn("Non-function passed into bindWithStaticProperties()"),t;const n=t.bind(e);return Object.keys(t).forEach(e=>{n[e]=t[e]}),n})(t,o);break;case"class":o="function"!=typeof(l=o)?(c.warn("Non-function passed into extendClass()"),l):(0,a.default)(l);break;case"string":case"object":break;default:throw new Error("Invalid type of window key: "+i)}e[r]=o}var l})};n(t,e,s),void 0!==e.navigator&&(t.navigator={},n(t.navigator,e.navigator,d),void 0!==e.navigator.mediaDevices&&(t.navigator.mediaDevices={},n(t.navigator.mediaDevices,e.navigator.mediaDevices,u)));return t})(e);return(0,i.default)({window:t}),t};var i=r(n(600)),o=r(n(2)),a=r(n(611)),l=r(n(3));const c=(0,o.default)("createWindowMock"),s=[{key:"location",type:"object"},{key:"setTimeout",type:"function"},{key:"requestAnimationFrame",type:"function"},{key:"URL",type:"function"},{key:"MediaStream",type:"class"},{key:"webkitMediaStream",type:"class"},{key:"RTCIceCandidate",type:"class"},{key:"mozRTCIceCandidate",type:"class"},{key:"RTCSessionDescription",type:"class"},{key:"mozRTCSessionDescription",type:"class"},{key:"RTCIceGatherer",type:"class"},{key:"RTCIceTransport",type:"class"},{key:"RTCDtlsTransport",type:"class"},{key:"RTCSctpTransport",type:"class"},{key:"RTCRtpReceiver",type:"class"},{key:"HTMLMediaElement",type:"class"},{key:"RTCPeerConnection",type:"class"},{key:"webkitRTCPeerConnection",type:"class"},{key:"mozRTCPeerConnection",type:"class"},{key:"MediaStreamTrack",type:"class"},{key:"RTCRtpSender",type:"class"},{key:"RTCTrackEvent",type:"class"},{key:"RTCTransceiver",type:"class"},{key:"RTCDtmfSender",type:"class"},{key:"RTCDTMFSender",type:"class"},{key:"MediaStreamTrackEvent",type:"class"}],d=[{key:"userAgent",type:"string"},{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"webkitGetUserMedia",type:"function"},{key:"mozGetUserMedia",type:"function"}],u=[{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"enumerateDevices",type:"function"},{key:"getSupportedConstraints",type:"function"},{key:"addEventListener",type:"function"},{key:"removeEventListener",type:"function"}]},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){let e=null;this.transform=t=>{e=null===e||t>=e?t:.3*t+.7*e;const n=Math.log(e)/Math.LN10/1.5+1;return Math.min(Math.max(n,0),1)}}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){const t={},n=(n,r)=>{(0,i.default)(r,{parent:this}),r.appendTo(e.parent),t[n]=r,this[n]=r};if(!e.parent)return;(0,o.default)(this),this.destroy=()=>{this.off(),this.hideWhileLoading(),a(t).forEach(e=>e.destroy())},this.showAfterLoading=()=>{a(t).forEach(e=>e.showAfterLoading())},this.hideWhileLoading=()=>{a(t).forEach(e=>e.hideWhileLoading())},this.set=(e,t)=>("string"==typeof e&&t?n(e,t):Object.keys(e).forEach(t=>{n(t,e[t])}),this)};var i=r(n(10)),o=r(n(7));const a=e=>Object.keys(e).map(t=>e[t])},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(7)),o=r(n(30)),a=r(n(612));const l=(0,r(n(17)).default)(),c=(0,a.default)();var s=new function(){const e=this;function t(){return c.isDomLoaded()&&!c.isDomUnloaded()}function n(){e.dispatchEvent(new l.EnvLoadedEvent(o.default.ENV_UNLOADED))}(0,i.default)(e),c.whenLoaded.then((function(){c.whenUnloaded.then(n),t()&&e.dispatchEvent(new l.EnvLoadedEvent(o.default.ENV_LOADED))})),this.onLoad=function(n,r){t()?n.call(r):e.on(o.default.ENV_LOADED,n,r)},this.onUnload=function(t,n){this.isUnloaded()?t.call(n):e.on(o.default.ENV_UNLOADED,t,n)},this.isUnloaded=function(){return c.isDomUnloaded()}};t.default=s},function(e,t,n){"use strict";var r=n(618);
|
|
17
|
+
*/var n;n=function(){"use strict";function e(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=void 0,o=void 0,a=function(e,t){h[r]=e,h[r+1]=t,2===(r+=2)&&(o?o(g):m())},l="undefined"!=typeof window?window:void 0,c=l||{},s=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),u="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function A(){var e=setTimeout;return function(){return e(g,1)}}var h=new Array(1e3);function g(){for(var e=0;e<r;e+=2)(0,h[e])(h[e+1]),h[e]=void 0,h[e+1]=void 0;r=0}var Q,F,p,U,m=void 0;function b(e,t){var n=this,r=new this.constructor(f);void 0===r[Z]&&J(r);var i=n._state;if(i){var o=arguments[i-1];a((function(){return S(i,r,o,n._result)}))}else W(n,r,e,t);return r}function B(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(f);return I(t,e),t}d?m=function(){return t.nextTick(g)}:s?(F=0,p=new s(g),U=document.createTextNode(""),p.observe(U,{characterData:!0}),m=function(){U.data=F=++F%2}):u?((Q=new MessageChannel).port1.onmessage=g,m=function(){return Q.port2.postMessage(0)}):m=void 0===l?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(g)}:A()}catch(e){return A()}}():A();var Z=Math.random().toString(36).substring(2);function f(){}function R(t,n,r){n.constructor===t.constructor&&r===b&&n.constructor.resolve===B?function(e,t){1===t._state?V(e,t._result):2===t._state?C(e,t._result):W(t,void 0,(function(t){return I(e,t)}),(function(t){return C(e,t)}))}(t,n):void 0===r?V(t,n):e(r)?function(e,t,n){a((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?I(e,n):V(e,n))}),(function(t){r||(r=!0,C(e,t))}),e._label);!r&&i&&(r=!0,C(e,i))}),e)}(t,n,r):V(t,n)}function I(e,t){if(e===t)C(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)V(e,t);else{var n=void 0;try{n=t.then}catch(t){return void C(e,t)}R(e,t,n)}var r,i}function y(e){e._onerror&&e._onerror(e._result),E(e)}function V(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&a(E,e))}function C(e,t){void 0===e._state&&(e._state=2,e._result=t,a(y,e))}function W(e,t,n,r){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+1]=n,i[o+2]=r,0===o&&e._state&&a(E,e)}function E(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,o=e._result,a=0;a<t.length;a+=3)r=t[a],i=t[a+n],r?S(n,r,i,o):i(o);e._subscribers.length=0}}function S(t,n,r,i){var o=e(r),a=void 0,l=void 0,c=!0;if(o){try{a=r(i)}catch(e){c=!1,l=e}if(n===a)return void C(n,new TypeError("A promises callback cannot return that same promise."))}else a=i;void 0!==n._state||(o&&c?I(n,a):!1===c?C(n,l):1===t?V(n,a):2===t&&C(n,a))}var v=0;function J(e){e[Z]=v++,e._state=void 0,e._result=void 0,e._subscribers=[]}var N=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(f),this.promise[Z]||J(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?V(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&V(this.promise,this._result))):C(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===B){var i=void 0,o=void 0,a=!1;try{i=e.then}catch(e){a=!0,o=e}if(i===b&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===G){var l=new n(f);a?C(l,o):R(l,e,i),this._willSettleAt(l,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===e?C(r,n):this._result[t]=n),0===this._remaining&&V(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;W(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),G=function(){function t(e){this[Z]=v++,this._result=this._state=void 0,this._subscribers=[],f!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){I(e,t)}),(function(t){C(e,t)}))}catch(t){C(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this.constructor;return e(t)?this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return G.prototype.then=b,G.all=function(e){return new N(this,e).promise},G.race=function(e){var t=this;return n(e)?new t((function(n,r){for(var i=e.length,o=0;o<i;o++)t.resolve(e[o]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},G.resolve=B,G.reject=function(e){var t=new this(f);return C(t,e),t},G._setScheduler=function(e){o=e},G._setAsap=function(e){a=e},G._asap=a,G.polyfill=function(){var e=void 0;if(void 0!==(void 0!==typeof window?window:global))e=void 0!==typeof window?window:global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=G},G.Promise=G,G},e.exports=n()}).call(this,n(25))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(425)),o=r(n(58)),a=r(n(130));const l=(0,o.default)(e=>{const t={};return Object.keys(a.default).forEach(n=>{const r=a.default[n].method,o=(0,i.default)(`OpenTok:${e}:${n.toLowerCase()}`);o.log=console[r].bind(console),t[n.toLowerCase()]=o}),t});l.setLogLevel=e=>{let t;try{t=(void 0!==typeof window?window:global).localStorage.debug}catch(e){t=""}const n=[...Object.keys(a.default).map(t=>`${e>=a.default[t].priority?"":"-"}(autogen)?OpenTok:*:${t.toLowerCase()}`),...(t||"").split(/[\s,]/).filter(e=>-1===e.indexOf("(autogen)?"))].filter(e=>e).join(",");i.default.enable(n)};var c=l;t.default=c},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(481)).default.parse();t.default=i},function(e,t,n){e.exports=n(421)},function(e,t,n){(function(t){function n(e,n,r,i,o,a,l){try{var c=e[a](l),s=c.value}catch(e){return void r(e)}c.done?n(s):t.resolve(s).then(i,o)}e.exports=function(e){return function(){var r=this,i=arguments;return new t((function(t,o){var a=e.apply(r,i);function l(e){n(a,t,o,l,c,"next",e)}function c(e){n(a,t,o,l,c,"throw",e)}l(void 0)}))}}}).call(this,n(1))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default={AUTHENTICATION_ERROR:"OT_AUTHENTICATION_ERROR",BADLY_FORMED_RESPONSE:"OT_BADLY_FORMED_RESPONSE",CHROME_MICROPHONE_ACQUISITION_ERROR:"OT_CHROME_MICROPHONE_ACQUISITION_ERROR",CONNECT_FAILED:"OT_CONNECT_FAILED",CONNECTION_LIMIT_EXCEEDED:"OT_CONNECTION_LIMIT_EXCEEDED",CONSTRAINTS_NOT_SATISFIED:"OT_CONSTRAINTS_NOT_SATISFIED",CREATE_PEER_CONNECTION_FAILED:"OT_CREATE_PEER_CONNECTION_FAILED",DISCONNECTED:"OT_DISCONNECTED",EMPTY_RESPONSE_BODY:"OT_EMPTY_RESPONSE_BODY",GET_RTC_STATS_REPORT_NOT_SUPPORTED:"OT_GET_RTC_STATS_REPORT_NOT_SUPPORTED",HARDWARE_UNAVAILABLE:"OT_HARDWARE_UNAVAILABLE",ICE_WORKFLOW_FAILED:"OT_ICE_WORKFLOW_FAILED",INVALID_HTTP_STATUS:"OT_INVALID_HTTP_STATUS",INVALID_PARAMETER:"OT_INVALID_PARAMETER",INVALID_SESSION_ID:"OT_INVALID_SESSION_ID",MEDIA_ERR_ABORTED:"OT_MEDIA_ERR_ABORTED",MEDIA_ERR_DECODE:"OT_MEDIA_ERR_DECODE",MEDIA_ERR_NETWORK:"OT_MEDIA_ERR_NETWORK",MEDIA_ERR_SRC_NOT_SUPPORTED:"OT_MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ENDED:"OT_MEDIA_ENDED",NO_DEVICES_FOUND:"OT_NO_DEVICES_FOUND",NO_VALID_CONSTRAINTS:"OT_NO_VALID_CONSTRAINTS",NOT_CONNECTED:"OT_NOT_CONNECTED",NOT_FOUND:"OT_NOT_FOUND",NOT_SUPPORTED:"OT_NOT_SUPPORTED",PEER_CONNECTION_NOT_CONNECTED:"OT_PEER_CONNECTION_NOT_CONNECTED",PERMISSION_DENIED:"OT_PERMISSION_DENIED",RATE_LIMIT_EXCEEDED:"OT_RATE_LIMIT_EXCEEDED",REPORT_ISSUE_FAILED:"OT_REPORT_ISSUE_FAILED",SCREEN_SHARING_EXTENSION_NOT_INSTALLED:"OT_SCREEN_SHARING_EXTENSION_NOT_INSTALLED",SCREEN_SHARING_EXTENSION_NOT_REGISTERED:"OT_SCREEN_SHARING_EXTENSION_NOT_REGISTERED",SCREEN_SHARING_NOT_SUPPORTED:"OT_SCREEN_SHARING_NOT_SUPPORTED",SET_REMOTE_DESCRIPTION_FAILED:"OT_SET_REMOTE_DESCRIPTION_FAILED",FAILED_SET_CONFIGURATION:"OT_FAILED_SET_CONFIGURATION",SOCKET_ALREADY_CONNECTED_CONNECTING:"OT_SOCKET_ALREADY_CONNECTED_CONNECTING",SOCKET_CLOSE_ABNORMAL:"OT_SOCKET_CLOSE_ABNORMAL",SOCKET_CLOSE_CONNECT_EXCEPTION:"OT_SOCKET_CLOSE_CONNECT_EXCEPTION",SOCKET_CLOSE_CONNECTIVITY_LOSS:"OT_SOCKET_CLOSE_CONNECTIVITY_LOSS",SOCKET_CLOSE_FALLBACK_CODE:"OT_SOCKET_CLOSE_FALLBACK_CODE",SOCKET_CLOSE_INCONSISTENT_DATA:"OT_SOCKET_CLOSE_INCONSISTENT_DATA",SOCKET_CLOSE_NO_STATUS:"OT_SOCKET_CLOSE_NO_STATUS",SOCKET_CLOSE_POLICY_VIOLATION:"OT_SOCKET_CLOSE_POLICY_VIOLATION",SOCKET_CLOSE_GOING_AWAY:"OT_SOCKET_CLOSE_GOING_AWAY",SOCKET_CLOSE_PROTOCOL_ERROR:"OT_SOCKET_CLOSE_PROTOCOL_ERROR",SOCKET_CLOSE_TIMEOUT:"OT_SOCKET_CLOSE_TIMEOUT",SOCKET_CLOSE_TOO_LARGE:"OT_SOCKET_CLOSE_TOO_LARGE",SOCKET_CLOSE_UNEXPECTED_CONDITION:"OT_SOCKET_CLOSE_UNEXPECTED_CONDITION",SOCKET_CLOSE_UNSUPPORTED:"OT_SOCKET_CLOSE_UNSUPPORTED",STREAM_CREATE_FAILED:"OT_STREAM_CREATE_FAILED",STREAM_DESTROYED:"OT_STREAM_DESTROYED",STREAM_LIMIT_EXCEEDED:"OT_STREAM_LIMIT_EXCEEDED",STREAM_NOT_FOUND:"OT_STREAM_NOT_FOUND",UNABLE_TO_SUBSCRIBE:"OT_UNABLE_TO_SUBSCRIBE",TERMS_OF_SERVICE_FAILURE:"OT_TERMS_OF_SERVICE_FAILURE",TIMEOUT:"OT_TIMEOUT",CANCEL:"OT_CANCEL",UNABLE_TO_CAPTURE_MEDIA:"OT_UNABLE_TO_CAPTURE_MEDIA",UNABLE_TO_CAPTURE_SCREEN:"OT_UNABLE_TO_CAPTURE_SCREEN",UNEXPECTED_ERROR_CODE:"OT_UNEXPECTED_ERROR_CODE",UNEXPECTED_HTTP_STATUS:"OT_UNEXPECTED_HTTP_STATUS",UNEXPECTED_SERVER_RESPONSE:"OT_UNEXPECTED_SERVER_RESPONSE",UNKNOWN_HTTP_ERROR:"OT_UNKNOWN_HTTP_ERROR",UNSUPPORTED_BROWSER:"OT_UNSUPPORTED_BROWSER",USER_MEDIA_ACCESS_DENIED:"OT_USER_MEDIA_ACCESS_DENIED",XDOMAIN_OR_PARSING_ERROR:"OT_XDOMAIN_OR_PARSING_ERROR",API_KEY_DISABLED:"OT_API_KEY_DISABLED",UNABLE_TO_ACCESS_MEDIA_ENGINE:"OT_UNABLE_TO_ACCESS_MEDIA_ENGINE",SET_PROXY_URL_TIMING_ERROR:"OT_SET_PROXY_URL_TIMING_ERROR",PROXY_URL_ALREADY_SET_ERROR:"OT_PROXY_URL_ALREADY_SET_ERROR",SET_VIDEO_SOURCE_FAILURE:"OT_SET_VIDEO_SOURCE_FAILURE",INVALID_VIDEO_SOURCE:"OT_INVALID_VIDEO_SOURCE",REQUESTED_DEVICE_PERMISSION_DENIED:"OT_REQUESTED_DEVICE_PERMISSION_DENIED",INVALID_AUDIO_OUTPUT_SOURCE:"OT_INVALID_AUDIO_OUTPUT_SOURCE",INVALID_ENCRYPTION_SECRET:"OT_INVALID_ENCRYPTION_SECRET"}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){const t=new a.default;t.on("newListener",e=>{t.emit(e+":added")}),t.on("removeListener",e=>{t.emit(e+":removed")});const n={eventsDispatched:{},on(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.on(e,(0,c.default)(n,r))}):Object.keys(e).forEach(r=>{t.on(r,(0,c.default)(e[r],n))}),this},off(e,n,r){return"string"==typeof e?this.off(e.split(" "),n,r):Array.isArray(e)?e.forEach(e=>{n&&(0,o.default)(n)?t.removeListener(e,(0,c.default)(n,r)):t.removeAllListeners(e)}):e?Object.keys(e).forEach(r=>{t.removeListener(r,(0,c.default)(e[r],n))}):t.removeAllListeners(),this},once(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.once(e,(0,c.default)(n,r))}):Object.keys(e).forEach(r=>{t.once(r,(0,c.default)(e[r],n))}),this},dispatchEvent(e){if(!e.type)throw new Error("dispatchEvent: Event has no type");return e.target||(e.target=this),this.trigger(e.type,e),this},dispatchEventOnce(e,t){this.isEventDispatched(e.type,t)||(this.dispatchEvent(e),this.eventsDispatched[e.type]?this.eventsDispatched[e.type].push(t):this.eventsDispatched[e.type]=[t])},isEventDispatched(e,t){var n;return null==(n=this.eventsDispatched[e])?void 0:n.includes(t)},trigger(e){try{for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.emit(e,...r)}catch(e){s.error("An error occurred in an event handler",e)}return this},emit(){return e.trigger(...arguments)},addEventListener:(t,n,r)=>(s.warn("The addEventListener() method is deprecated. Use on() or once() instead."),e.on(t,n,r)),removeEventListener:(t,n,r)=>(s.warn("The removeEventListener() method is deprecated. Use off() instead."),e.off(t,n,r)),listenerCount:e=>t.listenerCount(e)};return(0,i.default)(e,n)};var i=r(n(10)),o=r(n(18)),a=r(n(11)),l=r(n(2)),c=r(n(428));const s=(0,l.default)("Events")},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(147)),o=r(n(264)),a=r(n(7)),l=r(n(2)),c=r(n(3)),s=r(n(266)),d=r(n(265)),u=r(n(267)),A=r(n(579)),h=r(n(269)),g=r(n(272)),Q=r(n(593)),F=r(n(153));o.default.logging=(0,l.default)("OT.$"),o.default.env=c.default,o.default.ElementCollection=d.default,o.default.ajax=u.default,o.default.statable=A.default,o.default.Analytics=h.default,o.default.Collection=g.default,o.default.domExtras=Q.default,o.default.Error=F.default,(0,s.default)(o.default,"useLogHelpers",{value(e){const t=(0,l.default)("useLogHelpersDeprecatedMixin");return Object.keys(t).forEach(n=>{e[n]=t[n]}),e},name:"OT.useLogHelpers",getWarning:"Please use an external library for your debugging needs"}),o.default.defaults=i.default,(0,s.default)(o.default,"eventing",{value:a.default,name:"OT.$.eventing",getWarning:"Please use an external library to create an event emitter."}),Object.keys(o.default).forEach(e=>{const t=o.default[e]._attachToOTHelpers||{};Object.keys(t).forEach(n=>{!Object.hasOwnProperty.call(o.default,n)||"util"===e&&"bind"===n||console.warn(`More than one module is trying to define ${n} on OTHelpers.`),o.default[n]=t[n]})});var p=o.default;t.default=p},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={JS_EXCEPTION:2e3,AUTHENTICATION_ERROR:1004,INVALID_SESSION_ID:1005,CONNECT_FAILED:1006,CONNECT_REJECTED:1007,CONNECTION_TIMEOUT:1008,NOT_CONNECTED:1010,INVALID_PARAMETER:1011,P2P_CONNECTION_FAILED:1013,API_RESPONSE_FAILURE:1014,PEER_CONNECTION_NOT_CONNECTED:1015,TERMS_OF_SERVICE_FAILURE:1026,CONNECTION_LIMIT_EXCEEDED:1027,UNABLE_TO_PUBLISH:1500,UNABLE_TO_SUBSCRIBE:1501,UNSUPPORTED_VIDEO_CODEC:1502,UNABLE_TO_FORCE_DISCONNECT:1520,UNABLE_TO_FORCE_UNPUBLISH:1530,UNABLE_TO_FORCE_MUTE:1540,PUBLISHER_ICE_WORKFLOW_FAILED:1553,SUBSCRIBER_ICE_WORKFLOW_FAILED:1554,STREAM_LIMIT_EXCEEDED:1605,UNEXPECTED_SERVER_RESPONSE:2001,REPORT_ISSUE_ERROR:2011,SET_PROXY_URL_TIMING_ERROR:2021,PROXY_URL_ALREADY_SET_ERROR:2022,GET_RTC_STATS_REPORT_NOT_SUPPORTED:2031,ANVIL_BADLY_FORMED_RESPONSE:3001,ANVIL_INVALID_HTTP_STATUS:3002,ANVIL_XDOMAIN_OR_PARSING_ERROR:3003,ANVIL_UNKNOWN_HTTP_ERROR:3004,ANVIL_UNEXPECTED_ERROR_CODE:3005,ANVIL_EMPTY_RESPONSE_BODY:3006,ANVIL_CONNECT_FAILED:3007,UNABLE_TO_ACCESS_MEDIA_ENGINE:5001};t.default=r},function(e,t,n){var r=n(87),i=n(44),o=n(210),a=n(29),l=n(70),c=n(34),s=Object.prototype.hasOwnProperty,d=o((function(e,t){if(l(t)||a(t))i(t,c(t),e);else for(var n in t)s.call(t,n)&&r(e,n,t[n])}));e.exports=d},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=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 o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,n){return new t((function(t,r){function i(t){e.removeListener(n,o),r(t)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),t([].slice.call(arguments))}F(e,n,o,{once:!0}),"error"!==n&&function(e,t,n){"function"==typeof e.on&&F(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 l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function s(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,o,a,l;if(c(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),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=s(e))>0&&a.length>i&&!a.warned){a.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=a.length,l=d,console&&console.warn&&console.warn(l)}return e}function u(){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 A(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(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):Q(i,i.length)}function g(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 Q(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function F(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 l},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=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||o(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 s(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var s=c.length,d=Q(c,s);for(n=0;n<s;++n)i(d[n],this,t)}return!0},a.prototype.addListener=function(e,t){return d(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return d(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,A(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,A(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,o,a;if(c(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){a=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,a||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 h(this,e,!0)},a.prototype.rawListeners=function(e){return h(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(1))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";var r,i=n(225),o=Object.prototype.toString,a=(r=Object.create(null),function(e){var t=o.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function l(e){return e=e.toLowerCase(),function(t){return a(t)===e}}function c(e){return Array.isArray(e)}function s(e){return void 0===e}var d=l("ArrayBuffer");function u(e){return"number"==typeof e}function A(e){return null!==e&&"object"==typeof e}function h(e){if("object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var g=l("Date"),Q=l("File"),F=l("Blob"),p=l("FileList");function U(e){return"[object Function]"===o.call(e)}var m=l("URLSearchParams");function b(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var B,Z=(B="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return B&&e instanceof B});var f,R=l("HTMLFormElement"),I=(f=Object.prototype.hasOwnProperty,function(e,t){return f.call(e,t)});e.exports={isArray:c,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return e&&("function"==typeof FormData&&e instanceof FormData||"[object FormData]"===o.call(e)||U(e.toString)&&"[object FormData]"===e.toString())},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:u,isObject:A,isPlainObject:h,isEmptyObject:function(e){return e&&0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype},isUndefined:s,isDate:g,isFile:Q,isBlob:F,isFunction:U,isStream:function(e){return A(e)&&U(e.pipe)},isURLSearchParams:m,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function e(){var t={};function n(n,r){h(t[r])&&h(n)?t[r]=e(t[r],n):h(n)?t[r]=e({},n):c(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)b(arguments[r],n);return t},extend:function(e,t,n){return b(t,(function(t,r){e[r]=n&&"function"==typeof t?i(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var i,o,a,l={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)a=i[o],r&&!r(a,e,t)||l[a]||(t[a]=e[a],l[a]=!0);e=!1!==n&&Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:l,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(c(e))return e;var t=e.length;if(!u(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:Z,isFileList:p,forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var i=n.value;t.call(e,i[0],i[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:R,hasOwnProperty:I}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.Errors||o.default,n=e.OTErrorClass||i.default,r=Object.keys(t).map(e=>t[e]);return function(e,t,i){if(-1===r.indexOf(e))return new Error(`Attempt to use invalid error name (${e}). Original message: ${t.message}`);if(!(t instanceof Error||/^\[object .*Error\]$/.test(Object.prototype.toString.call(t))))return new Error("Did not pass Error as second argument: "+t);const o=new n(void 0,t.message);if(o.name=e,!t.stack)try{throw t}catch(e){}return o.stack=t.stack,i&&(o.code=i),o}};var i=r(n(23)),o=r(n(6))},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(192),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.logging||(0,a.default)("Events"),n={ExceptionEvent:function(e,t,n,r,i,o,a){return new l.default(e,!1,{error:a,message:t,title:n,code:r,component:i,target:o})},IssueReportedEvent:function(e,t){return new l.default(e,!1,{issueId:t})},EnvLoadedEvent:function(e){return new l.default(e,!1)}};let r=!1;n.ConnectionEvent=function(e){function n(t,n,r){return e.call(this,t,!1,{connection:n,reason:r})||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"connections",get:function(){return r||(t.warn("OT.ConnectionEvent connections property is deprecated, use connection instead."),r=!0),[this.connection]}}]),n}(l.default);let s=!1;n.StreamEvent=function(e){function n(t,n,r,i){return e.call(this,t,i,{stream:n,reason:r})||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"streams",get:function(){return s||(t.warn("OT.StreamEvent streams property is deprecated, use stream instead."),s=!0),[this.stream]}}]),n}(l.default);let d=!1,u=!1,A=!1;return n.SessionConnectEvent=function(e){function n(t){return e.call(this,t,!1)||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"connections",get:function(){return d||(t.warn("OT.SessionConnectedEvent no longer includes connections. Listen for connectionCreated events instead."),d=!0),[]}},{key:"streams",get:function(){return u||(t.warn("OT.SessionConnectedEvent no longer includes streams. Listen for streamCreated events instead."),u=!0),[]}},{key:"archives",get:function(){return A||(t.warn("OT.SessionConnectedEvent no longer includes archives. Listen for archiveStarted events instead."),A=!0),[]}}]),n}(l.default),n.SessionReconnectingEvent=function(){return new l.default(c.default.SESSION_RECONNECTING,!1)},n.SessionReconnectedEvent=function(){return new l.default(c.default.SESSION_RECONNECTED)},n.SessionDisconnectEvent=function(e,t,n){return new l.default(e,n,{reason:t})},n.StreamPropertyChangedEvent=function(e,t,n,r,i){return new l.default(e,!1,{stream:t,changedProperty:n,oldValue:r,newValue:i})},n.VideoDimensionsChangedEvent=function(e,t,n){return new l.default("videoDimensionsChanged",!1,{target:e,oldValue:t,newValue:n})},n.ArchiveEvent=function(e,t){return new l.default(e,!1,{id:t.id,name:t.name,status:t.status,archive:t})},n.ArchiveUpdatedEvent=function(e,t,n,r){return new l.default("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},n.SignalEvent=function(e,t,n){return new l.default(e?"signal:"+e:c.default.SIGNAL,!1,{data:t,from:n})},n.CpuPerformanceChangedEvent=function(e){return new l.default("cpuPerformanceChanged",!1,{cpuPerformanceState:e})},n.QualityScoreChangedEvent=function(e){return new l.default("qualityScoreChanged",!1,{qualityScore:e})},n.CaptionReceivedEvent=function(e,t,n){return new l.default("caption",!1,{caption:e,streamId:t,isFinal:n})},n.PublisherCaptionsEnabled=function(e){return new l.default("publisherCaptionsEnabled",!1,{captionsEnabled:e})},n.MediaStreamAvailableEvent=function(e){return new l.default("mediaStreamAvailable",!1,{mediaStream:e})},n.StreamUpdatedEvent=function(e,t,n,r){return new l.default("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},n.DestroyedEvent=function(e,t,n){return new l.default(e,!1,{target:t,reason:n})},n.ConnectionStateChangedEvent=function(e,t,n){return new l.default(e,!1,{target:t,mediaMode:n})},n.VideoEnabledChangedEvent=function(e,t){return new l.default(e,!1,{reason:t.reason})},n.VideoDisableWarningEvent=function(e){return new l.default(e,!1)},n.AudioLevelUpdatedEvent=function(e){return new l.default(c.default.AUDIO_LEVEL_UPDATED,!1,{audioLevel:e})},n.AudioInputDeviceChangedEvent=function(e){return new l.default(c.default.AUDIO_INPUT_DEVICE_CHANGED,!1,{device:e})},n.MediaStoppedEvent=function(e,t){return new l.default(c.default.MEDIA_STOPPED,!0,{target:e,track:t})},n.MuteForcedEvent=function(e){return new l.default(c.default.MUTE_FORCED,!1,e)},n.VideoElementCreatedEvent=function(e){return new l.default(c.default.VIDEO_ELEMENT_CREATED,!1,{element:e})},n};var i=r(n(26)),o=r(n(24)),a=r(n(2)),l=r(n(148)),c=r(n(30))},function(e,t,n){var r=n(33),i=n(12);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(580),i=n(581),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(10)),o=r(n(77)),a=r(n(298)),l=r(n(149)),c=r(n(299)),s=r(n(2)),d=r(n(300));function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return A(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const h=(0,s.default)("SDPHelpers"),g={getSections:e=>e.split(/\r\n|\r|\n/).reduce((e,t)=>{const n=t.match(/^m=(\w+) \d+/);return n&&(e.sections[e.section=n[1]]=[]),e.sections[e.section].push(t),e},{sections:{header:[]},section:"header"}).sections,getCodecsFromSection:e=>({codecs:e[0].match(/m=\w+ \d+ [A-Z/]+ ([\d ]+)$/)[1].split(" "),codecMap:(0,i.default)(...e.filter(e=>e.match(/^a=rtpmap:\d+/)).map(e=>e.match(/^a=rtpmap:(\d+) ([\w-]+)/).splice(1)).map(e=>({[e[0]]:e[1]})))}),getCodecsAndCodecMap(e,t){const n=g.getSections(e)[t];if(!n)throw new Error("no mediaType "+t);return g.getCodecsFromSection(n)},getCodecs(e,t){const n=g.getCodecsAndCodecMap(e,t);return n.codecs.map(e=>n.codecMap[e]||"Unknown codec")},MediaDirection:d.default,iceCredentials:{ufrag:"a=ice-ufrag:",pwd:"a=ice-pwd:"},getMLineIndex:function(e,t){const n="m="+t;return(0,a.default)(e,e=>-1!==e.indexOf(n))},getMLine:function(e,t){const n=g.getMLineIndex(e,t);return n>-1?e[n]:void 0},hasMediaType:(e,t)=>{const n=new RegExp("^m="+t),r=e.split("\r\n");return(0,a.default)(r,e=>n.test(e))>=0},hasMLinePayloadType:function(e,t,n){const r=g.getMLine(e,t);return g.getMLinePayloadTypes(r,t).indexOf(n)>-1},getMLinePayloadTypes:function(e,t){const n=new RegExp(`^m=${t} \\d+(/\\d+)? [a-zA-Z0-9/]+(( [a-zA-Z0-9/]+)+)$`,"i"),r=e.match(n);return!r||r.length<2?[]:r[2].trim().split(" ")},splitSections:function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},getLinesPerSection:e=>g.splitSections(e).map(e=>g.getSDPLines(e)),replaceDirectionInSdpLines:(e,t,n)=>{const r=e.join("\r\n");return g.replaceDirection(r,t,n).split("\r\n")},replaceDirection:(e,t,n)=>{const r=new RegExp("a="+t,"g");return e.replace(r,"a="+n)},setSubscriberMediaSectionToInactive:e=>{const t=d.default.SENDONLY,n=d.default.INACTIVE;return g.replaceDirectionInSdpLines(e,t,n)},changeMediaDirection:function(e,t){const n=g.splitSections(e);let r=n.shift();const i=d.default.RECVONLY,o=d.default.INACTIVE,a=t===i?o:i;return n.forEach(e=>{const n=e.includes("m=video")?g.replaceDirection(e,a,t):e;r+=n}),r},removeTypesFromMLine:function(e,t){const n=/[0-9 ]*$/.exec(e)[0],r=n.split(" ").filter(e=>""!==e&&-1===t.indexOf(e));return e.replace(n," "+r.join(" "))},removeMediaEncoding:function(e,t,n){let r,i,o,a,l=e.split("\r\n");const c=g.getMLineIndex(l,t),s=c>-1?l[c]:void 0,d=[];if(-1===c)return l.join("\r\n");if(r=g.getMLinePayloadTypes(s,t),0===r.length)return l.join("\r\n");for(i=c;i<l.length;i++){const e=new RegExp(n,"i");0===l[i].indexOf("a=rtpmap:")&&(a=l[i].split(" "),2===a.length&&e.test(a[1])&&d.push(a[0].substr(9)))}if(!d.length)return l.join("\r\n");for(i=c;i<l.length;i++)if(0===l[i].indexOf("a=fmtp:"))for(a=l[i].split(" "),o=0;o<d.length;o++)2===a.length&&a[1]==="apt="+d[o]&&d.push(a[0].substr(7));return l=l.filter(e=>{for(let t=0;t<d.length;t++)if(0===e.indexOf(`a=rtpmap:${d[t]} `)||0===e.indexOf(`a=fmtp:${d[t]} `)||0===e.indexOf(`a=rtcp-fb:${d[t]} `))return!1;return!0}),d.length>0&&c>-1&&(l[c]=g.removeTypesFromMLine(s,d)),l.join("\r\n")},disableMediaType:function(e,t){const n=e.split("\r\n"),r=[];let i;n.forEach(e=>{let t=e;/^m=/.test(t)&&(i=void 0),i||(i=[],r.push(i)),i.push(t)});const o=new RegExp(`^m=${t} \\d+ ([^ ]+) [0-9 ]+$`),a=r.map(e=>{const n=e[0].match(o);return n?[`m=${t} 0 ${n[1]} 0`,"a=inactive",...e.filter(e=>/^c=/.test(e)||/^a=mid:/.test(e)||""===e)]:e});return[].concat(...a).join("\r\n")},removeVideoCodec:function(e,t){return g.removeMediaEncoding(e,"video",t)}},Q=function(e,t){let n=t.filterByName("ssrc-group:FID");switch(n=0===n.length?[]:n[0].value.split(" "),n.length){case 0:case 1:var r=t.find(e=>0===e.name.indexOf("rtpmap:")&&e.value.indexOf("rtx/90000")>-1);if(!r)return!1;var i=r.name.split(":")[1];return i.indexOf("/")>-1&&(i=i.split("/")[0]),g.hasMLinePayloadType(e,"video",i);default:return h.debug("SDP Helpers: There are more than two FIDs, RTX is definitely enabled"),!0}};g.getAttributesForMediaType=function(e,t){let n,r,i,a,l,c,s,d,u,A;const h=g.getMLineIndex(e,t),F=new RegExp(`m=(?!${t}).+ `,"i"),p=new RegExp("a=ssrc:\\d+ .*","i"),U=new RegExp("a=ssrc-group:(SIM|FID) (\\d+).*?","i"),m=new RegExp("a=([a-z0-9:/-]+) (.*)","i"),b=[];for(let t=h+1;t<e.length;t++){if(F.test(e[t])){void 0!==n&&(r=t-1);break}l=e[t].match(U),c=e[t].match(p),void 0===n&&(l||c)&&(n=t,l&&(a=/^(FID|SIM)$/.test(l[1])?l[2]:l[1])),s=e[t].match(`a=ssrc:${a} msid:(.+)`),s&&(d=s[1]);const o=p.test(e[t]),h=U.test(e[t]);void 0!==n&&(void 0!==r||o||h?t===e.length-1&&(r=t):r=t-1);const g=e[t].match(/a=mid:(.+)/);g&&(u=g[1],A=t),i=m.exec(e[t]),i&&3===i.length&&b.push({lineIndex:t,name:i[1],value:i[2]})}return b.ssrcStartIndex=n,b.ssrcEndIndex=r,b.msid=d,b.mid=u,b.midIndex=A,b.isUsingRTX=Q.bind(null,e,b),b.filterByName=function(e){return this.filter(t=>t.name===e)},b.getRtpNumber=e=>{const t=new RegExp("rtpmap:(.+)");return(0,o.default)(b.map(n=>{const r=n.name.match(t);return r&&n.value.indexOf(e)>=0?r[1]:null}),e=>null!==e)},b},g.modifyDtx=(e,t)=>{const n=e.split("\r\n");if(!g.getMLine(n,"audio"))return h.debug("No audio m-line, not enabling dtx."),e;const r=g.getAttributesForMediaType(n,"audio"),i=r.getRtpNumber("opus");if(!i)return h.debug("Could not find rtp number for opus, not enabling dtx."),e;const o=r.find(e=>e.name==="fmtp:"+i);if(!o)return h.debug("Could not find a=fmtp line for opus, not enabling dtx."),e;let a=n[o.lineIndex];const l=/usedtx=\d+([\s;]*)/;return l.test(o.value)?a=a.replace(l,t?"usedtx=1$1":""):t&&(a+="; usedtx=1"),a=a.replace(/[;\s]*$/,""),n[o.lineIndex]=a,n.join("\r\n")};const F=(e,t,n)=>{const r=t.split("\r\n");if(!g.getMLine(r,"audio"))return h.debug("No audio m-line, not enabling stereo."),t;const i=g.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return h.debug("Could not find rtp number for opus, not enabling stereo."),t;const a=i.find(e=>e.name==="fmtp:"+o);if(!a)return h.debug("Could not find a=fmtp line for opus, not enabling stereo."),t;let l,c=r[a.lineIndex];switch(e){case"send":l=/sprop-stereo=\d+([\s;]*)/,l.test(a.value)?c=c.replace(l,n?"sprop-stereo=1$1":""):n&&(c+="; sprop-stereo=1");break;case"receive":{l=/([^-])stereo=\d+([\s;]*)/;const e="stereo="+(n?"1":"0");l.test(a.value)?c=c.replace(l,`$1${e}$2`):c+="; "+e;break}default:throw new Error(`Invalid type ${e} passed into enableStereo`)}return c=c.replace(/[;\s]*$/,""),r[a.lineIndex]=c,r.join("\r\n")};g.modifySendStereo=F.bind(null,"send"),g.modifyReceiveStereo=F.bind(null,"receive"),g.setAudioBitrate=(e,t)=>{const n=g.getAudioBitrate(e);if(void 0!==n)return h.debug(`Audio bitrate already set to ${n}, not setting audio bitrate`),e;const r=e.split("\r\n");if(!g.getMLine(r,"audio"))return h.debug("No audio m-line, not setting audio bitrate"),e;const i=g.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return h.debug("Could not find rtp number for opus, not setting audio bitrate."),e;const a=i.find(e=>e.name==="fmtp:"+o);if(!a)return h.debug("Could not find a=fmtp line for opus, not setting audio bitrate."),e;let l=r[a.lineIndex];return l+="; maxaveragebitrate="+t,l=l.replace(/[;\s]*$/,""),r[a.lineIndex]=l,r.join("\r\n")},g.removeVideoOrientation=e=>{let t=e.split("\r\n");return t=t.filter(e=>!e.includes("urn:3gpp:video-orientation")),t.join("\r\n")},g.hasSendStereo=e=>/[\s;]sprop-stereo=1/.test(e),g.hasSendDtx=e=>/[\s;]usedtx=1/.test(e),g.hasOpusFec=e=>/[\s;]useinbandfec=1/.test(e),g.getAudioBitrate=e=>{const t=e.match(/[\s;]maxaveragebitrate=(\d+)/);if(t)return Number(t[1])},g.MAX_SSRCS=10,g.getSSRCGroupType=e=>["SIM","FID"].find(t=>e.filterByName("ssrc-group:"+t)[0]),g.getSSRCGroup=e=>{const t=g.getSSRCGroupType(e);return e.filterByName("ssrc-group:"+t)[0]},g.getSSRCGroupSSRCs=e=>{const t=g.getSSRCGroup(e);return t?t.value.split(" ").slice(0,g.MAX_SSRCS):[]},g.getAllowedSSRCs=(e,t)=>{const n=t.slice();return e.filterByName("ssrc-group:FID").forEach(e=>{const t=e.value.split(" ");(0,l.default)(n,t).length&&Array.prototype.push.apply(n,t)}),(0,c.default)(n)},g.filterExcessSSRCs=e=>{const t=e.split("\r\n"),n=g.getAttributesForMediaType(t,"video"),r=g.getSSRCGroupType(n),i=n.ssrcStartIndex;if(void 0===i)return e;let o;const a=e=>{let t=null;return e.match(/^a=ssrc:(\d+)/)&&(t=RegExp.$1),t};if(r){const e=g.getSSRCGroupSSRCs(n),i=["a=ssrc-group:"+r,...e].join(" ");t[n.find(e=>e.name.startsWith("ssrc-group:")).lineIndex]=i,o=g.getAllowedSSRCs(n,e)}else{o=[];n.ssrcStartIndex&&o.push(a(t[n.ssrcStartIndex]))}return t.filter((e,t)=>{if(t<i||t>n.ssrcEndIndex)return!0;if(t===i){if(!r){const t=a(e);return t?o.includes(t):!/^a=ssrc:(\d+)/.test(e)}return!0}const l=a(e);if(l)return o.includes(l);if(e.match(/^a=ssrc-group:FID (\d+)/)){const e=RegExp.$1;return o.includes(e)}return!e.match(/^a=ssrc-group:SIM /)}).join("\r\n")},g.enableSimulcast=function(e,t){let n,r;const i=e.split("\r\n");if(!g.getMLine(i,"video"))return h.debug("No video m-line, not enabling simulcast."),e;const o=g.getAttributesForMediaType(i,"video");if(o.filterByName("ssrc-group:SIM").length>0)return h.debug("Simulcast is already enabled in this SDP, not attempting to enable again."),g.filterExcessSSRCs(e);if(!o.msid)return h.debug("No local stream attached, not enabling simulcast."),e;const a=o.isUsingRTX(),l=[],c=[];for(r=0;r<t;++r)l.push(1e4+r),a&&c.push(2e4+r);if(n=["a=ssrc-group:SIM "+l.join(" ")],a)for(r=0;r<t;++r)n.push(`a=ssrc-group:FID ${l[r]} ${c[r]}`);for(r=0;r<t;++r)n.push(`a=ssrc:${l[r]} cname:localCname`,`a=ssrc:${l[r]} msid:${o.msid}`);if(a)for(r=0;r<t;++r)n.push(`a=ssrc:${c[r]} cname:localCname`,`a=ssrc:${c[r]} msid:${o.msid}`);return n.unshift(o.ssrcStartIndex,o.ssrcEndIndex-o.ssrcStartIndex+1),i.splice(...n),i.join("\r\n")},g.reprioritizeVideoCodec=function(e,t,n){const r=e.split("\r\n"),i=g.getMLineIndex(r,"video");if(-1===i)return e;const o=g.getMLinePayloadTypes(r[i],"video"),a=new RegExp("^a=rtpmap:(\\d+).* "+t,"i"),l=r.map(e=>e.match(a)).filter(e=>null!==e);if(0===l.length)return e;const c=l.map(e=>e[1]);let s=o.filter(e=>-1===c.indexOf(e));"top"===n?s.unshift(...c):"bottom"===n?s.push(...c):(h.error(`Unexpected location param: ${n}; not changing ${t} priority`),s=o);const d=r[i].replace(o.join(" "),s.join(" "));return r[i]=d,r.join("\r\n")},g.getSetupRole=e=>{for(var t,n=u(e.split(/\r\n|\r|\n/));!(t=n()).done;){const e=t.value.match(/^a=setup:(\w+)/);if(e)return e[1]}return""},g.setSetupRole=(e,t)=>e.split(/\r\n|\r|\n/).map(e=>e.match(/^a=setup:(\w+)/)?"a=setup:"+t:e).join("\r\n"),g.changeSetupRole=(e,t,n)=>e.split(/\r\n|\r|\n/).map(e=>e.includes("a=setup:"+t)?"a=setup:"+n:e).join("\r\n"),g.patterns={bundle:"a=group:BUNDLE",address:"c=IN IP4",rtcp:"a=rtcp:",direction:["a=inactive","a=sendonly","a=recvonly","a=sendrecv"],rsize:"a=rtcp-rsize",ssrc:"a=ssrc:",msid:"a=msid:",extension:"a=extmap:",candidate:"a=candidate:"},g.getIndexStartingWith=(e,t,n)=>{const r=e.slice(n),i=t.map(e=>r.findIndex(t=>t.includes(e))).filter(e=>e>-1);return i.length?n+Math.min(...i):e.length},g.getLastIndexPriorTo=(e,t,n)=>e.slice(0,n).map(e=>e.includes(t)).lastIndexOf(!0),g.includesAny=(e,t)=>{for(let n=0;n<t.length;n++)if(e.includes(t[n]))return!0;return!1},g.isVersionLine=e=>/^o=/.test(e),g.getVersionLine=e=>e.find(g.isVersionLine),g.getVersion=e=>{const t=g.getVersionLine(e);if(void 0===t)return;const n=Number(t.match(/ (\d+) IN /)[1]);return Number.isInteger(n)?n:void 0},g.updateVersion=(e,t,n)=>{const r=[...e],i=r.findIndex(e=>g.isVersionLine(e));return i>=0&&(r[i]=r[i].replace(` ${t} `,` ${n} `)),r},g.isBundleLine=e=>e.includes(g.patterns.bundle),g.getBundleLine=e=>e.find(g.isBundleLine),g.createBundleLine=e=>`${g.patterns.bundle} ${e.join(" ")}`,g.updateBundleLine=(e,t)=>{const n=[...e],r=g.createBundleLine(t),i=n.findIndex(e=>g.isBundleLine(e));return i>=0&&(n[i]=r),n},g.parseMLine=e=>{const t=e.match(/^(m=(?:audio|video)) (\d+) (.+)/),n=t[1];return{port:t[2],transport:t[3],mediaType:n}},g.disableTrack=e=>{const t=g.parseMLine(e);return`${t.mediaType} 0 ${t.transport}`},g.isDisabledMediaSection=e=>{let t=e[0];return/^m=(?:video|audio) 0 RTP\/SAVPF 0/.test(t)},g.getDisabledSectionForMid=e=>[`m=${e.includes("a")?"audio":"video"} 0 RTP/SAVPF 0`],g.getEnabledTracks=e=>g.getBundleLine(e).match(new RegExp(`^${g.patterns.bundle} (.+)$`))[1].split(" "),g.getDisabledTracks=(e,t)=>e.filter(e=>!t.includes(e)),g.getTrackSection=(e,t)=>{const n=e.findIndex(e=>e.includes("a=mid:"+t)),r=t.includes("a")?"audio":"video",i=g.getLastIndexPriorTo(e,"m="+r,n),o=g.getIndexStartingWith(e,["m=audio","m=video"],n),a=e.slice(i,o);return{mid:t,sdp:a}},g.getHeaders=e=>{const t=e.findIndex(e=>e.includes("m=audio")||e.includes("m=video"));return e.slice(0,t)},g.getSDPLines=e=>e.split("\r\n").filter(e=>e),g.getTrackMids=e=>e.filter(e=>e.match(new RegExp("^a=mid:\\d+"))).map(e=>e.substring("a=mid:".length)),g.getTrackSections=e=>g.getTrackMids(e).map(t=>g.getTrackSection(e,t)),g.parseMantisSDP=e=>{const t=g.changeSetupRole(e,"actpass","passive");return g.parseSDP(t)},g.isMediaSectionDisabled=e=>{const t=g.parseMLine(e[0]).port;return 0===parseInt(t,10)},g.getSectionMid=e=>g.isMediaSectionDisabled(e)?null:g.getTrackMids(e)[0],g.parseSDP=e=>{const t=g.getLinesPerSection(e),n=t[0],r=t.slice(1);return{bundle:g.getBundleLine(n),version:g.getVersion(n),iceCredentials:g.getIceCredentials(n),tracks:g.getEnabledTracks(n),mediaSections:r,mids:r.map(g.getSectionMid),headers:n}},g.createSDP=(e,t)=>{const n=[...e];return t.forEach(e=>n.push(...e)),n.push(""),n.join("\r\n")},g.updateSDPWithNewOffer=(e,t)=>{const n=e.headers,r=e.version,i=e.mediaSections,o=g.getSDPLines(t),a=g.getVersion(o),l=g.getEnabledTracks(o),c={version:a,tracks:l,headers:g.updateBundleLine(g.updateVersion(n,r,a),l),mediaSections:g.disableTrackSections(l,i)};return c.mids=c.mediaSections.map(g.getSectionMid),c},g.isUfragLine=e=>e.includes(g.iceCredentials.ufrag),g.isPwdLine=e=>e.includes(g.iceCredentials.pwd),g.getIceCredentials=e=>{const t={};return e.forEach(e=>{g.isUfragLine(e)?t.ufrag=e:g.isPwdLine(e)&&(t.pwd=e)}),t},g.isExtensionLine=e=>e.includes(g.patterns.extension),g.getExtensions=e=>e.filter(g.isExtensionLine),g.updateIceCredentials=(e,t)=>e.map(e=>g.isUfragLine(e)?t.ufrag:g.isPwdLine(e)?t.pwd:e),g.isCandidateLine=e=>e.includes(g.patterns.candidate),g.updateCandidates=(e,t)=>{const n=e.some(g.isCandidateLine);let r=[...e];if(n){const e=t.filter(g.isCandidateLine);r=r.filter(e=>!g.isCandidateLine(e));const n=r.findIndex(e=>"a=end-of-candidates"===e);r.splice(n,0,...e)}return r},g.addIceCredentialsToSection=(e,t)=>{let n=t.ufrag,r=t.pwd;const i=[...e],o=i.findIndex(e=>e.startsWith("a=mid:"));return o>=0&&i.splice(o,0,n,r),i},g.addIceCandidatesToSection=(e,t)=>{const n=[...e],r=t.filter(e=>e.startsWith("a=candidate:")||"a=end-of-candidates"===e),i=n.findIndex(e=>e.startsWith("a=mid:"));return i>=0&&r.length&&n.splice(i,0,...r),n},g.addIceConfig=(e,t,n)=>{const r=[...e],i=e[0];if(!g.getIceCredentials(i).ufrag){const e=g.addIceCredentialsToSection(i,n);r[0]=g.addIceCandidatesToSection(e,t)}return r},g.updateHeadersInPartialSdp=(e,t,n)=>{if(!e.headers.length)return g.updateBundleLine(t.headers,n);let r=g.updateBundleLine(e.headers,n);return r=g.updateVersion(r,e.version,t.version),e.iceCredentials.ufrag!==t.iceCredentials.ufrag&&(r=g.updateIceCredentials(r,t.iceCredentials)),r},g.updateFirstEnabledMediaSection=(e,t)=>{const n=[...e.mediaSections],r=e.mids.findIndex(e=>null!==e);if(r>=0){const i=g.updateIceCredentials(n[r],t);n[r]=g.updateCandidates(i,e.headers)}return n};var p=g;t.default=p},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),a=r(n(3)),l=r(n(108)),c=r(n(263)),s=r(n(571));var d=function(t){void 0===t&&(t={});const n=t.getNativeEnumerateDevices||(0,c.default)(),r=t.getNativeMediaDevices||(0,s.default)(),d=(t.currentAudioOutputDevice||l.default).getCurrentAudioOutputDeviceId,u=t.env||a.default,A=t.global||(void 0!==typeof window?window:global),h={},g={audio:"audioInput",video:"videoInput",audioinput:"audioInput",videoinput:"videoInput",audiooutput:"audioOutput",audioInput:"audioInput",videoInput:"videoInput",audioOutput:"audioOutput"};return h.getNativeMediaDevices=()=>r(),h.hasEnumerateDevicesCapability=()=>"function"==typeof n(),h.hasDeviceChangeCapability=()=>{const e=r();return!(!e||!("ondevicechange"in e))},h.hasSetSinkIdCapability=()=>"setSinkId"in(null==A?void 0:A.HTMLMediaElement.prototype),h.hasAudioOutputApiSupport=()=>{const e=t.hasSetSinkIdCapability,n=void 0===e?h.hasSetSinkIdCapability:e,r=t.hasDeviceChangeCapability,i=void 0===r?h.hasDeviceChangeCapability:r;return n()&&i()},h.hasEnumerateDevicesBug=()=>u.isSafari&&13.1===u.version,h.getMediaDevices=()=>h.hasEnumerateDevicesCapability()?n()().then(e=>e.map(e=>({deviceId:e.deviceId||e.id,label:e.label,kind:g[e.kind]}))):e.reject(new Error("This browser does not support enumerateDevices APIs")),h.getInputMediaDevices=()=>h.getMediaDevices().then(e=>e.filter(e=>/^(audio|video)Input$/.test(e.kind))),h.getAudioOutputMediaDevices=()=>h.getMediaDevices().then(e=>e.filter(e=>"audioOutput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),h.getAudioInputMediaDevices=()=>h.getMediaDevices().then(e=>e.filter(e=>"audioInput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),h.shouldAskForDevices=()=>h.hasEnumerateDevicesCapability()?h.getInputMediaDevices().then(e=>{if(0===e.length)return{video:!0,audio:!0};const t=e.filter(e=>"audioInput"===e.kind),n=e.filter(e=>"videoInput"===e.kind);return h.hasEnumerateDevicesBug()&&0===n.length?{audio:!0,video:!0}:{video:n.length>0,audio:t.length>0,videoDevices:n,audioDevices:t}}).catch(()=>({video:!0,audio:!0})):e.resolve({video:!0,audio:!0}),h.getDefaultAudioOutputDeviceId=e=>{if(!Array.isArray(e)||0===e.length)return"";return(e.find(e=>"default"===e.deviceId)||e[0]).deviceId},h.hasDevice=(e,t)=>{let n=e;return Array.isArray(n)||(n=[]),n.some(e=>e.deviceId===t)},h.getActiveAudioOutputDevice=(0,o.default)(i.default.mark((function e(){var t,n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,h.getAudioOutputMediaDevices();case 3:t=e.sent,e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(0),e.t0;case 9:if(0!==t.length){e.next=11;break}return e.abrupt("return",{deviceId:null,label:null});case 11:return(n=t.find(e=>e.deviceId===d()))||(r=h.getDefaultAudioOutputDeviceId(t),n=t.find(e=>e.deviceId===r)),e.abrupt("return",n);case 14:case"end":return e.stop()}}),e,null,[[0,6]])}))),h};t.default=d}).call(this,n(1))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(7)),o=r(n(2)),a=r(n(17)),l=r(n(30)),c=r(n(585));const s=(0,o.default)("GlobalExceptionHandler"),d=(0,a.default)(),u=function(e,t){Error.call(this),this.code=e,this.message=t};(u.prototype=Object.create(Error.prototype)).constructor=u,(0,i.default)(u),u.getTitleByCode=function(e){return c.default[+e]},u.handleJsException=e=>{let t=e.error,n=e.errorMsg,r=e.code,i=e.target,o=e.analytics;if(!i)throw new Error("handleJsException requires target");const a=()=>void 0!==r?r:t&&t.code,c=()=>void 0!==n?n:t&&t.message,A=u.getTitleByCode(a());s.error(`OT.exception :: title: ${A} (${a()}) msg: ${c()}`);try{const e={partnerId:i.session?i.session.apiKey:i.apiKey,sessionId:i.session?i.session.sessionId:i.sessionId};o.logError(a(),"tb.exception",A,{details:c()},e);const n=new d.ExceptionEvent(l.default.EXCEPTION,c(),A,a(),i,i,t);if(t)n.stack=t.stack;else try{throw new Error}catch(e){n.stack=e.stack}u.dispatchEvent(n)}catch(e){s.error("OT.exception :: Failed to dispatch exception - "+e.toString())}};var A=u;t.default=A},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(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:a}catch(e){r=a}}();var c,s=[],d=!1,u=-1;function A(){d&&c&&(d=!1,c.length?s=c.concat(s):u=-1,s.length&&h())}function h(){if(!d){var e=l(A);d=!0;for(var t=s.length;t;){for(c=s,s=[];++u<t;)c&&c[u].run();u=-1,t=s.length}c=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!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 g(e,t){this.fun=e,this.array=t}function Q(){}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];s.push(new g(e,t)),1!==s.length||d||l(h)},g.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=Q,i.addListener=Q,i.once=Q,i.off=Q,i.removeListener=Q,i.removeAllListeners=Q,i.emit=Q,i.prependListener=Q,i.prependOnceListener=Q,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){function n(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)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(272));var o={publishers:new i.default("guid"),subscribers:new i.default("widgetId"),sessions:new i.default};t.default=o},function(e,t,n){"use strict";t.__esModule=!0,t.MEDIUM=t.LOW=t.CongestionLevels=t.CRITICAL=void 0;t.CRITICAL=2;t.MEDIUM=1;t.LOW=0;const r={CRITICAL:2,MEDIUM:1,LOW:0};t.CongestionLevels=r},function(e,t,n){var r=n(18),i=n(120);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default={ACTIVE:"active",INACTIVE:"inactive",UNKNOWN:"unknown",PER_SESSION:"perSession",PER_STREAM:"perStream",EXCEPTION:"exception",ISSUE_REPORTED:"issueReported",SESSION_CONNECTED:"sessionConnected",SESSION_RECONNECTING:"sessionReconnecting",SESSION_RECONNECTED:"sessionReconnected",SESSION_DISCONNECTED:"sessionDisconnected",STREAM_CREATED:"streamCreated",STREAM_DESTROYED:"streamDestroyed",CONNECTION_CREATED:"connectionCreated",CONNECTION_DESTROYED:"connectionDestroyed",SIGNAL:"signal",STREAM_PROPERTY_CHANGED:"streamPropertyChanged",MICROPHONE_LEVEL_CHANGED:"microphoneLevelChanged",RESIZE:"resize",SETTINGS_BUTTON_CLICK:"settingsButtonClick",DEVICE_INACTIVE:"deviceInactive",INVALID_DEVICE_NAME:"invalidDeviceName",ACCESS_ALLOWED:"accessAllowed",ACCESS_DENIED:"accessDenied",ACCESS_DIALOG_OPENED:"accessDialogOpened",ACCESS_DIALOG_CLOSED:"accessDialogClosed",AUDIO_INPUT_DEVICE_CHANGED:"audioInputDeviceChanged",ECHO_CANCELLATION_MODE_CHANGED:"echoCancellationModeChanged",MEDIA_STOPPED:"mediaStopped",PUBLISHER_DESTROYED:"destroyed",MUTE_FORCED:"muteForced",SUBSCRIBER_DESTROYED:"destroyed",SUBSCRIBER_CONNECTED:"connected",SUBSCRIBER_DISCONNECTED:"disconnected",SUBSCRIBER_CAPTION_RECEIVED:"captionReceived",DEVICES_DETECTED:"devicesDetected",DEVICES_SELECTED:"devicesSelected",CLOSE_BUTTON_CLICK:"closeButtonClick",MICLEVEL:"microphoneActivityLevel",MICGAINCHANGED:"microphoneGainChanged",ENV_LOADED:"envLoaded",ENV_UNLOADED:"envUnloaded",AUDIO_LEVEL_UPDATED:"audioLevelUpdated",VIDEO_ELEMENT_CREATED:"videoElementCreated"}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),a=r(n(26)),l=r(n(7)),c=r(n(273)),s=r(n(269)),d=r(n(152)),u=r(n(48)),A=r(n(586)),h=r(n(588)),g=r(n(591)),Q=r(n(592));const F=(0,u.default)();let p=function(){function e(e){let t=void 0===e?{}:e,n=t.staticConfig,r=void 0===n?F.onlyLocal():n,i=t.sessionInfo,o=void 0===i?new d.default:i,a=t.ajax,l=t.queue,c=t.getUserAgentClientHintData,s=void 0===c?g.default:c,u=t.userAgentData,A=void 0===u?"undefined"!=typeof navigator&&navigator.userAgentData:u;this.getTurnServerName=e=>{let t,n;if(!e||"object"!=typeof e)return t;return(Array.isArray(e)?e:[e]).forEach(e=>{const r=e.urls||e.url;(Array.isArray(r)?r:[r]).forEach(e=>{const r=e.indexOf(":")+1,i=e.lastIndexOf(":");e.includes("turns")?n=e.substring(r,i):t=e.substring(r,i)})}),n||t},this.ajax=a,this.queue=l,this.sessionInfo=o,this.getUserAgentClientHintData=s,this.userAgentData=A,this.staticConfig=r}var t=e.prototype;return t._getCachedUserAgentData=function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.cachedUserAgentData){e.next=4;break}return e.next=3,this.getUserAgentClientHintData(this.userAgentData);case 3:this.cachedUserAgentData=e.sent;case 4:return e.abrupt("return",this.cachedUserAgentData);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),e._getSourceUrl=function(){var e;return null==(e=(void 0!==typeof window?window:global).location)?void 0:e.href},t.commonQoSFields=function(){const t=this._analytics.proxyUrl,n=this.sessionInfo.messagingURL,r=e._getSourceUrl();return{clientVersion:this.staticConfig.clientVersion,buildHash:this.staticConfig.buildHash,source:(0,Q.default)(r),logVersion:"2",apiServer:this.staticConfig.apiUrl,clientSystemTime:(new Date).getTime(),sessionId:this.sessionInfo.sessionId,mediaServerName:this.sessionInfo.mediaServerName,relayServer:this.getTurnServerName(this.sessionInfo.iceServers),p2p:this.sessionInfo.p2pEnabled,messagingServer:this.sessionInfo.messagingServer,messagingUrl:(0,A.default)(t,n),version:this.staticConfig.version,partnerId:this.sessionInfo.partnerId}},t._getCommonDataFields=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.default.getAsync();case 2:return t=e.sent,e.next=5,this._getCachedUserAgentData();case 5:return n=e.sent,e.abrupt("return",Object.assign({guid:t},this.commonQoSFields(),n));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.logError=function(t,n,r,i,o){void 0===o&&(o={}),this._getCommonDataFields().then(a=>{const l=[t,n,r,i,Object.assign({},a,o)];e.emit("logError",...l),this._analytics.logError(...l)})},t.logEvent=function(t,n,r){void 0===t&&(t={}),this._getCommonDataFields().then(i=>{const o=Object.assign({},i,t);e.emit("logEvent",o),this._analytics.logEvent(o,!1,n,r)})},t.logQOS=function(t){void 0===t&&(t={}),this._getCommonDataFields().then(n=>{const r=Object.assign({duration:0},n,t);(0,h.default)(r),e.emit("logQOS",r),this._analytics.logQOS(r)})},(0,a.default)(e,[{key:"staticConfig",get:function(){return this._staticConfig},set:function(e){this._staticConfig=e,this._analytics=new s.default({loggingUrl:this.staticConfig.loggingUrl,ajax:this.ajax,queue:this.queue})}}]),e}();t.default=p,(0,l.default)(p),e.exports=p},function(e,t,n){"use strict";var r=!0,i=!0;function o(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}e.exports={extractVersion:o,wrapPeerConnectionEvent:function(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var o=function(e){var t=n(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);var r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(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})}},disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(i=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){i&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=o(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)n.browser="chrome",n.version=o(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=o(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=o(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return n}}},function(e,t,n){var r=n(43),i=n(382),o=n(383),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(196),i=n(122),o=n(29);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){"use strict";var r=n(46);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var r=n(59),i=n(217),o=n(133),a=n(218),l=n(219);(e.exports=function(e,t){var n,i,c,s,d;return arguments.length<2||"string"!=typeof e?(s=t,t=e,e=null):s=arguments[2],r(e)?(n=l.call(e,"c"),i=l.call(e,"e"),c=l.call(e,"w")):(n=c=!0,i=!1),d={value:t,configurable:n,enumerable:i,writable:c},s?o(a(s),d):d}).gs=function(e,t,n){var c,s,d,u;return"string"!=typeof e?(d=n,n=t,t=e,e=null):d=arguments[3],r(t)?i(t)?r(n)?i(n)||(d=n,n=void 0):n=void 0:(d=t,t=n=void 0):t=void 0,r(e)?(c=l.call(e,"c"),s=l.call(e,"e")):(c=!0,s=!1),u={get:t,set:n,configurable:c,enumerable:s},d?o(a(d),u):u}},function(e,t,n){var r=n(538),i=n(546),o=n(92),a=n(15),l=n(551);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):l(e)}},function(e,t){e.exports=function(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(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={SDK:"sdk",SDK_RAW:"sdk_raw",WATCH_AUDIO_ACQUISITION:"watch_audio_acquisition",TEST_ONLY_GET_FRAMES_ENCODED:"test_only_get_frames_encoded",CONGESTION_LEVEL:"congestion_level",NETWORK_QUALITY:"network_quality",SENDER_SIDE_STATS:"sender_side_stats",MOS_SCORE:"mos_score",QOS:"qos",SUBSCRIBER_AUDIO_WATCHER:"subscriber_audio_watcher",SUBSCRIBER_VIDEO_WATCHER:"subscriber_video_watcher",PUBLISHER_VIDEO_WATCHER:"publisher_video_watcher"};t.default=r},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e,t){let n;const r=t||{};e.setDisplayMode=function(e){const t=e||"auto";n!==t&&(i.default.removeClass(this.domElement,"OT_mode-"+n),i.default.addClass(this.domElement,"OT_mode-"+t),n=t)},e.getDisplayMode=function(){return n},e.showAfterLoading=function(){i.default.removeClass(this.domElement,"OT_hide-forced")},e.hideWhileLoading=function(){i.default.addClass(this.domElement,"OT_hide-forced")},e.destroy=function(){return r.onDestroy&&r.onDestroy(this.domElement),this.domElement&&i.default.removeElement(this.domElement),e},e.appendTo=function(t){return this.domElement=i.default.createElement(r.nodeName||"div",r.htmlAttributes,r.htmlContent),r.onCreate&&r.onCreate(this.domElement),e.setDisplayMode(r.mode),"auto"===r.mode&&(i.default.addClass(e.domElement,"OT_mode-on-hold"),setTimeout(()=>{i.default.removeClass(e.domElement,"OT_mode-on-hold")},2e3)),t.appendChild(this.domElement),e}};var i=r(n(8))},function(e,t,n){var r=n(81);e.exports=function(e){return r(e,4)}},function(e,t,n){var r=n(381),i=n(386);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(16).Symbol;e.exports=r},function(e,t,n){var r=n(87),i=n(65);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var l=-1,c=t.length;++l<c;){var s=t[l],d=o?o(n[s],e[s],s,n,e):void 0;void 0===d&&(d=e[s]),a?i(n,s,d):r(n,s,d)}return n}},function(e,t,n){var r=n(410),i=n(117),o=n(411),a=n(204),l=n(205),c=n(33),s=n(193),d=s(r),u=s(i),A=s(o),h=s(a),g=s(l),Q=c;(r&&"[object DataView]"!=Q(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=Q(new i)||o&&"[object Promise]"!=Q(o.resolve())||a&&"[object Set]"!=Q(new a)||l&&"[object WeakMap]"!=Q(new l))&&(Q=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?s(n):"";if(r)switch(r){case d:return"[object DataView]";case u:return"[object Map]";case A:return"[object Promise]";case h:return"[object Set]";case g:return"[object WeakMap]"}return t}),e.exports=Q},function(e,t,n){"use strict";var r=n(431)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";e.exports=n(445)()?n(95).Symbol:n(448)},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(26)),o=r(n(224)),a=r(n(509)),l=r(n(560)),c=r(n(64)),s=r(n(2)),d=r(n(107));const u=(0,s.default)("StaticConfig"),A=(0,l.default)(["apiURL","assetURL","cdnURL","sessionInfoOverrides","loggingURL"]),h={apiUrl:"apiURL",loggingUrl:"loggingURL"},g=(0,a.default)(e=>h[e]);var Q=function(t){let n=void 0===t?{}:t,r=n.axios,a=void 0===r?o.default:r,l=n.properties,s=void 0===l?{version:"v2.33.0",buildHash:"a2a5318be",minimumVersion:{firefox:52,chrome:49},debug:!1,websiteURL:"http://www.tokbox.com",configURL:"https://config.opentok.com",ipWhitelistConfigURL:"",cdnURL:"",loggingURL:"https://hlg.tokbox.com/prod",apiURL:"https://anvil.opentok.com",vonageApiURL:""}:l;const h=(0,c.default)(s);return function(){function t(e){Object.defineProperty(this,"config",{value:Object.freeze((0,c.default)(e))})}return t.onlyLocal=function(e){void 0===e&&(e=!0),!e&&s.vonageApiURL&&(h.apiURL=s.vonageApiURL);const n=(0,c.default)((void 0!==typeof window?window:global).OTProperties);return new t(Object.assign({},h,A(n)))},t.get=function(n){let r=n.partnerId,i=n.token,o=n.useIpWhitelistConfigUrl,l=n.proxyUrl;return(()=>{const t=this.onlyLocal();if(!t.configUrl)return e.resolve({});if(!0===o&&!t.ipWhitelistConfigUrl)return e.resolve({});let n=!0===o?t.ipWhitelistConfigUrl:t.configUrl;return n=(0,d.default)(n,l),a.get(`${n}/project/${r}/config.json`,{headers:{"X-TB-TOKEN-AUTH":i}}).then(e=>e.data)})().then(e=>{const n=(0,c.default)((void 0!==typeof window?window:global).OTProperties);return new t(Object.assign({},h,A(n),g(e)))}).catch(t=>(u.error("could not reach Config Service",t),e.reject(new Error("could not reach Config Service"))))},(0,i.default)(t,[{key:"configUrl",get:function(){return this.config.configURL}},{key:"ipWhitelistConfigUrl",get:function(){return this.config.ipWhitelistConfigURL}},{key:"apiUrl",get:function(){return this.config.apiURL}},{key:"loggingUrl",get:function(){return this.config.loggingURL}},{key:"apiEnabled",get:function(){return void 0===this.config.apiEnabled||this.config.apiEnabled}},{key:"version",get:function(){return this.config.version}},{key:"clientVersion",get:function(){return"js-"+(this.version||"unknown").replace("v","")}},{key:"buildHash",get:function(){return this.config.buildHash}},{key:"minimumVersion",get:function(){return this.config.minimumVersion}},{key:"websiteUrl",get:function(){return this.config.websiteURL}},{key:"debug",get:function(){return"true"===this.config.debug||!0===this.config.debug}},{key:"sessionInfoOverrides",get:function(){return this.config.sessionInfoOverrides}},{key:"cdnUrl",get:function(){return this.config.cdnURL||`${(void 0!==typeof window?window:global).location.protocol}//${(void 0!==typeof window?window:global).location.host}`}},{key:"assetUrl",get:function(){return this.config.assetURL||`${this.cdnUrl}/webrtc/${this.version}`}}]),t}()};t.default=Q}).call(this,n(1))},function(e,t,n){"use strict";var r=n(13);function i(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){a[e]={value:e}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,n,a,l,c){var s=Object.create(o);return r.toFlatObject(e,s,(function(e){return e!==Error.prototype})),i.call(s,e.message,t,n,a,l),s.cause=e,s.name=e.name,c&&Object.assign(s,c),s},e.exports=i},function(e,t,n){var r=n(72);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(561),i=n(144)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){if(r.now)return r.timing.navigationStart+r.now();return Date.now()};const r=(void 0!==typeof window?window:global).performance||{}},function(e,t,n){var r=n(628);e.exports=function(e){return r(2,e)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(53)),o=r(n(636)),a=r(n(3)),l=r(n(637));const c=function(e){void 0===e&&(e={});const t=e.env||a.default,n=e.hasGetUserMediaCapability||o.default,r=e.hasPeerConnectionCapability||l.default;return"Node"===t.name||n()&&r()},s=(0,i.default)(()=>c());var d={check:c,once:s};t.default=d},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(196),i=n(405),o=n(29);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){var r=n(118);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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 a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){const t=[];return{on(n,r){for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];if(t.push({eventName:n,handler:r,args:o}),e.on)e.on(n,r);else{if(!e.addEventListener)throw new Error("Object does not support events",e);e.addEventListener(n,r,...o)}},off(t,n){if(e.off)e.off(t,n);else{if(!e.removeEventListener)throw new Error("Object does not support events",e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];e.removeEventListener(t,n,...i)}},once(n,r){for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];t.push({eventName:n,handler:r,args:o}),e.once(n,r)},removeAll(){t.forEach(e=>{let t=e.eventName,n=e.handler,r=e.args;this.off(t,n,...r)}),t.splice(0,t.length)}}}},function(e,t,n){var r=n(105);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){var r=n(15),i=n(143),o=n(257),a=n(63);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,n){var r=n(548);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(81);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(194);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(400),i=n(19),o=Object.prototype,a=o.hasOwnProperty,l=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!l.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){var r=n(16),i=n(401),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,l=a&&a.exports===o?r.Buffer:void 0,c=(l?l.isBuffer:void 0)||i;e.exports=c}).call(this,n(88)(e))},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){var r=n(33),i=n(19);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.getProxyUrl=t.errorMessages=t.clearProxyUrl=void 0,t.setProxyUrl=function(e){const t=n(31),r=s.default,A=new t,h=a.default.sessions.length()>0,g=a.default.publishers.length()>0;let Q;if(h){const e=a.default.sessions.find(e=>"connected"===e.currentState);Q=e?e.sessionId:a.default.sessions.find().sessionId}else Q="";const F={sessionId:Q,apiKey:r.value};if(g||h){const e=(0,l.default)()(c.default.SET_PROXY_URL_TIMING_ERROR,new Error(u.SET_PROXY_URL_TIMING_ERROR),i.default.SET_PROXY_URL_TIMING_ERROR);o.default.handleJsException({error:e,target:F,analytics:A})}else if(d){const e=(0,l.default)()(c.default.PROXY_URL_ALREADY_SET_ERROR,new Error(u.PROXY_URL_ALREADY_SET_ERROR),i.default.PROXY_URL_ALREADY_SET_ERROR);o.default.handleJsException({error:e,target:F,analytics:A})}else d=e};var i=r(n(9)),o=r(n(23)),a=r(n(27)),l=r(n(14)),c=r(n(6)),s=r(n(74));let d;const u={SET_PROXY_URL_TIMING_ERROR:"The proxyUrl was set after a session or publisher was created.",PROXY_URL_ALREADY_SET_ERROR:"The proxyUrl has already been set. Setting it again will not have any effect."};t.errorMessages=u;t.getProxyUrl=()=>d;t.clearProxyUrl=()=>{d=null}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i,o=r(n(8));let a;if("Node"===(null==o.default||null==(i=o.default.env)?void 0:i.name))a="";else{var l,c;const e=null==(l=Array.prototype.slice.call(document.getElementsByTagName("script")))||null==(c=l.pop())?void 0:c.getAttribute("src");a=(e&&e.match(/[?&]apikey=([^&]+)/i)||[])[1]||""}var s={value:a};t.default=s},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t,n){void 0===n&&(n=1/0);let r=null,i=!1,o=1;const a=1e3/t,l=()=>{!i||o>n||(o+=1,e(),r=setTimeout(l,a))};this.start=()=>{i||(i=!0,setTimeout(l,a))},this.stop=()=>{(void 0!==typeof window?window:global).clearTimeout(r),i=!1}}},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});const n=t.hasValidPeerConnection||f.default,r=t.applySdpTransform||R.default,x=t.createPeerConnection||I.default,M=t.env||Q.default,H=t.sdpTransformDefaults||y.default,K=t.getSynchronizationSources||V.default,L=t.IceCandidateProcessor||C.default,z=t.logging||g.default,O=t.offerProcessor||W.default,j=t.PeerConnectionChannels||E.default,P=t.subscribeProcessor||S.default,_=v.default,q=t.changeMediaDirection||J.default,$=q.changeMediaDirectionToInactive,ee=q.changeMediaDirectionToRecvOnly,te=t.StatsCache||N.default,ne=t.Qos||G.default,re=t.global||(void 0!==typeof window?window:global),ie=t.debounce||d.default,oe=t.needsToSwapH264Profiles||X.default.once,ae=(0,Z.default)(),le=t.NativeRTCIceCandidate||re.RTCIceCandidate,ce=t.NativeRTCSessionDescription||re.RTCSessionDescription,se=t.Errors||k.default,de=t.OTErrorClass||p.default,ue=t.ExceptionCodes||F.default,Ae=t.hasPictureInPictureBug||T.default,he=t.createRtcStatsReportParser||D.default,ge=()=>{};return function(t){void 0===t&&(t={});let d=!1;const g=t,Q=g.iceConfig,F=void 0===Q?{servers:[]}:Q,p=g.isPublisher,Z=g.offerOverrides,f=g.answerOverrides,R=g.p2p,I=g.codecFlags,y=g.sourceStreamId,V=g.keyStore,C=g.sFrameClientStore,W=g.isE2ee,E=g.sessionId,S=g.preferredVideoCodecs;let v,J=t,N=J.logAnalyticsEvent,G=void 0===N?ge:N,X=J.sendMessage,k=!1;const T=oe();let D,q,Qe=0,Fe=!1,pe={};const Ue=he(),me=new _(G),be=(0,m.default)();function Be(e,t){if(!d){if(["candidate","offer","answer","pranswer"].indexOf(e)>-1){const n="candidate"===e?t.candidate:t.sdp;d=-1!==n.indexOf("typ relay")}}X(e,t)}const Ze=(0,Y.default)();G("createPeerConnection","Attempt");const fe={};fe.id=(0,A.default)();const Re=z("PeerConnection:"+fe.id);Re.debug("construct",{id:fe.id,options:t});const Ie=H,ye=(0,u.default)(t,["isPublisher","logAnalyticsEvent","offerOverrides","answerOverrides","sendMessage"]);let Ve,Ce,We,Ee,Se,ve=[];const Je=()=>{var e;if(M.isLegacyElectron||M.isLegacyFirefox||M.isAndroidWebView&&M.version<139)return;if(null==(e=Ve)||!e.getTransceivers)return;const t=(null!=S&&S.length?S:[]).concat("vp8"),n=null==window.RTCRtpSender.getCapabilities?void 0:window.RTCRtpSender.getCapabilities("video");if(!n||!Array.isArray(n.codecs))return;const r=e=>String(e).split("/").pop().toUpperCase(),i=t.map(r),o=new Array(i.length),a=[];n.codecs.forEach(e=>{const t=i.indexOf((e=>r(e.mimeType||e.name||""))(e));t>-1?(o[t]||(o[t]=[])).push(e):a.push(e)});const l=o.filter(Boolean).flat().concat(a);Ve.getTransceivers().filter(e=>{var t,n;return"video"===(null==e||null==(t=e.sender)||null==(n=t.track)?void 0:n.kind)&&"function"==typeof e.setCodecPreferences}).forEach(e=>{try{e.setCodecPreferences(l)}catch(t){const n=l.filter(e=>/^video\//i.test(e.mimeType||"")&&!/\/(rtx|red|ulpfec)$/i.test(e.mimeType||""));n.length&&e.setCodecPreferences(n)}})},Ne=(()=>{let e=ye.overrideSimulcastEnabled||!1;return{get:()=>e,set(t){const n=Boolean(t)&&ye.capableSimulcastStreams>1;n!==e&&void 0===ye.overrideSimulcastEnabled&&(e=n,fe.generateOfferAndSend())}}})();let Ge;const Xe=()=>{Ge&&(clearTimeout(Ge),Ge=null)},ke=(()=>{let e=!1;return{get:()=>e,set(t){const n=Boolean(t);n!==e&&(e=n,e?(Xe(),fe.iceConnectionStateIsConnected()?(Re.debug("iceRestart is going to wait until we disconnect or negotiationNeeded and then restart ice"),Ge=setTimeout(()=>{ke.set(!1)},1e4)):_e()):(Xe(),_e.cancel()))},run:()=>(e&&(Xe(),_e()),e)}})(),Te={clean(){delete this.promise,delete this.resolve,delete this.reject}};Te.promise=new e((e,t)=>{Te.resolve=e,Te.reject=t});let Ye=new L,we="new";Object.defineProperty(fe,"signalingState",{get:()=>Ve.signalingState,set:e=>(Ve.signalingState=e,e)}),(0,h.default)(fe),fe.addOptions=e=>{G=e.logAnalyticsEvent},fe.startEncryption=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,ae({sessionId:E,connectionId:t});case 4:return n=e.sent,e.next=7,C.createSender(n);case 7:return D=e.sent,e.next=10,V.get();case 10:return r=e.sent,e.next=13,D.setSenderEncryptionKey(r);case 13:q=e=>{D.setSenderEncryptionKey(e)},V.on("keyChanged",q),Ve.getTransceivers().forEach(function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D.encrypt(n,t.sender);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),fe.once("iceConnected",(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"",t={pcc:parseInt((0,Y.default)()-Ze,10),hasRelayCandidates:d,proxyInfo:""},Ve&&Ve.proxyInfo&&(t.proxyInfo=Ve.proxyInfo),G("createPeerConnection","Success",t);case 4:case"end":return e.stop()}}),e)})))),fe.startDecryption=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(fe.iceConnectionStateIsConnected()){e.next=3;break}return fe.once("iceConnected",()=>fe.startDecryption(t,n)),e.abrupt("return");case 3:return e.next=5,ae({sessionId:E,connectionId:t});case 5:return r=e.sent,o=n.receiver,e.next=9,De(r);case 9:return a=e.sent,e.prev=10,e.next=13,null==a?void 0:a.decrypt(r,o);case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(10),Re.error(e.t0);case 18:case"end":return e.stop()}}),e,null,[[10,15]])})));return function(t,n){return e.apply(this,arguments)}}(),Te.resolve();const De=function(){var t=(0,o.default)(i.default.mark((function t(n){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!pe[n]){t.next=2;break}return t.abrupt("return",pe[n]);case 2:return pe[n]=new e(function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,V.get();case 2:if(r=e.sent,o=C.getReceiver(n)){e.next=9;break}return e.next=7,C.createReceiver(n);case 7:(o=e.sent).addReceiver(n);case 9:o.setReceiverEncryptionKey(n,r),V.on("keyChanged",e=>{o.setReceiverEncryptionKey(n,e)}),o.addEventListener("decryptFailed",()=>{fe.trigger("decryptFailed")}),o.addEventListener("decryptionRestored",()=>{fe.trigger("decryptRestored")}),t(o);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.abrupt("return",pe[n]);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),xe=e=>{if(Re.debug("internalCreatePeerConnection: called"),Ve)return Re.debug("internalCreatePeerConnection: resolving synchronously"),void e.call(null,null,Ve);if(ve.push(e),!(ve.length>1)){if(Re.debug(`Creating peer connection config "${JSON.stringify(ye)}".`),0===F.servers.length&&(Re.error("No ice servers present"),G("Error","noIceServers")),"relay"===F.transportPolicy){const e=e=>e&&0===e.indexOf("turn");F.servers=F.servers.map(t=>{const n=(0,c.default)(t);return Array.isArray(n.urls)||(n.urls=[n.urls]),n.urls=n.urls.filter(e),0===n.urls.length?void 0:n}).filter(e=>void 0!==e)}ye.iceTransportPolicy=F.transportPolicy,ye.iceServers=F.servers,W&&(ye.forceEncodedVideoInsertableStreams=!0,ye.forceEncodedAudioInsertableStreams=!0,ye.encodedInsertableStreams=!0),n(re.RTCPeerConnection).then(e=>{if(!e)throw Re.error("createPeerConnection: Invalid RTCPeerConnection object"),new Error("Failed to create valid RTCPeerConnection object");return x({window:re,config:ye})}).then(function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Me(null,t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e=>Me(e))}},Me=(e,t)=>{if(e)return qe({reason:"Failed to create PeerConnection, exception: "+e,prefix:"NewPeerConnection"}),void(ve=[]);Re.debug("OT attachEventsToPeerConnection"),Ve=t,nt.setPeerConnection(t),Ye&&Ye.setPeerConnection(t),Ce=new j(Ve),ye.channels&&Ce.addMany(ye.channels);const n=(e=>{let t=e.sendMessage,n=e.logging;const r={};return e=>{e.candidate?(r[e.candidate.sdpMid]=e.candidate.sdpMLineIndex,t("candidate",{candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid||"",sdpMLineIndex:e.candidate.sdpMLineIndex||0})):n.debug("IceCandidateForwarder: No more ICE candidates.")}})({sendMessage:Be,logging:Re}),r=e=>{var t;(Te.resolve(),t=e.candidate,"relay"!==F.transportPolicy||null==t||-1!==t.candidate.indexOf("typ relay"))?n(e):Re.debug("Ignore candidate",e.candidate.candidate)},a=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Oe(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();let l=Ve.iceConnectionState;const c=e=>{Ve?(Re.debug("iceconnectionstatechange",Ve.iceConnectionState),"connected"===Ve.iceConnectionState?("disconnected"===l&&fe.clearFailedTimeout(),fe.emit("iceConnected"),ke.set(!1)):"completed"===Ve.iceConnectionState&&M.isLegacyEdge&&setTimeout(()=>rt.startCollecting(),1e3)):Re.debug("iceconnectionstatechange on peerConnection that no longer exists",fe);const t=e.target.iceConnectionState;fe.trigger("iceConnectionStateChange",t),G("attachEventsToPeerConnection","iceconnectionstatechange",t),"disconnected"===t&&(ke.run()?Re.debug("Restarting ice!"):(0,B.default)()||(Se=setTimeout(()=>{G("attachEventsToPeerConnection","iceconnectionstatechange","failed"),l="failed",fe.trigger("iceConnectionStateChange","failed")},1e4))),"disconnected"!==l&&"failed"===t&&qe({reason:"The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",prefix:"ICEWorkflow"}),l=t},s=()=>{G("peerConnection:negotiationNeeded","Event"),p&&fe.generateOfferAndSend(),fe.trigger("negotiationNeeded")};Ve.addEventListener("track",a),Ve.addEventListener("icecandidate",r),Ve.addEventListener("signalingstatechange",Le),Ve.addEventListener("negotiationneeded",s),Ve.addEventListener("iceconnectionstatechange",c),be.add(()=>{Ve&&(Ve.removeEventListener("track",a),Ve.removeEventListener("icecandidate",r),Ve.removeEventListener("signalingstatechange",Le),Ve.removeEventListener("negotiationneeded",s),Ve.removeEventListener("iceconnectionstatechange",c))}),He(null)},He=()=>{for(;ve.length;)ve.shift().call(null)},Ke=()=>{Ye&&(Ye.destroy(),Ye=null),ve=[],rt.stopCollecting(),be.releaseAll(),Te.clean(),nt.destroy(),null!==Ve&&(Ve.destroy&&Ve.destroy(),Ve=null,fe.trigger("close")),fe.off()},Le=e=>{const t=e.target.signalingState;if(fe.emit("signalingStateChange",t),"stable"===t&&fe.emit("signalingStateStable"),t&&t!==we)switch(we=t,Re.debug("stateChange: "+we),we){case"closed":Ke()}},ze=()=>{let e;if(Ve.getRemoteStreams)e=Ve.getRemoteStreams();else{if(!Ve.remoteStreams)throw new Error("Invalid Peer Connection object implements no method for retrieving remote streams");e=Ve.remoteStreams}return Array.prototype.slice.call(e)},Oe=e=>{var t;const n=e.track,r=e.transceiver,i=e.stream||(null==(t=e.streams)?void 0:t[0]);G("createPeerConnection","TrackAdded"),fe.trigger("trackAdded",{stream:i,track:n,transceiver:r})},je=(e,t,n)=>{k=!1,qe({reason:`PeerConnection.offerProcessor ${e}: ${t}`,prefix:n})},Pe=e=>{if(k)return void(v=e);k=!0,G("peerConnection:processOffer","Event");const t=new ce({type:"offer",sdp:e.content.sdp}),n=e=>{k=!1,Ye&&Ye.process(),Be("answer",e),M.isLegacyEdge||rt.startCollecting(),v&&(Pe(v),v=null)},r=e=>fe.trigger("remoteVideoSupported",e);xe(()=>{O(Ve,re.RTCPeerConnection,re.RTCSessionDescription,ce,Ie,t,I,R,n,je,r,T,y)})};fe.setSendMessage=e=>{X=e},fe.generateOfferAndSend=()=>{fe.generateOffer(e=>{Re.debug("processSubscribe: sending offer"),Be("offer",e)})};const _e=ie(fe.generateOfferAndSend,2e3);fe.generateOffer=ie((function(e){void 0===e&&(e=()=>{}),me.enqueueOfferAnswer(()=>(e=>{var t,n;if("closed"===(null==(t=Ve)||null==(n=t.signalingState)?void 0:n.toLowerCase()))return;G("peerConnection:processSubscribe","Event"),Re.debug("processSubscribe: Sending offer to subscriber.");let r=Ne.get()?ye.capableSimulcastStreams:1;"P2P"===y&&!R&&(r=1),xe(()=>{P({peerConnection:Ve,NativeRTCSessionDescription:ce,sdpTransforms:Ie,numSimulcastStreams:r,removeVideoOrientation:Ae(),offerOverrides:Z,offerConstraints:{iceRestart:ke.get()},replaceBaselineProfile:T}).then(t=>{Re.debug("processSubscribe: got offer, waiting for _readyToCompleteOffer"),We=t,Te.promise.then(()=>e(We))},e=>{qe({reason:`subscribeProcessor ${e.message}: ${e.reason}`,prefix:e.prefix})}),ke.set(!1)})})(e))}),100);const qe=e=>{let t=e.reason,n=e.prefix;Re.error(t,"in state",Ve?{connectionState:Ve.connectionState,iceConnectionState:Ve.iceConnectionState,iceGatheringState:Ve.iceGatheringState,signalingState:Ve.signalingState}:"(none)"),fe.trigger("error",{reason:t,prefix:n})};function $e(e){this.track=e}fe.addTrack=(t,n)=>{const r=new e((e,t)=>{xe(n=>{if(n)return t(n);e()})}).then(()=>{if(Ve.addTrack)return Ve.addTrack(t,n);const e=Ve.getLocalStreams()[0];if(void 0===e)throw new Error("PeerConnection has no existing streams, cannot addTrack");e.addTrack(t),fe.generateOfferAndSend()}).then(()=>new e(e=>{fe.once("signalingStateStable",()=>{e()})}));return(0,a.default)(r,15e3,"Renegotiation timed out")},fe.setIceConfig=e=>{try{M.isFirefox&&(e.certificates=Ve.getConfiguration().certificates),Ve.setConfiguration(e)}catch(e){throw new U.default("A peer connection failed to set configuration with "+e.message,se.FAILED_SET_CONFIGURATION)}return ke.set(!0),Ve},fe.removeTrack=t=>{const n=e.resolve().then(()=>t instanceof $e?(Ve.getLocalStreams()[0].removeTrack(t.track),void fe.generateOfferAndSend()):Ve.removeTrack(t)).then(()=>new e(e=>{fe.once("signalingStateStable",()=>{e()})}));return(0,a.default)(n,15e3,"Renegotiation timed out")},fe.addLocalStream=t=>new e((e,n)=>{xe(r=>{if(r)n(r);else{try{t.getTracks&&t.getTracks().forEach(e=>Ve.addTrack(e,t))}catch(e){return void n(e)}try{Je()}catch(e){Re.error(e)}e()}})}),fe.getLocalStreams=()=>Ve.getLocalStreams(),fe.getSenders=()=>Ve.getSenders?Ve.getSenders():Ve.getLocalStreams()[0].getTracks().map(e=>new $e(e)),fe.disconnect=()=>{var e;Ye&&(Ye.destroy(),Ye=null),null!=(e=Ve)&&e.signalingState&&"closed"!==Ve.signalingState.toLowerCase()&&(Ve.close(),"function"==typeof q&&V.off("keyChanged",q),D=null,pe=null,setTimeout(Ke))},fe.iceRestart=()=>ke.set(!0),fe.clearFailedTimeout=()=>clearTimeout(Se);const et=t=>{const n=t?$:ee;return new e(e=>{me.enqueueOfferAnswer((0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n(Ve);case 2:me.setResolved(),e();case 4:case"end":return t.stop()}}),t)}))))})};fe.changeMediaDirectionToRecvOnly=()=>et(!1),fe.changeMediaDirectionToInactive=()=>et(!0),fe.processMessage=(e,t)=>{switch(Re.debug(`processMessage: Received ${e} from ${t.fromAddress}`,t),Re.debug(t),e){case"generateoffer":t.content&&void 0!==t.content.simulcastEnabled&&Ne.set(t.content.simulcastEnabled),fe.generateOfferAndSend(),i();break;case"offer":Pe(t),i();break;case"answer":case"pranswer":(e=>{G("peerConnection:processAnswer","Event");const t=e=>{"function"==typeof e.includes&&e.includes("Failed to parse SessionDescription. a=extmap-allow-mixed Expects at least 2 fields.")&&(e="SessionDescription issue has been fixed in Chrome 71 and above. Please update your browser."),qe({reason:"Error while setting RemoteDescription "+e,prefix:"SetRemoteDescription"})};e.content.sdp?(Ee=new ce({type:"answer",sdp:r(Ie,"remote","answer",(0,l.default)({replaceBaselineProfile:T},f),e.content.sdp).local}),Ve.setRemoteDescription(Ee).then(()=>{Re.debug("processAnswer: setRemoteDescription Success"),Ye&&Ye.process()}).catch(t),me.setResolved(),M.isLegacyEdge||rt.startCollecting()):t("Weird answer message, no SDP.")})(t);break;case"candidate":var n=new le(t.content);Ye&&Ye.addIceCandidate(n).catch(e=>{Re.warn(`Error while adding ICE candidate: ${JSON.stringify(n)}: ${e.toString()}`)});break;default:Re.debug(`processMessage: Received an unexpected message of type ${e} from ${t.fromAddress}: ${JSON.stringify(t)}`)}function i(){Qe+=1,rt.handleOfferMessageReceived(),Qe>1&&(G("Renegotiation","Attempt"),Fe=!0)}return fe};const tt=e=>Ve.getTransceivers().filter(t=>e.includes(t.mid));fe.getTransceivers=()=>Ve.getTransceivers(),fe.stopTransceivers=e=>{const t=tt(e);var n;(n=t,n.sort((e,t)=>e.mid<t.mid?1:e.mid>t.mid?-1:0)).forEach(e=>e.stop())},fe.setTransceiversToInactive=e=>{tt(e).forEach(e=>{e.direction=w.default.INACTIVE})},fe.remoteStreams=()=>Ve?ze():[],fe.remoteTracks=()=>Ve?Ve.getReceivers?Array.prototype.slice.apply(Ve.getReceivers()).map(e=>e.track):Array.prototype.concat.apply([],ze().map(e=>e.getTracks())):[],fe.remoteDescription=()=>Ve.remoteDescription,fe.getStats=(e,t,n)=>{if(Ve)nt.getRtcStatsReport(e,t).then(e=>n(null,Ue(e))).catch(n);else{const e=ue.PEER_CONNECTION_NOT_CONNECTED;n(new U.default(de.getTitleByCode(e),se.PEER_CONNECTION_NOT_CONNECTED,{code:e}))}},fe.getRtcStatsReport=(e,t,n)=>{if(Ve)nt.getRtcStatsReport(e,t).then(e=>n(null,e)).catch(n);else{const e=ue.PEER_CONNECTION_NOT_CONNECTED;n(new U.default(de.getTitleByCode(e),se.PEER_CONNECTION_NOT_CONNECTED,{code:e}))}},fe.getSynchronizationSources=e=>{if(!p){if(!Ve){const t=ue.PEER_CONNECTION_NOT_CONNECTED;return void e(new U.default(de.getTitleByCode(t),se.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}K(Ve,e)}};fe.getDataChannel=(e,t,n)=>{Ve?function e(t,n,r,i){let o;const a=Ce.get(n,r);if(!a){if(t>0)return void setTimeout(e.bind(null,t-1,n,r,i),200);o=new U.default(`A channel with that label and options could not be found. Label:${n}. Options: ${JSON.stringify(r)}`)}i(o,a)}(100,e,t,n):n(new U.default("Cannot create a DataChannel before there is a connection."))},fe.getSourceStreamId=()=>y,fe.iceConnectionStateIsConnected=()=>Ve&&["connected","completed"].indexOf(Ve.iceConnectionState)>-1,fe.hasTrack=e=>Ve.getSenders().some(t=>t.track===e),fe.findAndReplaceTrack=(t,n)=>e.resolve().then(()=>{const r=Ve.getSenders().filter(e=>e.track===t)[0];if(!r)return e.resolve();if("function"!=typeof r.replaceTrack)throw new Error("Sender does not support replaceTrack");return r.replaceTrack(n)}),fe.hasRelayCandidates=()=>d,fe.getNegotiatedCodecs=()=>{if(!Ve.localDescription||!Ve.remoteDescription)return null;const e=e=>(0,s.default)(b.default.getCodecs(Ve.localDescription.sdp,e),b.default.getCodecs(Ve.remoteDescription.sdp,e));return{audio:e("audio"),video:e("video")}},fe.on("signalingStateStable",()=>{Fe&&(Fe=!1,G("Renegotiation","Success",fe.getNegotiatedCodecs()))}),fe.on("error",e=>{let t=e.prefix;Fe&&-1!==["CreateOffer","SetRemoteDescription"].indexOf(t)&&(Fe=!1,G("Renegotiation","Failure"))}),fe.on("close",()=>{Fe&&(Fe=!1,G("Renegotiation","Cancel"))});const nt=new te,rt=new ne(nt,p);return rt.on("stats",e=>{e.dataChannels=Ce.sampleQos(),fe.trigger("qos",{parsedStats:e,simulcastEnabled:Ne.get()})}),fe}};var i=r(n(4)),o=r(n(5)),a=r(n(165)),l=r(n(10)),c=r(n(64)),s=r(n(149)),d=r(n(167)),u=r(n(297)),A=r(n(20)),h=r(n(7)),g=r(n(2)),Q=r(n(3)),F=r(n(9)),p=r(n(23)),U=r(n(153)),m=r(n(168)),b=r(n(21)),B=r(n(78)),Z=r(n(655)),f=r(n(657)),R=r(n(169)),I=r(n(658)),y=r(n(660)),V=r(n(661)),C=r(n(662)),W=r(n(664)),E=r(n(666)),S=r(n(668)),v=r(n(672)),J=r(n(674)),N=r(n(675)),G=r(n(303)),X=r(n(679)),k=r(n(6)),T=r(n(680)),Y=r(n(52)),w=r(n(300)),D=r(n(306))}).call(this,n(1))},function(e,t,n){var r=n(652)(n(298));e.exports=r},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(3));t.default=()=>!((i.default.isChrome||i.default.isElectron)&&i.default.version>=90||i.default.isSamsung&&i.default.version>=20||i.default.isOpera&&i.default.version>=76||i.default.isIosWebView||i.default.isAndroidWebView)&&(i.default.isChrome&&i.default.version>71||i.default.isSamsung&&i.default.version>=13||i.default.isChromiumEdge&&i.default.version<90||i.default.isOpera&&i.default.version>58)},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={ACTIVE_VIDEO:0,ACTIVE_VIDEO_WITH_WARNING:1,SUSPENDED_VIDEO:2};t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.messages=t.default=t.codes=void 0;const r={1e3:"The connection successfully completed the purpose for which it was created.",1001:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.",1002:"The endpoint is terminating the connection due to a protocol error. (CLOSE_PROTOCOL_ERROR)",1003:"The connection is being terminated because the endpoint has indicated that reconnections are not available. (CLOSE_UNSUPPORTED)",1005:"Indicates that no status code was provided even though one was expected. (CLOSE_NO_STATUS)",1006:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected. (CLOSE_ABNORMAL)",1007:"Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message)",1008:"Indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy",1009:"Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process (CLOSE_TOO_LARGE)",1011:"Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request",4001:"Connectivity loss was detected as it was too long since the socket received the last PONG message",4010:"Timed out while waiting for the Rumor socket to connect.",4020:"Error code unavailable.",4030:"Exception was thrown during Rumor connection, possibly because of a blocked port."};t.messages=r;const i={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,CLOSE_INCONSISTENT_DATA:1007,CLOSE_POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,CLOSE_UNEXPECTED_CONDITION:1011,CLOSE_CONNECTIVITY_LOSS:4001,CLOSE_TIMEOUT:4010,CLOSE_FALLBACK_CODE:4020,CLOSE_CONNECT_EXCEPTION:4030,ALREADY_CONNECTED_CONNECTING:null};t.codes=i;var o={messages:r,codes:i};t.default=o},function(e,t,n){var r=n(82),i=n(119),o=n(87),a=n(195),l=n(404),c=n(198),s=n(57),d=n(407),u=n(409),A=n(201),h=n(203),g=n(45),Q=n(412),F=n(413),p=n(208),U=n(15),m=n(67),b=n(417),B=n(12),Z=n(419),f=n(34),R=n(56),I={};I["[object Arguments]"]=I["[object Array]"]=I["[object ArrayBuffer]"]=I["[object DataView]"]=I["[object Boolean]"]=I["[object Date]"]=I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Map]"]=I["[object Number]"]=I["[object Object]"]=I["[object RegExp]"]=I["[object Set]"]=I["[object String]"]=I["[object Symbol]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I["[object Error]"]=I["[object Function]"]=I["[object WeakMap]"]=!1,e.exports=function e(t,n,y,V,C,W){var E,S=1&n,v=2&n,J=4&n;if(y&&(E=C?y(t,V,C,W):y(t)),void 0!==E)return E;if(!B(t))return t;var N=U(t);if(N){if(E=Q(t),!S)return s(t,E)}else{var G=g(t),X="[object Function]"==G||"[object GeneratorFunction]"==G;if(m(t))return c(t,S);if("[object Object]"==G||"[object Arguments]"==G||X&&!C){if(E=v||X?{}:p(t),!S)return v?u(t,l(E,t)):d(t,a(E,t))}else{if(!I[G])return C?t:{};E=F(t,G,S)}}W||(W=new r);var k=W.get(t);if(k)return k;W.set(t,E),Z(t)?t.forEach((function(r){E.add(e(r,n,y,r,t,W))})):b(t)&&t.forEach((function(r,i){E.set(i,e(r,n,y,i,t,W))}));var T=N?void 0:(J?v?h:A:v?R:f)(t);return i(T||t,(function(r,i){T&&(r=t[i=r]),o(E,i,e(r,n,y,i,t,W))})),E}},function(e,t,n){var r=n(83),i=n(376),o=n(377),a=n(378),l=n(379),c=n(380);function s(e){var t=this.__data__=new r(e);this.size=t.size}s.prototype.clear=i,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=l,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(371),i=n(372),o=n(373),a=n(374),l=n(375);function c(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])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=l,e.exports=c},function(e,t,n){var r=n(55);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(42)(Object,"create");e.exports=r},function(e,t,n){var r=n(395);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(65),i=n(55),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},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){var r=n(402),i=n(69),o=n(121),a=o&&o.isTypedArray,l=a?i(a):r;e.exports=l},function(e,t,n){var r=n(12),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){var r=n(92),i=n(211),o=n(128);e.exports=function(e,t){return o(i(e,t,r),e+"")}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===i}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===i)||!1}},function(e,t,n){"use strict";e.exports=n(446)()?globalThis:n(447)},function(e,t,n){"use strict";(function(e){t.__esModule=!0,t.default=function(t){return new e(e=>setTimeout(e,t))}}).call(this,n(1))},function(e,t,n){"use strict";(function(t){var r=n(13),i=n(49),o=n(489);function a(e){return r.isPlainObject(e)||r.isArray(e)}function l(e){return r.endsWith(e,"[]")?e.slice(0,-2):e}function c(e,t,n){return e?e.concat(t).map((function(e,t){return e=l(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var s=r.toFlatObject(r,{},null,(function(e){return/^is[A-Z]/.test(e)}));e.exports=function(e,n,d){if(!r.isObject(e))throw new TypeError("target must be an object");n=n||new(o||FormData);var u,A=(d=r.toFlatObject(d,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.isUndefined(t[e])}))).metaTokens,h=d.visitor||U,g=d.dots,Q=d.indexes,F=(d.Blob||"undefined"!=typeof Blob&&Blob)&&((u=n)&&r.isFunction(u.append)&&"FormData"===u[Symbol.toStringTag]&&u[Symbol.iterator]);if(!r.isFunction(h))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(r.isDate(e))return e.toISOString();if(!F&&r.isBlob(e))throw new i("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(e)||r.isTypedArray(e)?F&&"function"==typeof Blob?new Blob([e]):t.from(e):e}function U(e,t,i){var o=e;if(e&&!i&&"object"==typeof e)if(r.endsWith(t,"{}"))t=A?t:t.slice(0,-2),e=JSON.stringify(e);else if(r.isArray(e)&&function(e){return r.isArray(e)&&!e.some(a)}(e)||r.isFileList(e)||r.endsWith(t,"[]")&&(o=r.toArray(e)))return t=l(t),o.forEach((function(e,i){!r.isUndefined(e)&&null!==e&&n.append(!0===Q?c([t],i,g):null===Q?t:t+"[]",p(e))})),!1;return!!a(e)||(n.append(c(i,t,g),p(e)),!1)}var m=[],b=Object.assign(s,{defaultVisitor:U,convertValue:p,isVisitable:a});if(!r.isObject(e))throw new TypeError("data must be an object");return function e(t,i){if(!r.isUndefined(t)){if(-1!==m.indexOf(t))throw Error("Circular reference detected in "+i.join("."));m.push(t),r.forEach(t,(function(t,o){!0===(!(r.isUndefined(t)||null===t)&&h.call(n,t,r.isString(o)?o.trim():o,i,b))&&e(t,i?i.concat(o):[o])})),m.pop()}}(e),n}}).call(this,n(228).Buffer)},function(e,t,n){"use strict";var r=n(49);function i(e,t,n){r.call(this,null==e?"canceled":e,r.ERR_CANCELED,t,n),this.name="CanceledError"}n(13).inherits(i,r,{__CANCEL__:!0}),e.exports=i},function(e,t,n){var r=n(90),i=n(12);e.exports=function(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=r(e.prototype),o=e.apply(n,t);return i(o)?o:n}}},function(e,t,n){var r=n(525);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t,n){var r=n(531);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var r=n(118),i=n(541),o=n(542);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(62),i=n(50);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},function(e,t,n){var r=n(260),i=n(34);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(261));const o=e=>e.replace(/\/$/,"");var a=(e,t)=>{if(!t)return e;const n=i.default.parse(t),r=i.default.parse(e);if(!n.protocol||!r.protocol)return e;const a=n.protocol.match(/^https/),l=r.protocol.match(/^ws/i);return`${o(`${(l?"ws":"http")+(a?"s":"")}://${n.host}${n.pathname}`)}/${o(`${r.host}${r.pathname}${r.search||""}`)}`};t.default=a},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;let r="";var i={getCurrentAudioOutputDeviceId:()=>r,setCurrentAudioOutputDeviceId:e=>{r=e}};t.default=i},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e,t){const n={};Object.keys(t).forEach(r=>{n[r]=((e,t,n)=>{if(t&&!n)return()=>t.call(e);if(t&&n)return r=>(void 0!==r&&n.call(e,r),t.call(e));return t=>{void 0!==t&&n.call(e,t)}})(e,t[r].get,t[r].set)}),(0,i.default)(e,n)};var i=r(n(10))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(209));var o=function(e){let t=(void 0===e?{}:e).NativeVideoElementWrapper;const n=void 0===t?(0,i.default)():t;return function(e){let t=void 0===e?{}:e,r=t.fallbackText,i=void 0===r?"Sorry, Web RTC is not available in your browser":r,o=t.fitMode,a=t.muted,l=t._inject,c=t.widgetType;return new n({fallbackText:i,fitMode:o,muted:a,defaultAudioVolume:50,_inject:l,widgetType:c})}};t.default=o},function(e,t,n){"use strict";function r(e){return e.map(e=>({url:e.url,urls:e.urls||[e.url],username:e.username,credential:e.credential}))}t.__esModule=!0,t.adaptIceServers=r,t.parseIceServers=function(e){let t;try{t=JSON.parse(e.data).content.iceServers}catch(e){return[]}return r(t)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(3));t.default=()=>"Chrome"===i.default.name&&i.default.version>=58||"Samsung"===i.default.name&&i.default.version>=7||i.default.isIosWebView&&i.default.iOSVersion>=11||i.default.isAndroidWebView&&i.default.androidVersion>=4.4||-1!==["Firefox","Edge","Safari","Opera"].indexOf(i.default.name)},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){let t=null,n=!1;const r=()=>{n&&(e(),t=window.requestAnimationFrame(r))};this.start=()=>{n||(n=!0,t=window.requestAnimationFrame(r))},this.stop=()=>{window.cancelAnimationFrame(t),n=!1}}},function(e,t,n){"use strict";t.__esModule=!0,t.ONE_SECOND_IN_MS=t.ONE_MINUTE_IN_MS=void 0;t.ONE_SECOND_IN_MS=1e3;t.ONE_MINUTE_IN_MS=6e4},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationError=t.default=void 0;var r=o(n(717)),i=o(n(331));function o(e){return e&&e.__esModule?e:{default:e}}t.default=r.default,t.CancellationError=i.default},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i,o,a=r(n(54)),l=r(n(3));const c=!!window.crypto,s=!!window.RTCRtpScriptTransform&&!l.default.isFirefox,d=!(null==(i=window.RTCRtpSender)||!i.prototype.createEncodedStreams)||!(null==(o=window.RTCRtpSender)||!o.prototype.createdEncodedVideoStreams)||s,u=!!window.Worker,A=()=>c&&d&&u;t.default=function(e){void 0===e&&(e={});const t=e.hasOpenTokSupport||a.default.once,n=e.isE2eeSupported||A;return t()&&n()}},function(e,t,n){var r=n(42)(n(16),"Map");e.exports=r},function(e,t,n){var r=n(387),i=n(394),o=n(396),a=n(397),l=n(398);function c(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])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=a,c.prototype.set=l,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(192),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,l=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l}).call(this,n(88)(e))},function(e,t,n){var r=n(70),i=n(403),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(408),i=n(199),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,l=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=l},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t,n){var r=n(197)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(206);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t){e.exports=function(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(e,t,n){var r=n(423),i=n(212)(r);e.exports=i},function(e,t,n){var r=n(55),i=n(29),o=n(68),a=n(12);e.exports=function(e,t,n){if(!a(n))return!1;var l=typeof t;return!!("number"==l?i(n)&&o(t,n.length):"string"==l&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={error:{priority:1,method:"error"},warn:{priority:2,method:"warn"},info:{priority:3,method:"info"},log:{priority:4,method:"log"},debug:{priority:5,method:"debug"},spam:{priority:6,method:"log"}};t.default=r},function(e,t,n){"use strict";e.exports=n(214)()?Object.setPrototypeOf:n(215)},function(e,t,n){"use strict";var r=n(59),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!r(e)&&hasOwnProperty.call(i,typeof e)}},function(e,t,n){"use strict";e.exports=n(437)()?Object.assign:n(438)},function(e,t,n){"use strict";(function(t){var r=n(13),i=n(229),o=n(49),a=n(230),l=n(97),c=n(494),s=n(135),d=n(231),u={"Content-Type":"application/x-www-form-urlencoded"};function A(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var h,g={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(h=n(232)),h),transformRequest:[function(e,t){i(t,"Accept"),i(t,"Content-Type");var n,o=t&&t["Content-Type"]||"",a=o.indexOf("application/json")>-1,s=r.isObject(e);if(s&&r.isHTMLForm(e)&&(e=new FormData(e)),r.isFormData(e))return a?JSON.stringify(d(e)):e;if(r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return A(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(s){if(-1!==o.indexOf("application/x-www-form-urlencoded"))return c(e,this.formSerializer).toString();if((n=r.isFileList(e))||o.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return l(n?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||a?(A(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&r.isString(e)&&(n&&!this.responseType||i)){var a=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:s.classes.FormData,Blob:s.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){g.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){g.headers[e]=r.merge(u)})),e.exports=g}).call(this,n(25))},function(e,t,n){"use strict";e.exports=n(495)},function(e,t){e.exports={}},function(e,t,n){var r=n(238),i=n(514),o=n(515),a=n(240),l=n(529),c=n(244),s=n(530),d=n(247),u=n(248),A=n(101),h=Math.max;e.exports=function(e,t,n,g,Q,F,p,U){var m=2&t;if(!m&&"function"!=typeof e)throw new TypeError("Expected a function");var b=g?g.length:0;if(b||(t&=-97,g=Q=void 0),p=void 0===p?p:h(A(p),0),U=void 0===U?U:A(U),b-=Q?Q.length:0,64&t){var B=g,Z=Q;g=Q=void 0}var f=m?void 0:c(e),R=[e,t,n,g,Q,B,Z,F,p,U];if(f&&s(R,f),e=R[0],t=R[1],n=R[2],g=R[3],Q=R[4],!(U=R[9]=void 0===R[9]?m?0:e.length:h(R[9]-b,0))&&24&t&&(t&=-25),t&&1!=t)I=8==t||16==t?o(e,t,U):32!=t&&33!=t||Q.length?a.apply(void 0,R):l(e,t,n,g);else var I=i(e,t,n);return u((f?r:d)(I,R),e,t)}},function(e,t,n){var r=n(90),i=n(139);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&"__lodash_placeholder__"!==a||(e[n]="__lodash_placeholder__",o[i++]=n)}return o}},function(e,t,n){var r=n(33),i=n(125),o=n(19),a=Function.prototype,l=Object.prototype,c=a.toString,s=l.hasOwnProperty,d=c.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}},function(e,t,n){var r=n(540),i=n(19);e.exports=function e(t,n,o,a,l){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,l))}},function(e,t,n){var r=n(15),i=n(72),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(555),i=n(211),o=n(128);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){"use strict";let r;t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.AudioContext||(void 0!==typeof window?window:global).AudioContext||(void 0!==typeof window?window:global).webkitAudioContext;return function(){if(r=r||t&&new t,null==r)throw new Error("AudioContext could not be created, hardware limit reached.");return r}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;let r=function(){function e(e){this._analyser=null,this._timeDomainData=null,this._sourceNode=null,this._audioContext=e}var t=e.prototype;return t._initAudioAnalyser=function(e){this._analyser=this._audioContext.createAnalyser(),this._sourceNode=this._audioContext.createMediaStreamSource(e),this._sourceNode.connect(this._analyser),this._timeDomainData=new Uint8Array(this._analyser.frequencyBinCount)},t.webRTCStream=function(e){this._sourceNode&&this._sourceNode.disconnect(this._analyser),"suspended"===this._audioContext.state&&this._audioContext.resume(),this._initAudioAnalyser(e)},t.destroy=function(){this._sourceNode&&this._sourceNode.disconnect(this._analyser),this._timeDomainData=null},t.sample=function(e){if("function"==typeof e)throw new Error("sample no longer takes a callback");if(this._analyser&&this._timeDomainData){this._analyser.getByteTimeDomainData(this._timeDomainData);let e=0;for(let t=this._timeDomainData.length-1;t>=0;t-=1)e=Math.max(e,Math.abs(this._timeDomainData[t]-128));return e/128}return null},e}();t.default=r},function(e,t,n){var r=n(91),i=n(55),o=n(129),a=n(56),l=Object.prototype,c=l.hasOwnProperty,s=r((function(e,t){e=Object(e);var n=-1,r=t.length,s=r>2?t[2]:void 0;for(s&&o(t[0],t[1],s)&&(r=1);++n<r;)for(var d=t[n],u=a(d),A=-1,h=u.length;++A<h;){var g=u[A],Q=e[g];(void 0===Q||i(Q,l[g])&&!c.call(e,g))&&(e[g]=d[g])}return e}));e.exports=s},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(10)),o=r(n(149));const a=(0,r(n(2)).default)("Event");let l=function(){function e(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={}),this.type=e,this.cancelable=t,this._defaultPrevented=!1;const r=(0,o.default)(Object.keys(this),Object.keys(n));if(r.length>0)throw new Error("Cannot used reserved property names: "+r.join(","));(0,i.default)(this,n)}var t=e.prototype;return t.preventDefault=function(){this.cancelable?this._defaultPrevented=!0:a.warn("Event.preventDefault :: Trying to preventDefault on an event that isn't cancelable")},t.isDefaultPrevented=function(){return this._defaultPrevented},e}();t.default=l},function(e,t,n){var r=n(38),i=n(583),o=n(91),a=n(584),l=o((function(e){var t=r(e,a);return t.length&&t[0]===e[0]?i(t):[]}));e.exports=l},function(e,t){e.exports=function(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(e,t,n){var r=n(29),i=n(19);e.exports=function(e){return i(e)&&r(e)}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(26)),o=r(n(64)),a=r(n(61));var l=function(){function e(e){void 0===e&&(e={}),Object.defineProperty(this,"_rawSessionInfo",{value:(0,o.default)(e)})}return(0,i.default)(e,[{key:"sessionId",get:function(){return this._rawSessionInfo.session_id}},{key:"partnerId",get:function(){return this._rawSessionInfo.partner_id}},{key:"messagingServer",get:function(){return this._rawSessionInfo.messaging_server_url}},{key:"mediaServerName",get:function(){return this._rawSessionInfo.media_server_hostname}},{key:"messagingURL",get:function(){return this._rawSessionInfo.messaging_url}},{key:"symphonyAddress",get:function(){return this._rawSessionInfo.symphony_address}},{key:"iceServers",get:function(){return this._rawSessionInfo.ice_servers}},{key:"simulcast",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.simulcast")}},{key:"e2ee",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.e2ee",!1)}},{key:"reconnection",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.reconnection",!1)}},{key:"renegotiation",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.renegotiation",!1)}},{key:"p2pEnabled",get:function(){return"enabled"===(0,a.default)(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"hybridSession",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.hybridSession",!1)}},{key:"isAdaptiveEnabled",get:function(){return"adaptive"===(0,a.default)(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"priorityVideoCodec",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.priorityVideoCodec","")}},{key:"h264",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.h264",!0)}},{key:"vp8",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.vp8",!0)}},{key:"vp9",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.vp9",!0)}},{key:"singlePeerConnection",get:function(){return(0,a.default)(this._rawSessionInfo,"properties.singlePeerConnection",!1)}},{key:"clientCandidates",get:function(){const e=(0,a.default)(this._rawSessionInfo,"properties.clientCandidates");return"relayed"===e?"relay":e}}]),e}();t.default=l},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(12)),o=r(n(3));let a;const l=["description","fileName","lineNumber","message","name","number","stack"],c=function(e,t,n){switch(arguments.length){case 1:(0,i.default)(e)&&(n=e,t=void 0,e=void 0);break;case 2:(0,i.default)(t)&&(n=t,t=void 0)}if(n instanceof Error)for(let e=0,t=l.length;e<t;++e)this[l[e]]=n[l[e]];else if((0,i.default)(n))for(const e in n)n.hasOwnProperty(e)&&(this[e]=n[e]);if(!(this.fileName&&this.lineNumber&&this.columnNumber&&this.stack)){const e=a();!this.fileName&&e.fileName&&(this.fileName=e.fileName),!this.lineNumber&&e.lineNumber&&(this.lineNumber=e.lineNumber),!this.columnNumber&&e.columnNumber&&(this.columnNumber=e.columnNumber),!this.stack&&e.stack&&(this.stack=e.stack)}!this.message&&e&&(this.message=e),this.name&&"Error"!==this.name||!t||(this.name=t)};(c.prototype=Object.create(Error.prototype)).toString=function(){let e="";return this.fileName&&(e+=" "+this.fileName),this.lineNumber&&(e+=" "+this.lineNumber,this.columnNumber&&(e+=":"+this.columnNumber)),`<${this.name?this.name+" ":""}${this.message}${e}>`},c.prototype.valueOf=c.prototype.toString;const s=function(e,t){return t.slice(2).map(e=>{const t={fileName:e.getFileName(),linenumber:e.getLineNumber(),columnNumber:e.getColumnNumber()};return e.getFunctionName()&&(t.functionName=e.getFunctionName()),e.getMethodName()&&(t.methodName=e.getMethodName()),e.getThis()&&(t.self=e.getThis()),t})};a=function(){const e={};let t,n,r;switch(o.default.name){case"Firefox":case"Safari":try{(void 0!==typeof window?window:global).call.js.is.explody()}catch(e){r=e}t=(r.stack||"").split("\n"),t.shift(),t.shift(),e.stack=t,n=/@(.+?):([0-9]+)(:([0-9]+))?$/.exec(t[0]),n&&(e.fileName=n[1],e.lineNumber=parseInt(n[2],10),n.length>3&&(e.columnNumber=parseInt(n[4],10)));break;case"Chrome":case"Samsung":case"Node":case"Opera":var i=Error.prepareStackTrace;Error.prepareStackTrace=s,r=new Error,e.stack=r.stack,Error.prepareStackTrace=i;var a=e.stack[0];e.lineNumber=a.lineNumber,e.columnNumber=a.columnNumber,e.fileName=a.fileName,a.functionName&&(e.functionName=a.functionName),a.methodName&&(e.methodName=a.methodName),a.self&&(e.self=a.self);break;default:r=new Error,r.stack&&(e.stack=r.stack.split("\n"))}return r.message&&(e.message=r.message),e};var d=c;t.default=d},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default=()=>document.createElement("video")},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){return{ROTATED_NORMAL:0,ROTATED_LEFT:270,ROTATED_RIGHT:90,ROTATED_UPSIDE_DOWN:180}}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){if(void 0!==e.adapter||l.default.isLegacyEdge)return e;const t=(e=>{const t={},n=(e,t,n)=>{n.forEach(n=>{let r=n.key,i=n.type,o=t[r];if(void 0!==o){switch(i){case"function":o=((e,t)=>{if("function"!=typeof t)return c.warn("Non-function passed into bindWithStaticProperties()"),t;const n=t.bind(e);return Object.keys(t).forEach(e=>{n[e]=t[e]}),n})(t,o);break;case"class":o="function"!=typeof(l=o)?(c.warn("Non-function passed into extendClass()"),l):(0,a.default)(l);break;case"string":case"object":break;default:throw new Error("Invalid type of window key: "+i)}e[r]=o}var l})};n(t,e,s),void 0!==e.navigator&&(t.navigator={},n(t.navigator,e.navigator,d),void 0!==e.navigator.mediaDevices&&(t.navigator.mediaDevices={},n(t.navigator.mediaDevices,e.navigator.mediaDevices,u)));return t})(e);return(0,i.default)({window:t}),t};var i=r(n(600)),o=r(n(2)),a=r(n(611)),l=r(n(3));const c=(0,o.default)("createWindowMock"),s=[{key:"location",type:"object"},{key:"setTimeout",type:"function"},{key:"requestAnimationFrame",type:"function"},{key:"URL",type:"function"},{key:"MediaStream",type:"class"},{key:"webkitMediaStream",type:"class"},{key:"RTCIceCandidate",type:"class"},{key:"mozRTCIceCandidate",type:"class"},{key:"RTCSessionDescription",type:"class"},{key:"mozRTCSessionDescription",type:"class"},{key:"RTCIceGatherer",type:"class"},{key:"RTCIceTransport",type:"class"},{key:"RTCDtlsTransport",type:"class"},{key:"RTCSctpTransport",type:"class"},{key:"RTCRtpReceiver",type:"class"},{key:"HTMLMediaElement",type:"class"},{key:"RTCPeerConnection",type:"class"},{key:"webkitRTCPeerConnection",type:"class"},{key:"mozRTCPeerConnection",type:"class"},{key:"MediaStreamTrack",type:"class"},{key:"RTCRtpSender",type:"class"},{key:"RTCTrackEvent",type:"class"},{key:"RTCTransceiver",type:"class"},{key:"RTCDtmfSender",type:"class"},{key:"RTCDTMFSender",type:"class"},{key:"MediaStreamTrackEvent",type:"class"}],d=[{key:"userAgent",type:"string"},{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"webkitGetUserMedia",type:"function"},{key:"mozGetUserMedia",type:"function"}],u=[{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"enumerateDevices",type:"function"},{key:"getSupportedConstraints",type:"function"},{key:"addEventListener",type:"function"},{key:"removeEventListener",type:"function"}]},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){let e=null;this.transform=t=>{e=null===e||t>=e?t:.3*t+.7*e;const n=Math.log(e)/Math.LN10/1.5+1;return Math.min(Math.max(n,0),1)}}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){const t={},n=(n,r)=>{(0,i.default)(r,{parent:this}),r.appendTo(e.parent),t[n]=r,this[n]=r};if(!e.parent)return;(0,o.default)(this),this.destroy=()=>{this.off(),this.hideWhileLoading(),a(t).forEach(e=>e.destroy())},this.showAfterLoading=()=>{a(t).forEach(e=>e.showAfterLoading())},this.hideWhileLoading=()=>{a(t).forEach(e=>e.hideWhileLoading())},this.set=(e,t)=>("string"==typeof e&&t?n(e,t):Object.keys(e).forEach(t=>{n(t,e[t])}),this)};var i=r(n(10)),o=r(n(7));const a=e=>Object.keys(e).map(t=>e[t])},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(7)),o=r(n(30)),a=r(n(612));const l=(0,r(n(17)).default)(),c=(0,a.default)();var s=new function(){const e=this;function t(){return c.isDomLoaded()&&!c.isDomUnloaded()}function n(){e.dispatchEvent(new l.EnvLoadedEvent(o.default.ENV_UNLOADED))}(0,i.default)(e),c.whenLoaded.then((function(){c.whenUnloaded.then(n),t()&&e.dispatchEvent(new l.EnvLoadedEvent(o.default.ENV_LOADED))})),this.onLoad=function(n,r){t()?n.call(r):e.on(o.default.ENV_LOADED,n,r)},this.onUnload=function(t,n){this.isUnloaded()?t.call(n):e.on(o.default.ENV_UNLOADED,t,n)},this.isUnloaded=function(){return c.isDomUnloaded()}};t.default=s},function(e,t,n){"use strict";var r=n(618);
|
|
18
18
|
/*!
|
|
19
19
|
* The buffer module from node.js, for the browser.
|
|
20
20
|
*
|
|
21
21
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
22
22
|
* @license MIT
|
|
23
|
-
*/function i(e,t){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}function o(e){return(void 0!==typeof window?window:global).Buffer&&"function"==typeof(void 0!==typeof window?window:global).Buffer.isBuffer?(void 0!==typeof window?window:global).Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=n(619),l=Object.prototype.hasOwnProperty,c=Array.prototype.slice,s="foo"===function(){}.name;function d(e){return Object.prototype.toString.call(e)}function u(e){return!o(e)&&("function"==typeof(void 0!==typeof window?window:global).ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var A=e.exports=U,h=/\s*function\s+([^\(\s]*)\s*/;function g(e){if(a.isFunction(e)){if(s)return e.name;var t=e.toString().match(h);return t&&t[1]}}function Q(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function F(e){if(s||!a.isFunction(e))return a.inspect(e);var t=g(e);return"[Function"+(t?": "+t:"")+"]"}function p(e,t,n,r,i){throw new A.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function U(e,t){e||p(e,!0,t,"==",A.ok)}function m(e,t,n,r){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(u(e)&&u(t)&&d(e)===d(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var l=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==l&&l===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=b(e),o=b(t);if(i&&!o||!i&&o)return!1;if(i)return e=c.call(e),t=c.call(t),m(e,t,n);var l,s,d=f(e),u=f(t);if(d.length!==u.length)return!1;for(d.sort(),u.sort(),s=d.length-1;s>=0;s--)if(d[s]!==u[s])return!1;for(s=d.length-1;s>=0;s--)if(l=d[s],!m(e[l],t[l],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function B(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function Z(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&p(i,n,"Missing expected exception"+r);var o="string"==typeof r,l=!e&&i&&!n;if((!e&&a.isError(i)&&o&&B(i,n)||l)&&p(i,n,"Got unwanted exception"+r),e&&i&&n&&!B(i,n)||!e&&i)throw i}A.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return Q(F(e.actual),128)+" "+e.operator+" "+Q(F(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||p;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=g(t),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(A.AssertionError,Error),A.fail=p,A.ok=U,A.equal=function(e,t,n){e!=t&&p(e,t,n,"==",A.equal)},A.notEqual=function(e,t,n){e==t&&p(e,t,n,"!=",A.notEqual)},A.deepEqual=function(e,t,n){m(e,t,!1)||p(e,t,n,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(e,t,n){m(e,t,!0)||p(e,t,n,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(e,t,n){m(e,t,!1)&&p(e,t,n,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=function e(t,n,r){m(t,n,!0)&&p(t,n,r,"notDeepStrictEqual",e)},A.strictEqual=function(e,t,n){e!==t&&p(e,t,n,"===",A.strictEqual)},A.notStrictEqual=function(e,t,n){e===t&&p(e,t,n,"!==",A.notStrictEqual)},A.throws=function(e,t,n){Z(!0,e,t,n)},A.doesNotThrow=function(e,t,n){Z(!1,e,t,n)},A.ifError=function(e){if(e)throw e},A.strict=r((function e(t,n){t||p(t,!0,n,"==",e)}),A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict;var f=Object.keys||function(e){var t=[];for(var n in e)l.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(3)),o=r(n(626)),a=r(n(290));t.default=e=>i.default.isElectron?"screen"===e||(0,a.default)(e):o.default.indexOf(e)>-1},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){this.id=e.id,this.type=e.type,this.active=(0,a.default)(e.active),this.orientation=e.orientation||l.ROTATED_NORMAL,e.frameRate&&(this.frameRate=parseFloat(e.frameRate));e.preferredFrameRate&&(this.preferredFrameRate=parseFloat(e.preferredFrameRate));e.preferredWidth&&(this.preferredWidth=parseInt(e.preferredWidth,10));e.preferredHeight&&(this.preferredHeight=parseInt(e.preferredHeight,10));this.width=parseInt(e.width,10),this.height=parseInt(e.height,10),this.source=e.source||"camera",this.fitMode=e.fitMode||"cover",(0,i.default)(this),this.update=function(e){const t={},n={};for(const r in e){if(!e.hasOwnProperty(r))continue;const i=this[r];switch(r){case"active":this.active=(0,a.default)(e[r]);break;case"disableWarning":this.disableWarning=(0,a.default)(e[r]);break;case"frameRate":this.frameRate=parseFloat(e[r],10);break;case"width":case"height":this[r]=parseInt(e[r],10),t[r]=this[r],n[r]=i;break;case"orientation":this[r]=e[r],t[r]=this[r],n[r]=i;break;case"fitMode":case"source":this[r]=e[r];break;case"sourceStreamId":break;default:return c.debug(`Tried to update unknown key ${r} on ${this.type} channel ${this.id}`),!1}this.trigger("update",this,r,i,this[r])}return Object.keys(t).length&&this.trigger("update",this,"videoDimensions",n,t),!0}};var i=r(n(7)),o=r(n(2)),a=r(n(293));const l=(0,r(n(155)).default)(),c=(0,o.default)("StreamChannel")},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e,t,n,r){if(!e.trigger)throw new Error("OT.StylableComponent is dependent on the eventing mixin. Ensure that this is included in the object before StylableComponent.");r=r||function(){};let i=!1;!1===n&&(t={buttonDisplayMode:"off",nameDisplayMode:"off",audioLevelDisplayMode:"off",videoDisabledDisplayMode:"off",audioBlockedDisplayMode:"off"},i=!0,r({showControls:!1}));const s=new a.default(t,(function(t,n,r){r?e.trigger("styleValueChanged",t,n,r):e.trigger("styleValueChanged",t,n)}));e.getStyle=function(e){return s.get(e)},e.setStyle=function(e,t,n){if(i)return c.warn("Calling setStyle() has no effect because theshowControls option was set to false"),this;let a;return"string"!=typeof e?a=e:(a={},a[e]=t),a.backgroundImageURI&&(a.backgroundImageURI=(0,o.default)(a.backgroundImageURI)),s.setAll(a,n),r((0,l.default)(a)),this}};var i=r(n(2)),o=r(n(634)),a=r(n(635)),l=r(n(294));const c=(0,i.default)("StylableComponent")},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(53)),o=r(n(2)),a=r(n(31)),l=r(n(54)),c=r(n(638)),s=r(n(639)),d=r(n(74)),u=r(n(159)),A=r(n(8)),h=r(n(640)),g=r(n(641)),Q=r(n(642));t.default=function(e){void 0===e&&(e={});const t=e.env||A.default.env,n=e.Modal||s.default,r=(e.createLogger||o.default)("systemRequirements"),F=l.default.once,p=new a.default,U=(0,i.default)(()=>{p.logEvent({action:"checkSystemRequirements",variation:"notHasRequirements",partnerId:d.default.value,payload:{userAgent:t.userAgent}})}),m=(0,i.default)(()=>{(0,h.default)()});let b=!1;const B=t.name,Z=t.version,f=t.isMobileDevice,R=(0,Q.default)(B,Z),I=R.isSupportedButOld,y=R.isBrowserAndVersionSupported;return{check(){r.debug("OT.checkSystemRequirements()");const e=Number(c.default&&F());return m(),e||U(),e},upgrade(e){let t=void 0===e?{}:e,i=t.isSupportedButOld,o=void 0===i?I():i,a=t.isBrowserAndVersionSupported,l=void 0===a?y():a;u.default.onLoad(()=>{if(r.warn("OT.upgradeSystemRequirements is deprecated."),b)return;const e=new n(g.default);b=!0,e.on("close",()=>{b=!1}),e.open();let t=f?"mobile-":"";t+=l?"supported-install":o?"upgrade-install":"unsupported-install",e.el("#section-"+t).style.display="block"})}}}},function(e,t,n){"use strict";(function(t){var r=n(0),i=r(n(24)),o=r(n(166));const a=n(646);let l=function(e){function t(t){var n;return(n=e.call(this,t)||this).name="TimeoutError",n}return(0,i.default)(t,e),t}((0,o.default)(Error));e.exports=(e,n,r)=>new t((t,i)=>{if("number"!=typeof n||n<0)throw new TypeError("Expected `ms` to be a positive number");const o=setTimeout(()=>{if("function"==typeof r){try{t(r())}catch(o){i(o)}return}const o=r instanceof Error?r:new l("string"==typeof r?r:`Promise timed out after ${n} milliseconds`);"function"==typeof e.cancel&&e.cancel(),i(o)},n);a(e.then(t,i),()=>{clearTimeout(o)})}),e.exports.TimeoutError=l}).call(this,n(1))},function(e,t,n){var r=n(643),i=n(296),o=n(644),a=n(645);function l(t){var n="function"==typeof Map?new Map:void 0;return e.exports=l=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},l(t)}e.exports=l},function(e,t,n){var r=n(12),i=n(647),o=n(251),a=Math.max,l=Math.min;e.exports=function(e,t,n){var c,s,d,u,A,h,g=0,Q=!1,F=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function U(t){var n=c,r=s;return c=s=void 0,g=t,u=e.apply(r,n)}function m(e){return g=e,A=setTimeout(B,t),Q?U(e):u}function b(e){var n=e-h;return void 0===h||n>=t||n<0||F&&e-g>=d}function B(){var e=i();if(b(e))return Z(e);A=setTimeout(B,function(e){var n=t-(e-h);return F?l(n,d-(e-g)):n}(e))}function Z(e){return A=void 0,p&&c?U(e):(c=s=void 0,u)}function f(){var e=i(),n=b(e);if(c=arguments,s=this,h=e,n){if(void 0===A)return m(h);if(F)return clearTimeout(A),A=setTimeout(B,t),U(h)}return void 0===A&&(A=setTimeout(B,t)),u}return t=o(t)||0,r(n)&&(Q=!!n.leading,d=(F="maxWait"in n)?a(o(n.maxWait)||0,t):d,p="trailing"in n?!!n.trailing:p),f.cancel=function(){void 0!==A&&clearTimeout(A),g=0,c=h=s=A=void 0},f.flush=function(){return void 0===A?u:Z(i())},f}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=function(){let e=[];return{add(t){e.push(t)},remove(t){const n=e.indexOf(t);n>=0&&e.splice(n,1)},releaseAll(){const t=[];for(;e.length>0;){const n=e.shift();try{n()}catch(e){t.push(e)}}const n=t.length;if(n>0)throw new Error(`Failed to complete ${n} cleanup job${1===n?"":"s"}: ${t.map(e=>`<${e}>`).join(", ")}`)},empty(){e=[]}}};t.default=r},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;const i=(0,r(n(2)).default)("applySdpTransform");t.default=(e,t,n,r,o)=>{const a=e[t][n],l=`${t} ${n}`,c=`sdpTransforms (${"local offer"===l||"remote answer"===l?"publisher":"subscriber"}): ${t} ${n}`,s="local"===t?"created":"received";i.debug(`${c}: ${s}:\n${o}`);const d=a(r,o);return d.local===o?i.debug(c+": not modified"):i.debug(`${c}: modified to:\n${d.local}`),d}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(61));var o="function"==typeof(0,i.default)(void 0!==typeof window?window:global,"navigator.getDisplayMedia",(0,i.default)(void 0!==typeof window?window:global,"navigator.mediaDevices.getDisplayMedia"));t.default=o},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(){return function(e,t,n){const r=t.slice(),o=(0,i.default)(n);return function(t){let n=e,i=null;function a(e,r){t({message:e,newState:r,currentState:n,previousState:i})}function l(e){return t=e,-1===r.indexOf(t)?(a(`'${e}' is not a valid state`,e),!1):(l=e,!(!o[i=n]||-1===o[i].indexOf(l))||(a(`'${n}' cannot transition to '${e}'`,e),!1));var t,i,l}this.current=n,this.set=function(e){l(e)&&(i=n,this.current=e,n=e)}}}};var i=r(n(41))},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});const n=t.chromeExtensionHelper||(0,l.default)(),r=t.electronExtensionHelper||(0,c.default)(),A=t.Errors||a.default,h=t.firefoxExtensionHelper||s.default,g=t.getDisplayMediaExtensionHelper||d.default,Q=t.otError||(0,o.default)(),F=t.OTHelpers||u.default,p={extensionByKind:{},extensionClasses:{}};p.registerExtensionHelper=(e,t)=>{p.extensionClasses[e]=t,t.autoRegisters&&t.isSupportedInThisBrowser&&p.registerExtension(e)},p.registerExtension=function(e){if(null==p.extensionClasses[e])throw new Error("Unsupported kind passed to OT.registerScreenSharingExtension");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=p.extensionClasses[e].register(...n);p.extensionByKind[e]=i};const U=()=>{const e=(0,i.default)(Object.keys(p.extensionClasses).sort(e=>"electron"===e?-1:1),e=>p.extensionClasses[e].isSupportedInThisBrowser);return void 0===e?{}:{name:e,proto:p.extensionClasses[e],instance:p.extensionByKind[e]}};p.pickHelper=()=>U(),p.checkCapability=e=>{const t={supported:!1,extensionRequired:void 0,extensionRegistered:void 0,extensionInstalled:void 0,supportedSources:{}},n=U();if(void 0!==n.name){if(t.supported=!0,t.extensionRequired=n.proto.extensionRequired?n.name:void 0,t.supportedSources={screen:n.proto.sources.screen,application:n.proto.sources.application,window:n.proto.sources.window,browser:n.proto.sources.browser},!n.instance)return t.extensionRegistered=!1,t.extensionRequired&&(t.extensionInstalled=!1),void setTimeout(e.bind(null,t));t.extensionRegistered=!!t.extensionRequired||void 0,n.instance.isInstalled(n=>{t.extensionInstalled=t.extensionRequired||"Firefox"===F.env.name?n:void 0,e(t)})}else setTimeout(e.bind(null,t))},p.registerExtensionHelper("electron",r),p.registerExtensionHelper("getDisplayMedia",g),p.registerExtensionHelper("chrome",n),p.registerExtensionHelper("firefox",h);const m=()=>{};return p.getConstraints=t=>{const n=t.onAccessDialogOpened,r=void 0===n?m:n,i=t.onAccessDialogClosed,o=void 0===i?m:i,a=t.videoSource,l=t.constraints;return new e((e,t)=>{p.checkCapability(n=>{if(n.supported)if(!1===n.extensionRegistered)t(Q(A.SCREEN_SHARING_EXTENSION_NOT_REGISTERED,new Error("Screen Sharing support in this browser requires an extension, but one has not been registered.")));else if(n.extensionRequired&&!1===n.extensionInstalled)t(Q(A.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Screen Sharing support in this browser requires an extension, but the extension is not installed.")));else{const n=p.pickHelper();n.proto.getConstraintsShowsPermissionUI&&r(),n.instance.getConstraints(a,l,(r,i)=>{n.proto.getConstraintsShowsPermissionUI&&o(),r?t(r):e(i)})}else{let e="Screen Sharing is not supported in this browser";F.env.isElectron?e="Set the webPreferences.contextIsolation option of the Electron BrowserWindow to false or use a preload script to access the desktop capturer. For more information, see https://tokbox.com/developer/guides/screen-sharing/js/.":("Chrome"===F.env.name&&F.env.version>73||"Samsung"===F.env.name&&F.env.version>=14)&&"https:"!==(void 0!==typeof window?window:global).location.protocol&&(e="https:// is required for screen sharing"),t(Q(A.SCREEN_SHARING_NOT_SUPPORTED,new Error(e)))}})})},p};var i=r(n(77)),o=r(n(14)),a=r(n(6)),l=r(n(309)),c=r(n(687)),s=r(n(689)),d=r(n(316)),u=r(n(8))}).call(this,n(1))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.Errors||a.default,n=e.ExceptionCodes||i.default,r=e.otError||(0,o.default)(),l={ICEWorkflow:t.ICE_WORKFLOW_FAILED,NewPeerConnection:t.CREATE_PEER_CONNECTION_FAILED,SetRemoteDescription:t.SET_REMOTE_DESCRIPTION_FAILED,Subscribe:{404:t.STREAM_NOT_FOUND,[n.STREAM_LIMIT_EXCEEDED]:t.STREAM_LIMIT_EXCEEDED}};return function(e,i,o,a,c){const s=`${(o?o+": ":"")+c} PeerConnection with connection ${a} failed: ${i}`,d=l[o]||{},u="string"==typeof d?d:d[e],A="Publisher"===c?n.UNABLE_TO_PUBLISH:n.UNABLE_TO_SUBSCRIBE;if(!u){const e=new Error(s);return e.code=A,e}const h="ICEWorkflow"===o?"Publisher"===c?n.PUBLISHER_ICE_WORKFLOW_FAILED:n.SUBSCRIBER_ICE_WORKFLOW_FAILED:u===t.STREAM_LIMIT_EXCEEDED?n.STREAM_LIMIT_EXCEEDED:A;return r(u,new Error(s),h)}};var i=r(n(9)),o=r(n(14)),a=r(n(6))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.OTHelpers||i.default,n=(e.global||(void 0!==typeof window?window:global)).RTCPeerConnection;return function(e,r){"Firefox"===t.env.name&&n&&n.generateCertificate?n.generateCertificate({name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])}).catch(e=>{r(e)}).then(t=>{e.certificates=[t],r(void 0,e)}):setTimeout(()=>{r(void 0,e)})}};var i=r(n(8))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={bandwidthCriticalThreshold:7e4,bandwidthFairThreshold:0,packetLossCriticalThreshold:.15,packetLossCriticalThresholdMediumBw:.2,criticalCongestionPeriod:16e3};t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.parseStats=t.getVideoResolution=t.getVideoPacketStats=t.getVideoPacketLoss=t.getSelectedCandidatePairId=t.getBandwidth=t.getAudioPacketStats=t.getAudioPacketLoss=void 0;const r=(e,t)=>{const n=e.filter(e=>{let n=e.type,r=e.kind;return"outbound-rtp"===n&&r===t}),r=e.filter(e=>{let n=e.type,r=e.kind;return"remote-inbound-rtp"===n&&r===t}),i=r[0].timestamp,o=r[0].fractionLost,a=n.reduce((e,t)=>e+t.packetsSent,0),l=r.reduce((e,t)=>e+t.packetsLost,0);return{[t+"ReportTimestamp"]:i,[t+"PacketsSent"]:a,[t+"PacketsLost"]:l,[t+"FractionLost"]:o}},i=e=>e.filter(e=>{let t=e.type,n=e.kind;return"outbound-rtp"===t&&"video"===n}).filter(e=>void 0!==e.frameHeight&&void 0!==e.frameWidth).reduce((e,t)=>({width:Math.max(e.width,t.frameWidth),height:Math.max(e.height,t.frameHeight)}),{width:0,height:0});t.getVideoResolution=i;const o=e=>r(e,"audio");t.getAudioPacketStats=o;const a=e=>r(e,"video");t.getVideoPacketStats=a;const l=e=>{const t=e.find(e=>"transport"===e.type);return null==t?void 0:t.selectedCandidatePairId};t.getSelectedCandidatePairId=l;const c=e=>{const t=((e,t)=>{if(t){const n=e.find(e=>{let n=e.id,r=e.type;return n===t&&"candidate-pair"===r});return null==n?void 0:n.availableOutgoingBitrate}})(e,l(e));if(void 0!==t)return t;const n=e.find(e=>{let t=e.type,n=e.availableOutgoingBitrate;return"candidate-pair"===t&&void 0!==n});return null==n?void 0:n.availableOutgoingBitrate};t.getBandwidth=c;t.parseStats=e=>{const t=o(e),n=t.audioPacketsSent,r=t.audioPacketsLost,l=t.audioReportTimestamp,s=t.audioFractionLost,d=a(e),u=d.videoPacketsSent,A=d.videoPacketsLost,h=d.videoReportTimestamp;return{bandwidth:c(e),audioFractionLost:s,audioReportTimestamp:l,audioPacketsSent:n,audioPacketsLost:r,videoReportTimestamp:h,videoPacketsSent:u,videoPacketsLost:A,videoResolution:i(e)}};const s=(e,t,n)=>{const r=t[e+"PacketsSent"]-n[e+"PacketsSent"],i=t[e+"PacketsLost"]-n[e+"PacketsLost"];return o=i,0===(a=r)?0:o/a;var o,a};t.getAudioPacketLoss=(e,t)=>s("audio",e,t);t.getVideoPacketLoss=(e,t)=>s("video",e,t)},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(51)),o=r(n(708)),a=r(n(12)),l=r(n(58)),c=r(n(305)),s=n(176);function d(e,t){if(!t)return{};const n=t.filter(t=>t.id===e.mediaTrackId);return n.length?n[0]:{}}function u(e,t){return"packetsLost"in t?e+t.packetsLost:e}const A=["packetsSent","packetsLost","bytesSent"],h=e=>(0,i.default)(e,A),g=["packetsReceived","packetsLost","bytesReceived"],Q=e=>(0,i.default)(e,g),F=A.concat(["framerateMean","googFrameRateSent","googFrameRateReceived","googFrameRateInput","googFrameRateOutput","framesEncoded","framesDecoded"]);function p(e,t,n,r){const i=(n-r)/1e3,o=e-t;return i>0?Math.round(8*o/i):0}var U=()=>{const e={};function t(t,n){let r=function(e){return Number(e.framesPerSecond||e.framerateMean||e.googFrameRateSent||e.googFrameRateReceived||e.googFrameRateInput||e.googFrameRateOutput||0)}(t);if(r)return r;const i=function(e){return Number(e.framesEncoded||e.framesDecoded)}(t);if(!i)return;const o=e[t.id]?e[t.id].frames:0,a=e[t.id]?e[t.id].timestamp:n;return r=(0,c.default)({currentStatFrames:i,currentTimestamp:t.timestamp,prevStatFrames:o,prevTimestamp:a}),e[t.id]={frames:i,timestamp:t.timestamp},r}function n(n,r,i){const o=i?"bytesSent":"bytesReceived",a=i?"headerBytesSent":"headerBytesReceived",l=e[n.id]||{timestamp:r,bytes:0,headerBytes:0},c=l.timestamp,s=l.bytes,d=l.headerBytes,u=l.frameRate,A=l.bitrate,h=l.totalBitrate;if(c===n.timestamp)return{frameRate:u,bitrate:A,totalBitrate:h};const g=t(n,r),Q=p(n[o],s,n.timestamp,c),F=p(n[o]+n[a],s+d,n.timestamp,c);return e[n.id]=Object.assign({},e[n.id],{bytes:n[o],headerBytes:n[a],timestamp:n.timestamp,frameRate:g,bitrate:Q,totalBitrate:F}),{frameRate:g,bitrate:Q,totalBitrate:F}}const r={isVideoStat:(e,t)=>"video"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"video"===e.mediaType||"googFrameWidthReceived"in e||"googFrameWidthInput"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Video")||"inboundrtp"===e.type&&0!==d(e,t).frameWidth,isAudioStat:(e,t)=>"audio"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"audio"===e.mediaType||"audioInputLevel"in e||"audioOutputLevel"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Audio")||"inboundrtp"===e.type&&0===d(e,t).frameWidth,isInboundStat:e=>"bytesReceived"in e||"packetsReceived"in e,isOutboundStat:e=>"bytesSent"in e||"packetsSent"in e,isVideoTrackStat:e=>"track"===e.type&&(e.frameHeight>0||e.frameWidth>0||e.framesCorrupted>0||e.framesDecoded>0||e.framesPerSecond>0||e.framesSent>0||e.framesReceived>0),isVideoRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"video"===e.kind,isAudioRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"audio"===e.kind,isVideoInboundRtpStat:e=>"inbound-rtp"===e.type&&"video"===e.kind,parseStatCategory(e,t,i){void 0===t&&(t=r.isVideoStat(e));const o={packetsLost:0,packetsReceived:0,bytesReceived:0};if("packetsReceived"in e&&(o.packetsReceived=parseInt(e.packetsReceived,10)),"packetsLost"in e&&(o.packetsLost=parseInt(e.packetsLost,10)),"bytesReceived"in e&&(o.bytesReceived=parseInt(e.bytesReceived,10)),t){if("framerateMean"in e?o.frameRate=Number(e.framerateMean):"googFrameRateOutput"in e?o.frameRate=Number(e.googFrameRateOutput):"googFrameRateInput"in e&&(o.frameRate=Number(e.googFrameRateInput)),o.width=e.frameWidth,o.height=e.frameHeight,i){var a;const t=null==(a=i.filter(e=>"codec"===e.type&&e.mimeType.includes("video")).find(t=>t.id===e.codecId))?void 0:a.mimeType.split("/")[1];t&&(o.codec=t)}void 0!==e.pauseCount&&(o.pauseCount=e.pauseCount),void 0!==e.freezeCount&&(o.freezeCount=e.freezeCount),void 0!==e.totalPausesDuration&&(o.totalPausesDuration=1e3*e.totalPausesDuration),void 0!==e.totalFreezesDuration&&(o.totalFreezesDuration=1e3*e.totalFreezesDuration);const t=n(e,Date.now(),!1);t&&(o.frameRate=t.frameRate,o.bitrate=t.bitrate,o.totalBitrate=t.totalBitrate)}return o},getVideoPacketsLost:e=>e.filter(t=>r.isVideoRemoteInboundRtpStat(t,e)).reduce(u,0),getAudioPacketsLost:e=>e.filter(t=>r.isAudioRemoteInboundRtpStat(t,e)).reduce(u,0),normalizeTimestamp:(e,t)=>(void 0===t&&(t=Date.now()),(0,a.default)(e)&&"getTime"in e?e.getTime():Math.abs(e/(1e3*t)-1)<.05?e/1e3:e),normalizeStats:(0,l.default)((function(i,a,l){void 0===a&&(a=!0);const c=i.filter(e=>r.isVideoStat(e,i)&&r.isInboundStat(e)===a),d=i.find(e=>r.isAudioStat(e,i)&&r.isInboundStat(e)===a),u=c[0];if(!d&&!u)throw new Error("could not find stats for either audio or video");const A=r.normalizeTimestamp(u?u.timestamp:d.timestamp),g={timestamp:A};u&&!a&&void 0===u.packetsLost&&(u.packetsLost=r.getVideoPacketsLost(i)),d&&!a&&void 0===d.packetsLost&&(d.packetsLost=r.getAudioPacketsLost(i));const p=a?Q:h;if(c&&c.length>0){const d=((e,t,n)=>{const r={timestamp:t,id:n};return F.forEach(t=>{r[t]=e.reduce((e,n)=>e+Number(n[t]||0),0)}),r})(c,A,"acc"+u.id);if(g.video=Object.assign({frameRate:t(d,l)},(0,o.default)(p(d),Number)),!a){const t=i.filter(e=>"codec"===e.type&&e.mimeType.includes("video"));g.video.layers=c.filter(e=>!r.isVideoRemoteInboundRtpStat(e)).map(e=>{var r;const i=Object.assign({width:e.frameWidth,height:e.frameHeight,codec:null==(r=t.find(t=>t.id===e.codecId))?void 0:r.mimeType.split("/")[1]},n(e,l,!0),{scalabilityMode:e.scalabilityMode});return e.qualityLimitationReason&&"none"!==e.qualityLimitationReason&&(i.qualityLimitationReason=e.qualityLimitationReason),i}).sort((e,t)=>{const n=(e.width||0)*(e.height||0);return(t.width||0)*(t.height||0)-n}),e["acc"+u.id]=Object.assign({},e["acc"+u.id],{layers:g.video.layers.length}),g.transportStats={connectionEstimatedBandwidth:(0,s.getBandwidth)(i)}}}return d&&(g.audio=(0,o.default)(p(d),Number)),g}))};return r};t.default=U},function(e,t,n){"use strict";(function(e){t.__esModule=!0,t.default=function(t){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return new e((e,n)=>{t(...r,(function(t){if(t)n(t);else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];1!==i.length?e(i):e(i[0])}}))})}}}).call(this,n(1))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),a=r(n(26)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=I(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(115)),c=r(n(7)),s=r(n(2)),d=r(n(60)),u=r(n(3)),A=r(n(718)),h=r(n(719)),g=r(n(8)),Q=r(n(110)),F=r(n(720)),p=r(n(721)),U=r(n(722)),m=r(n(723)),b=r(n(725)),B=r(n(180)),Z=n(333),f=r(n(181)),R=r(n(275));function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(I=function(e){return e?n:t})(e)}const y=f.default.VIDEO_BUFFER_TIMEOUT,V=f.default.VIDEO_LOADING_TIMEOUT,C=(0,s.default)("WidgetView");(0,Q.default)();var W=function(e){let t=void 0===e?{}:e,n=t.logging,r=void 0===n?C:n,s=t.OTHelpers,f=void 0===s?g.default:s,I=t.waitForVideoToBePlaying,W=void 0===I?m.default:I,E=t.VideoElementFacade,S=void 0===E?(0,Q.default)():E,v=t.env,J=void 0===v?u.default:v;const N=(0,h.default)({window:void 0!==typeof window?window:global}),G=e=>{if(e.isCanceled())throw r.debug("bindVideo bailing due to cancellation"),new l.CancellationError("CANCEL")};return function(){function e(e,t){let n=void 0===t?{}:t,i=n.insertDefaultUI,o=void 0===i||i,a=n.width,l=void 0===a?264:a,s=n.height,u=void 0===s?198:s,h=n.fitMode,g=void 0===h?"cover":h,Q=n.mirror,F=void 0!==Q&&Q,m=n.insertMode,b=n.classNames,B=n.style,Z=n.widgetType,R=n.initials;this._videoElementFacade=void 0,this._container=void 0,this._posterContainer=document.createElement("div"),this._widgetContainer=document.createElement("div"),this._loading=!0,this._audioOnly=!1,this._showPoster=void 0,this._poster=void 0,this._cancelBind=void 0,(0,c.default)(this),!1===/^(contain|cover)$/.test(g)&&r.warn(`Invalid fit value "${g}" passed. Only "contain" and "cover" can be used.`),this._widgetType=Z,this._fitMode=g,this._insertDefaultUI=o;const I=(0,d.default)(this._widgetContainer);if(I.on("click",this.userGesture.bind(this)),I.on("touchstart",this.userGesture.bind(this),!!N&&{passive:!0}),this.once("destroy",()=>I.removeAll()),this._widgetContainer.classList.add("OT_widget-container"),this._widgetContainer.style.width="100%",this._widgetContainer.style.height="100%",!1!==o){this._container=(0,p.default)(e,m),J.isSafari&&J.isiOS&&J.iOSVersion&&J.iOSVersion<11.2&&this._container.classList.add("OT_ForceContain"),this._container.style.width=(0,A.default)(l),this._container.style.height=(0,A.default)(u),this._container.style.overflow="hidden",(0,U.default)(this._container),F&&f.addClass(this._container,"OT_mirrored"),b&&b.trim().split(/\s+/).forEach(e=>this._container.classList.add(e)),this._container.classList.add("OT_loading"),this._container.classList.add("OT_fit-mode-"+g),this._container.appendChild(this._widgetContainer);const t=f(this._container).observeSize(()=>(0,U.default)(this._container))[0],n=f.observeNodeOrChildNodeRemoval(this._container,e=>{if(!this._videoElementFacade)return;e.some(e=>e===this._widgetContainer||e===this._videoElementFacade.domElement())&&this.destroyVideo()});this.once("destroy",()=>{r.debug("disconnecting observers"),t.disconnect(),n.disconnect()})}this._posterContainer.classList.add("OT_video-poster"),this._widgetContainer.appendChild(this._posterContainer);const y=document.createElement("div");y.classList.add("OT_video-loading");const V=document.createElement("div");V.classList.add("OT_video-loading-spinner"),y.appendChild(V),this._widgetContainer.appendChild(y);B&&B.backgroundImageURI?this.setBackgroundImageURI(B.backgroundImageURI):R&&this.setInitials(R)}var t=e.prototype;return t.addError=function(e,t,n){var r;if(this._container&&(this._container.innerHTML=`<p>${e}${t?` <span class="ot-help-message">${t}</span>`:""}</p>`,f.addClass(this._container,n||"OT_subscriber_error"),(null==(r=this._container.querySelector("p"))?void 0:r.offsetHeight)>this._container.offsetHeight)){const e=this._container.querySelector("span");e&&(e.style.display="none")}},t.destroy=function(){this.emit("destroy"),this.destroyVideo(),this._container&&(f.removeElement(this._container),this._container=null)},t.setBackgroundImageURI=function(e){e?(f.css(this._posterContainer,"backgroundImage",`url(${e})`),f.css(this._posterContainer,"backgroundSize","contain"),f.css(this._posterContainer,"opacity","1.0")):this._lastInitials?this.setInitials(this._lastInitials):(f.css(this._posterContainer,"backgroundImage",null),f.css(this._posterContainer,"backgroundSize",null),f.css(this._posterContainer,"opacity",null))},t.setInitials=function(e){const t=(0,F.default)(e),n=(new XMLSerializer).serializeToString(t);f.css(this._posterContainer,"backgroundImage",`url('data:image/svg+xml,${n}')`),f.css(this._posterContainer,"backgroundSize","auto 55%"),f.css(this._posterContainer,"opacity","1.0"),this._lastInitials=e},t.isAudioBlocked=function(){return Boolean(this._videoElementFacade&&this._videoElementFacade.isAudioBlocked())},t.unblockAudio=function(){return this._videoElementFacade.unblockAudio()},t.userGesture=function(){this.isAudioBlocked()&&(0,B.default)().then(()=>r.debug("Successfully unblocked audio"),e=>r.error("Error retrying audio on user interaction:",e))},t.setAudioBlockedUi=function(e){this._container&&(e?this._container.classList.add("OT_container-audio-blocked"):this._container.classList.remove("OT_container-audio-blocked"))},t.rebindSrcObject=function(){this._videoElementFacade&&this._videoElementFacade._rebindSrcObject()},t.pauseAndPlayVideoElement=function(){this._videoElementFacade&&this._videoElementFacade._pauseAndPlay()},t._loadVideoBuffer=function(){var e=(0,o.default)(i.default.mark((function e(t,n,r,o){var a,l,c,s,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===o&&(o={}),l=null!=(a=o.createElement)?a:R.default,c=!1,(s=l()).srcObject=t,e.prev=5,J.isChromium&&(t.getVideoTracks()[0].enabled=!0),d=s.play(),e.next=10,W({defaultVideoElementFacade:s,maxWaitTime:n,isBufferedStream:r});case 10:return c=e.sent,e.next=13,d;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),J.isChromium&&t.getVideoTracks().length&&(t.getVideoTracks()[0].enabled=!1);case 18:return s.srcObject=null,s.remove(),e.abrupt("return",c);case 21:case"end":return e.stop()}}),e,null,[[5,15]])})));return function(t,n,r,i){return e.apply(this,arguments)}}(),t._emitBindEvent=function(e,t,n){this.emit("bindEvent",e,t,n)},t._createVideoElementFacade=function(e){let t=e._inject,n=e.audioVolume,i=e.fallbackText,o=e.muted;this._videoElementFacade=new S({defaultAudioVolume:parseFloat(n),fallbackText:i,fitMode:this._fitMode,_inject:t,muted:o,widgetType:this._widgetType});const a=(0,d.default)(this._videoElementFacade);if(this._videoFacadeEvents=a,a.on("error",()=>{this.trigger("error")}),a.on("videoDimensionsChanged",(e,t)=>{this.trigger("videoDimensionsChanged",e,t)}),a.on("mediaStopped",e=>{this.trigger("mediaStopped",e)}),a.on("audioBlocked",()=>this.trigger("audioBlocked")),a.on("audioUnblocked",()=>this.trigger("audioUnblocked")),this._videoElementFacade.audioChannelType("telephony"),r.debug("Appending the video facade"),this._videoElementFacade.appendTo(this._widgetContainer),void 0!==n)try{this._videoElementFacade.setAudioVolume(n)}catch(e){r.warn("bindVideo "+e)}},t._bindToStream=function(){var e=(0,o.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._videoElementFacade.bindToStream(t);case 3:e.next=14;break;case 5:if(e.prev=5,e.t0=e.catch(0),!n.isCanceled()){e.next=12;break}throw r.debug("Refusing to destroyVideo as bindVideo was cancelled"),new l.CancellationError("CANCEL");case 12:throw this.destroyVideo(),e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),t._getNewBindCancellation=function(){this._cancelBind&&(r.debug("Cancelling last bindVideo request"),this._cancelBind.cancel());const e=new l.default;return this._cancelBind=e,this.once("destroy",()=>e.cancel()),e},t._triggerVideoElementCreated=function(){const e=e=>{this.trigger("videoElementCreated",e),this._insertDefaultUI&&f.addClass(e,"OT_video-element")};this._videoElementFacade.domElement()?e(this._videoElementFacade.domElement()):this._videoFacadeEvents.on("videoElementCreated",t=>{e(t)})},t._waitForVideoResolution=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.audioOnly()||!(t.getVideoTracks().length>0)){e.next=5;break}return r.debug("Waiting for correct resolution"),e.next=4,(0,b.default)(this._videoElementFacade,5e3);case 4:r.debug(`Resolution: ${this._videoElementFacade.videoWidth()}x${this._videoElementFacade.videoHeight()}`);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t._tryToLoadVideoBuffer=function(){var e=(0,o.default)(i.default.mark((function e(t,n,r,o){var a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:G(n),this._emitBindEvent("loadVideoBuffer","Attempt"),a=n.onCancel(()=>this._emitBindEvent("loadVideoBuffer","Cancel")),l=Math.ceil(V/y),c=!1;case 5:if(c||!l){e.next=13;break}return e.next=8,this._loadVideoBuffer(t,y,o);case 8:c=e.sent,G(n),l--,e.next=5;break;case 13:if(a(),c){e.next=20;break}if(this._emitBindEvent("loadVideoBuffer","Failure"),!r){e.next=19;break}throw(0,Z.createAmrVideoBufferError)();case 19:return e.abrupt("return");case 20:this._emitBindEvent("loadVideoBuffer","Success"),this._videoFacadeEvents.on("bindEvent",(e,t,n)=>{this._emitBindEvent(e,t,n)});case 22:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),t.bindVideo=function(){var e=(0,o.default)(i.default.mark((function e(t,n,o){var a,l,c,s,d,u,A,h,g;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.audioVolume,l=n.muted,c=n.fallbackText,s=n.hasVideo,d=n.isSubscribingToVideo,u=n._inject,void 0===o&&(o=!1),r.debug("bindVideo ",{webRTCStream:t}),A=!!this._videoElementFacade,h=this._getNewBindCancellation(),A||this._createVideoElementFacade({_inject:u,audioVolume:a,fallbackText:c,muted:l}),!(t instanceof MediaStream&&s&&d)){e.next=9;break}return e.next=9,this._tryToLoadVideoBuffer(t,h,o,s&&d);case 9:return e.next=11,this._bindToStream(t,h);case 11:return A||this._triggerVideoElementCreated(),G(h),g=W({defaultVideoElementFacade:this._videoElementFacade,maxWaitTime:5e3}),e.next=16,this._waitForVideoResolution(t);case 16:return r.debug("Waiting for video to be playing"),e.next=19,g;case 19:r.debug("Video is playing"),G(h);case 21:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.bindAudioTrackOnly=function(){this._videoElementFacade&&this._videoElementFacade.bindAudioTrackOnly()},t.destroyVideo=function(){this._videoElementFacade&&(this._videoElementFacade.destroy(),this._videoElementFacade=null)},t.video=function(){return this._videoElementFacade},t.showPoster=function(e){return void 0===e?!f.isDisplayNone(this._posterContainer):(this._showPoster=e,f[e?"show":"hide"](this._posterContainer),this.showPoster())},t.poster=function(e){return void 0===e?f.css(this._posterContainer,"backgroundImage"):(this._poster=e,f.css(this._posterContainer,"backgroundImage",`url(${e})`),this.poster())},t.prepareForStreamTransition=function(){var e;null==(e=this._videoElementFacade)||e.prepareForStreamTransition()},t.loading=function(e){return void 0===e?this._loading:(this._loading=Boolean(e),this._container&&this._container.classList[e?"add":"remove"]("OT_loading"),this.loading())},t.audioOnly=function(e){return void 0===e?this._audioOnly:(this._audioOnly=e,this._container&&this._container.classList[e?"add":"remove"]("OT_audio-only"),this.audioOnly())},t.domId=function(){return this._container&&this._container.getAttribute("id")},t.setSinkId=function(e){if(this._videoElementFacade)return this._videoElementFacade.setSinkId(e)},(0,a.default)(e,[{key:"domElement",get:function(){return this._container}},{key:"videoElement",get:function(){return this._videoElementFacade&&this._videoElementFacade.domElement()||void 0}},{key:"width",get:function(){return this.videoElement&&this.videoElement.offsetWidth}},{key:"height",get:function(){return this.videoElement&&this.videoElement.offsetHeight}}]),e}()};t.default=W},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(27));t.default=()=>e.all(i.default.subscribers.where().map(e=>{if(e.isAudioBlocked())return e._.unblockAudio()}))}).call(this,n(1))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={KEEP_SENDING_MEDIA_AFTER_TRANSITIONED:5e3,VIDEO_LOADING_TIMEOUT:5e3,TRANSITION_TIMEOUT:6e3,KEEP_SENDING_MEDIA_TO_KEEP_ALIVE:3e3,KEEP_SENDING_RTCP_DELAY:3e4,VIDEO_BUFFER_TIMEOUT:2e3};t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,i=n(731),o=(r=i)&&r.__esModule?r:{default:r};function a(e){return"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return a(e)?(0,o.default)(e):e},t.isAsync=a,t.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},t.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default=e=>"P2P"===e?"RELAYED":"ROUTED"},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5));const a=(0,r(n(2)).default)("MediaProcessorConnector");let l=function(e){var t=this;this.setTrack=function(){var e=(0,o.default)(i.default.mark((function e(n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,t.connector.setTrack(n);case 4:r=e.sent,t.originalTrack=n,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),a.error("Error setting track: "+e.t0);case 11:return e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this.destroy=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.connector.destroy();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),a.warn("Error destroying connector: "+e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))),this.stopOriginalTrack=()=>{this.originalTrack&&(this.originalTrack.stop(),this.originalTrack=null)},this.connector=e};l.isValidConnector=e=>"function"==typeof(null==e?void 0:e.setTrack)&&"function"==typeof(null==e?void 0:e.destroy);var c=l;t.default=c},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});let n=t,r=(0,l.default)({},((0,a.default)(n),n));["processPubOptions"].forEach(e=>{(0,p.default)(r[e],e+" dependency must be injected into Publisher")});const z=r.AnalyticsHelper||k.default,Xe=r.createAudioFallbackCoordinator||R.default,De=r.calculateCapableSimulcastStreams||ee.default,xe=r.createChromeMixin||(0,te.default)(),Me=r.deviceHelpers||(0,W.default)(),He=r.EnvironmentLoader||ne.default,Ke=r.Errors||M.default,Le=r.Events||(0,re.default)(),ze=r.ExceptionCodes||v.default,Oe=r.interpretPeerConnectionError||(0,ie.default)(),je=r.IntervalRunner||S.default,Pe=r.logging||(0,y.default)("Publisher"),_e=r.Microphone||(0,oe.default)(),qe=r.otError||(0,D.default)(),$e=r.OTErrorClass||J.default,et=r.OTHelpers||ae.default,tt=r.parseIceServers||le.parseIceServers,nt=r.PUBLISH_MAX_DELAY||ce.default,rt=r.PublisherPeerConnection||(0,se.default)(),it=r.PublishingState||(0,ue.default)(),ot=r.StreamChannel||Ae.default,at=r.systemRequirementsFactory||he.default,lt=r.VideoOrientation||(0,G.default)(),ct=r.WidgetView||ke,st=r.global||(void 0!==typeof window?window:global),dt=r.createSendMethod||ge.default,ut=r.MediaProcessor||Qe.default,At=Fe.default,ht=r.createVonageNoiseSuppression||B.createVonageNoiseSuppression,gt=r.setScalabilityMode||Ce.default,Qt=r.addAudioInputDevicesChangeListenerFactory||me.default,Ft=r.shouldLogMediaProcessorEvents||pe.default,pt=r.processPubOptions,Ut=r.publisherSenderStats||Ue.default,mt=Object.assign({},Re.default,r.AMRStateDurations),bt=mt.KEEP_SENDING_MEDIA_AFTER_TRANSITIONED,Bt=mt.KEEP_SENDING_MEDIA_TO_KEEP_ALIVE,Zt=mt.KEEP_SENDING_RTCP_DELAY;return function(t){var n=this;void 0===t&&(t={});let r=(0,I.default)({});const a=new m.default,l=(0,Ze.default)(),p=e=>a.get(e);(0,I.default)(this);const B=(0,K.default)(),R=(0,K.default)();let y=new z;const W=at();let S,v,J,G,k,D,M,ee,te,ne,re,ie;W.check()||W.upgrade();let oe,ae,le,ce,se,ue=!1;const Ae={},he={};let ge;let Qe,Fe,pe,Ue,me,Re,Ce,ke,mt,ft,Rt,It,yt=!1;const Vt=!0===t.publishSenderStats,Ct=()=>this.session||It||{isConnected:()=>!1},Wt=()=>this.streamId||"",Et=[],St=new ut,vt=new be.default;function Jt(){var e,t,n;return{connectionId:null!=(e=Ct())&&e.isConnected()?null==(t=Ct())||null==(n=t.connection)?void 0:n.connectionId:null,streamId:Wt(),widgetType:"Publisher"}}this.once("publishComplete",e=>{var t,n;e||(ue=!0,oe=oe||null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.p2pEnabled?"P2P":"MANTIS")}),this.on("sourceStreamIdChanged",e=>{oe=e,l.completeTransitionTo(oe)}),this.on("audioAcquisitionProblem",e=>{let t=e.method;nn("publisher:audioAcquisitionProblem","Event",{didPublishComplete:ue,method:t})});const Nt=e=>{const t=Object.keys(Ke).map(e=>Ke[e]),n=qe(t.indexOf(e.name)>-1?e.name:Ke.MEDIA_ERR_ABORTED,e,ze.UNABLE_TO_PUBLISH);Pe.error(`onStreamAvailableError ${n.name}: ${n.message}`),k.set("Failed"),S&&(S.destroy(),S=null);const r={failureReason:"GetUserMedia",failureCode:ze.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to access camera/mic: "+n.message};on("Failure",{},r),$e.handleJsException({error:n,errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:y}),this.trigger("publishComplete",n)},Gt=e=>{const t=(0,d.default)(e);t.code=ze.UNABLE_TO_PUBLISH,Pe.error("OT.Publisher.onScreenSharingError "+t.message),k.set("Failed"),t.message="Screensharing: "+t.message,this.trigger("publishComplete",t),on("Failure",{},{failureReason:"ScreenSharing",failureMessage:t.message}),S&&(S.destroy(),S=null)},Xt=e=>{const t=(0,d.default)(e);let n;try{n=window.self!==window.top}catch(e){}"https:"!==et.env.protocol&&(zt?t.message+=" Note: https:// is required for screen sharing.":(0,w.default)()&&"localhost"!==et.env.hostName&&(t.message+=` Note: ${et.env.name} requires HTTPS for camera and microphone access.`)),n&&!zt&&(t.message+=" Note: Check that the iframe has the allow attribute for camera and microphone"),Pe.error(t.message),k.set("Failed"),t.message="OT.Publisher Access Denied: Permission Denied: "+t.message,t.code=ze.UNABLE_TO_PUBLISH,S&&(S.destroy(),S=null),on("Cancel",{reason:"AccessDenied"}),this.trigger("publishComplete",t),this.dispatchEvent((0,Je.default)("device","while initializing"))},kt=e=>{e instanceof Error||/^\[object .*Error\]$/.test(Object.prototype.toString.call(e))||(e=new Error("Unknown error has occurred. Stream is not available."));throw e.name===Ke.USER_MEDIA_ACCESS_DENIED||e.name===Ke.NOT_SUPPORTED&&e.originalMessage.match(/Only secure origins/)?Xt(e):pt.isScreenSharing?Gt(e):Nt(e),e},Tt=()=>{nn("accessDialog","Opened"),this.dispatchEvent(new H.default(X.default.ACCESS_DIALOG_OPENED,!0))},Yt=()=>{nn("accessDialog","Closed"),this.dispatchEvent(new H.default(X.default.ACCESS_DIALOG_CLOSED,!1))},wt=(0,U.default)(),Dt={};let xt=!1,Mt={},Ht=!1,Kt=pt(t,"OT.Publisher",()=>k&&k.isDestroyed());Kt.on({accessDialogOpened:Tt,accessDialogClosed:Yt});const Lt=Kt,zt=Lt.isScreenSharing,Ot=Lt.isCustomAudioTrack,jt=Lt.isCustomVideoTrack,Pt=Lt.shouldAllowAudio,_t=Lt.properties,qt=Lt.getUserMedia;function $t(e){e.forEach(e=>e())}Object.defineProperty(this,"loudness",{writable:!1,value:void 0,configurable:!0});const en=(e,t,n)=>e.addEventListener?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{};(function(){const e=[];r.on("streamDestroy",()=>$t(e)),r.on("streamChange",()=>{$t(e);const t=v.getAudioTracks().map(e=>en(e,"ended",()=>{Ht=!0,this.trigger("audioAcquisitionProblem",{method:"trackEndedEvent"})}));e.splice(0,e.length,...t)})}).call(this),function(){const e=[];r.on("streamDestroy",()=>$t(e)),r.on("streamChange",()=>{$t(e),tn()||v.getTracks().forEach(t=>{t.addEventListener&&(e.push(en(t,"mute",()=>{Hn()})),e.push(en(t,"unmute",e=>{var t;C.default.isIosWebView&&"video"===e.target.kind&&(null==(t=S)||t.rebindSrcObject());Hn()})))})})}();const tn=()=>{if(zt)return!0;const e=["text","detail"].includes(_t.videoContentHint);return jt&&e},nn=t.logAnalyticsEvent||((e,t,n,r,i)=>{let o=(0,s.default)({action:e,variation:t,payload:n},Jt(),r);"Failure"===t&&(o=(0,s.default)(Mt,o)),Mt=(0,h.default)(o,"sessionId","connectionId","partnerId"),y.logEvent(o,i)}),rn=()=>{if(!Ft(this.session))return void St.disableLogging();const e=this.session.apiKey;St.enableLogging(e)},on=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"Non-fatal"!==n.failureReason)if("Attempt"===e&&(M=(new Date).getTime(),Rt&&(Rt.stop(),Pe.error("_connectivityAttemptPinger should have been cleaned up")),Rt=new je(()=>{nn("Publish","Attempting",t,Object.assign({},Jt(),n))},.2,6)),"Failure"===e||"Success"===e||"Cancel"===e)Rt?(Rt.stop(),Rt=void 0):Pe.warn(`Received connectivity event: "${e}" without "Attempt"`),nn("Publish",e,Object.assign({videoInputDevices:te,audioInputDevices:ee,videoInputDeviceCount:te?te.length:void 0,audioInputDeviceCount:ee?ee.length:void 0,selectedVideoInputDeviceId:ne,selectedAudioInputDeviceId:re},t),Object.assign({attemptDuration:(new Date).getTime()-M},n));else if("Attempt"===e){let r="default";_t.preferredVideoCodecs&&(r="automatic"===_t.preferredVideoCodecs?"automatic":_t.preferredVideoCodecs.join(",").toUpperCase()),nn("Publish",e,t,Object.assign({},n,{preferredVideoCodecs:r}))}else nn("Publish",e,t,n)},an=(e,t)=>{nn("ICERestart",e,t)},ln=(e,t,n)=>{"Attempt"===t?(Ae[e]=(new Date).getTime(),nn(e,t,n)):"Failure"!==t&&"Success"!==t||nn(e,t,n,{attemptDuration:(new Date).getTime()-Ae[e]})},cn=function(e,t){void 0===t&&(t={}),ln("RoutedToRelayedTransition",e,t)},sn=function(e,t){void 0===t&&(t={}),ln("RelayedToRoutedTransition",e,t)},dn=(0,g.default)(()=>{nn("GetStats","Called")}),un=(0,g.default)(()=>{nn("GetRtcStatsReport","Called")}),An=e=>{var n,r,i,o;let a=e.parsedStats,l=e.simulcastEnabled,c=e.remoteConnectionId,d=e.peerId,u=e.sourceStreamId;const h={peerId:d,widgetType:"Publisher",connectionId:null!=(n=this.session)&&n.isConnected()?null==(r=this.session)||null==(i=r.connection)?void 0:i.connectionId:null,streamId:this.streamId,width:S.width,height:S.height,audioTrack:v&&v.getAudioTracks().length>0,hasAudio:Mn(),publishAudio:_t.publishAudio,videoTrack:v&&v.getVideoTracks().length>0,hasVideo:xn(),publishVideo:_t.publishVideo,publishSenderStats:Vt,audioSource:Ot?"Custom":void 0,duration:J?Math.round((Date.now()-J)/1e3):0,remoteConnectionId:c,scalableVideo:l,sourceStreamId:(0,$.default)(u),publisherAudioFallbackEnabled:(null==(o=_t.audioFallback)?void 0:o.publisher)||!1,cpuPerformanceState:this.session._.getCpuPerformanceState()};let g=(zt&&jt?"Screen":zt&&t.videoSource)||jt&&"Custom"||_t.constraints.video&&"Camera"||null;(0,A.default)(g)&&(g=(0,Q.default)(g)),h.videoSource=g;const F={videoWidth:this.videoWidth(),videoHeight:this.videoHeight()},p=(0,s.default)({},h,F,a);y.logQOS(p),this.trigger("qos",p)},hn=()=>{var e,t;let n=(null==(e=_t.videoDimensions)?void 0:e.width)||Ye,r=(null==(t=_t.videoDimensions)?void 0:t.height)||we;if(_t.publishVideo){var i;const e=null==(i=S)?void 0:i.video();n=(null==e?void 0:e.videoWidth())||n,r=(null==e?void 0:e.videoHeight())||r}return{width:n,height:r}},gn=()=>{k.isDestroyed()?S&&S.destroyVideo():(Pe.debug("OT.Publisher.onLoaded; resolution:",`${this.videoWidth()}x${this.videoHeight()}`),k.set("MediaBound"),(0,j.default)().catch(Pe.error),S.loading(!!this.session&&!this.stream),xt=!0)},Qn=e=>{const t=qe(Ke.CONNECT_FAILED,e,ze.P2P_CONNECTION_FAILED);t.message="OT.Publisher PeerConnection Error: "+t.message,on("Failure",{},{failureReason:"PeerConnectionError",failureCode:t.code,failureMessage:t.message}),k.set("Failed"),this.trigger("publishComplete",t),$e.handleJsException({error:t,target:this,analytics:y})},Fn=()=>{v&&(r.emit("streamDestroy"),st.MediaStreamTrack&&st.MediaStreamTrack.prototype.stop?v.getTracks().forEach(e=>e.stop()):v.stop())},pn=()=>{const e=C.default.isiOS&&C.default.iOSVersion>=15&&C.default.iOSVersion<15.2,t=v.getVideoTracks()[0];if(!e||!t)return;document.addEventListener("visibilitychange",()=>{!document.hidden&&S&&S.rebindSrcObject()})},Un=()=>{const e=C.default.isiOS&&C.default.iOSVersion>=13.3,t=v.getAudioTracks()[0];e&&t&&(t.onmute=()=>Nr(t),t.onunmute=()=>Gr(t))},mn=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={muted:!0},S){e.next=3;break}throw new Error("Cannot bind video after widget view has been destroyed");case 3:return e.abrupt("return",S.bindVideo(v,t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bn=function(){var e=(0,o.default)(i.default.mark((function e(t){var o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Pe.debug("OT.Publisher.onStreamAvailable"),k.set("BindingMedia"),void 0!==_t.videoContentHint&&(0,N.setVideoContentHint)(t,_t.videoContentHint),Fn(),v=t,!_t.videoFilter){e.next=14;break}return e.prev=6,e.next=9,n.applyVideoFilter(_t.videoFilter);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),Pe.error("Error applying video filter: "+e.t0);case 14:if(!_t.audioFilter){e.next=23;break}return e.prev=15,e.next=18,n.applyAudioFilter(_t.audioFilter);case 18:e.next=23;break;case 20:e.prev=20,e.t1=e.catch(15),Pe.error("Error applying audio filter: "+e.t1);case 23:r.emit("streamChange"),Un(),pn(),ne=(o=(e,t)=>{let n;return e.forEach(e=>{if(e.deviceId)n=e.deviceId.toString();else if(e.label&&t){const r=(0,u.default)(t,t=>t.label===e.label);r&&(n=r.deviceId)}}),n})(v.getVideoTracks(),te),re=o(v.getAudioTracks(),ee),G=new _e(v,!_t.publishAudio),ur(),lr(),n.accessAllowed=!0,n.dispatchEvent(new H.default(X.default.ACCESS_ALLOWED,!1));case 34:case"end":return e.stop()}}),e,null,[[6,11],[15,20]])})));return function(t){return e.apply(this,arguments)}}(),Bn=e=>{let t,n;Pe.error("OT.Publisher.onPublishingTimeout"),Ht?(t=Ke.CHROME_MICROPHONE_ACQUISITION_ERROR,n="Unable to publish because your browser failed to get access to your microphone. You may need to fully quit and restart your browser to get it to work. See https://bugs.chromium.org/p/webrtc/issues/detail?id=4799 for more details."):(t=Ke.TIMEOUT,n="Could not publish in a reasonable amount of time");const r={failureReason:"ICEWorkflow",failureCode:ze.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to publish in a reasonable amount of time (timeout)"};on("Failure",{},r),$e.handleJsException({errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:y}),e.isConnected()&&this.streamId&&e._.streamDestroy(this.streamId),this.disconnect(),k.isDestroyed()||k.set("MediaBound"),this.trigger("publishComplete",qe(t,new Error(n),ze.UNABLE_TO_PUBLISH))},Zn=e=>{const t=qe(Ke.MEDIA_ERR_DECODE,e,ze.UNABLE_TO_PUBLISH);t.message="OT.Publisher while playing stream: "+t.message,Pe.error("OT.Publisher.onVideoError:",t),nn("stream",null,{reason:t.message});const n=k.isAttemptingToPublish();k.set("Failed"),n?this.trigger("publishComplete",t):this.trigger("error",t.message),$e.handleJsException({error:t,target:this,analytics:y})};this._setWebRTCStream=e=>{v=e},this._setCurrentVideoFilter=e=>{Fr=e},this._getCurrentVideoFilter=()=>Fr,this._setCurrentAudioFilter=e=>{pr=e},this._getMediaProcessor=()=>St,this._removePeerConnection=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return r=p(t),o=r.peerConnectionId,delete Dt[o],e.next=6,Kn.removePeerConnection(t);case 6:t.destroy(),null==(n=Zr)||n.onPeerConnectionDisconnected();case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._removeSubscriber=e=>{var t,n;null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.isAdaptiveEnabled&&"P2P"===oe&&this._.startRelayedToRoutedTransition(),Gn(e).then(e=>{e.forEach(e=>this._removePeerConnection(e))})};const fn=e=>{const t=p(e),n=t.remoteSubscriberId,r=t.peerConnectionId;Pe.debug("Subscriber has been disconnected from the Publisher's PeerConnection"),nn("disconnect","PeerConnection",{subscriberConnection:r}),this._removeSubscriber(n)},Rn=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,a,l,c,s,d,u,A,h,g,Q;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r.reason,"ICEWorkflow"!==(c=r.prefix)||null==(o=n.session)||null==(a=o.sessionInfo)||!a.reconnection||!xt){e.next=4;break}return Pe.debug("Ignoring peer connection failure due to possibility of reconnection."),e.abrupt("return");case 4:return s=p(t)||{},d=s.remoteConnectionId,u=void 0===d?"(not found)":d,A=s.peerConnectionId,h=Oe(void 0,l,c,u,"Publisher"),g={hasRelayCandidates:t&&t.hasRelayCandidates()},Q={failureReason:c||"PeerConnectionError",failureCode:h.code,failureMessage:h.message},k.isPublishing()?Q.reason="Non-fatal":n.trigger("publishComplete",h),on("Failure",g,Q),$e.handleJsException({errorMsg:"OT.Publisher PeerConnection Error: "+l,code:h.code,target:n,analytics:y}),e.next=13,Dt[A];case 13:e.sent.destroy(),delete Dt[A];case 16:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),In=e=>{var t,n;return(null==(t=this.session)||null==(n=t.sessionInfo)?void 0:n.isAdaptiveEnabled)&&"P2P"===e.getSourceStreamId()},yn=(e,t)=>{setTimeout(()=>{if("disconnected"===he[t]&&It._.isSocketConnected()){const t=p(e).remoteConnectionId;an("Attempt",{remoteConnectionId:t}),e.iceRestart()}},2e3)},Vn=function(){var e=(0,o.default)(i.default.mark((function e(){var t,r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(ge),null==(t=n.session)||null==(r=t.sessionInfo)||!r.isAdaptiveEnabled){e.next=21;break}return e.next=4,Tn();case 4:if(e.t0=o=e.sent,null!=e.t0){e.next=9;break}e.t1=void 0,e.next=10;break;case 9:e.t1=o.iceConnectionStateIsConnected();case 10:return l=e.t1,e.next=13,Yn();case 13:if(e.t2=a=e.sent,null!=e.t2){e.next=18;break}e.t3=void 0,e.next=19;break;case 18:e.t3=a.iceConnectionStateIsConnected();case 19:c=e.t3,l&&c&&On();case 21:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Cn=e=>{var t,n;return It._.isSocketConnected()&&e===oe&&!(null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.p2pEnabled)},Wn=e=>{var t,n;Cn(e)&&(null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.isAdaptiveEnabled&&"P2P"===e?this._.startRelayedToRoutedTransition():ge=setTimeout(()=>{this.session._.streamDestroy(this.streamId,e)},5e3))},En=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getSourceStreamId(),he[r]=t,"connected"!==t){e.next=7;break}return e.next=5,Vn();case 5:e.next=8;break;case 7:"disconnected"===t?yn(n,r):"failed"===t&&Wn(r);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Sn=()=>{var e;return(null==(e=Zr)?void 0:e.getState())===Z.default.SUSPENDED_VIDEO},vn=e=>{var t;e._setP2PDefaultMaxBitrate(),Sn()||Lr(e),e.startEncryption(this.session.connection.id),In(e)&&cn("Success");const n=p(e).remoteSubscriberId;null==(t=ft)||t.addSubscriber(n,e),_t.publishVideo&&e.enableVideoQualityWatcher()},Jn=n=>{var r;let i=n.peerConnectionId,o=n.send,a=n.log,l=n.logQoS,c=n.sourceStreamId;if(!k.isMigrating()&&Xn(i))return e.reject(new Error("PeerConnection already exists"));const d=De({isChromiumEdge:et.env.isChromiumEdge,browserName:et.env.name,isScreenSharing:zt,isCustomVideoTrack:jt,sessionInfo:null==(r=this.session)?void 0:r.sessionInfo,constraints:_t.constraints,videoDimensions:hn(),capableSimulcastScreenshare:_t.capableSimulcastScreenshare,scalableVideo:_t.scalableVideo});return Dt[i]=e.all([this.session._.getIceConfig(),this.session._.getVideoCodecsCompatible(v)]).then(n=>{var r,i,u,A,h,g;let Q=n[0],F=n[1],U=v;if(!F){U=v.clone();const e=U.getVideoTracks()[0];e&&(e.stop(),U.removeTrack(e))}const m={enableDtx:_t.enableDtx};null!=(r=this.session)&&null!=(i=r.sessionInfo)&&i.p2pEnabled||(m.audioBitrate=_t.audioBitrate);const b=new rt({iceConfig:Q,sendMessage:o,webRTCStream:U,channels:_t.channels,capableSimulcastStreams:d,overrideSimulcastEnabled:t._enableSimulcast,logAnalyticsEvent:a,offerOverrides:{enableStereo:_t.enableStereo,audioBitrate:_t.audioBitrate,codecFlags:_t._codecFlags||this.session._.getCodecFlags()},answerOverrides:m,sourceStreamId:c,isP2pEnabled:null==(u=this.session)||null==(A=u.sessionInfo)?void 0:A.p2pEnabled,sessionId:this.session.id,keyStore:this.session.keyStore,sFrameClientStore:this.session.sFrameClientStore,isE2ee:this.session._.isE2ee(),audioFallbackEnabled:_t.publisherAudioFallbackEnabled,resolution:{width:this.videoWidth(),height:this.videoHeight()},preferredVideoCodecs:_t.preferredVideoCodecs?_t.preferredVideoCodecs:[_t._priorityVideoCodec||(null==(h=this.session)||null==(g=h.sessionInfo)?void 0:g.priorityVideoCodec)]});return b.on({disconnected:()=>fn(b),destroyed:()=>(e=>{var t;const n=p(e).remoteSubscriberId;null==(t=ft)||t.removeSubscriber(n)})(b),error:e=>{let t=e.reason,n=e.prefix;return Rn(b,{reason:t,prefix:n})},qos:l,iceRestartSuccess:()=>(e=>{const t=p(e).remoteConnectionId;an("Success",{remoteConnectionId:t})})(b),iceRestartFailure:()=>(e=>{const t=p(e).remoteConnectionId;an("Failure",{reason:"ICEWorkflow",message:"OT.Publisher PeerConnection Error: The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",remoteConnectionId:t})})(b),iceConnectionStateChange:e=>En(e,b),audioAcquisitionProblem:()=>{Ht=!0,this.trigger("audioAcquisitionProblem",{method:"getStats"})},audioAcquisitionProblemResolved:()=>{Ht=!1,this.trigger("audioAcquisitionProblemResolved",{method:"getStats"})},audioFallbackStateChange:e=>Zr.onPeerConnectionStateChange(Object.assign({},e,{peerConnection:b,publishVideo:_t.publishVideo,stream:this.stream,peerId:p(b).peerId})),videoQualityChanged:e=>{const t=p(b),n=t.remoteConnectionId,r=t.remoteSubscriberId,i=(0,s.default)(n.match(/^symphony\./)?{}:{subscriberId:r,connectionId:n},{stats:e.stats});this.trigger("videoQualityChanged",{reason:e.reason,statsContainer:i})}}),b.once("connected",()=>vn(b)),new e((e,t)=>{const n=e=>{t(e)};b.once("error",n),b.init(D,r=>{if(r)return t(r);b.off("error",n),e(b)})})}),Xn(i)},Nn=()=>e.all(Object.keys(Dt).map(Xn)),Gn=e=>Nn().then(t=>t.filter(t=>p(t).remoteSubscriberId===e)),Xn=e=>Dt[e],kn=e=>{const t=Object.keys(Dt).find(t=>t.endsWith("~"+e));return Dt[t]},Tn=()=>kn("MANTIS"),Yn=()=>kn("P2P");let wn=xe(this,{name:_t.name,publishAudio:_t.publishAudio,publishVideo:_t.publishVideo,audioSource:_t.audioSource,showControls:_t.showControls,shouldAllowAudio:Pt,logAnalyticsEvent:nn});const Dn=()=>{var e;this.off("publishComplete",Hn),wn&&wn.reset(),B.releaseAll(),R.empty(),this.disconnect(),G=null,Fn(),v=null,S&&(S.destroy(),S=null),this.session&&this._.unpublishFromSession(this.session,"reset"),St.getVideoFilter()&&Ar(),vt.destroy(),null==(e=ft)||e.destroy(),ft=null,this.id=null,this.stream=null,xt=!1,this.session=null,this.streamId=null,k.isDestroyed()||k.set("NotPublishing")},xn=()=>{if(!v||0===v.getVideoTracks().length)return!1;const e=["text","detail"].includes(_t.videoContentHint),t=jt&&e,n=et.env.isChromium&&(zt||t);return v.getVideoTracks().reduce((e,t)=>e&&(!t.muted||!!n)&&t.enabled&&"ended"!==t.readyState,_t.publishVideo)},Mn=()=>!(!v||0===v.getAudioTracks().length)&&(v.getAudioTracks().length>0&&v.getAudioTracks().reduce((e,t)=>e&&!t.muted&&t.enabled&&"ended"!==t.readyState,_t.publishAudio)),Hn=e=>{const t=Mn(),n=xn();if(S&&(S.audioOnly(!n),S.showPoster(!n)),wn&&wn.setAudioOnly(!n&&t),this.stream){let r;yt&&n&&(r=f.CongestionLevels.LOW,yt=!1),this.stream.setChannelActiveState({channelType:"audio",activeState:t,activeReason:e}),this.stream.setChannelActiveState({channelType:"video",activeState:n,activeReason:e,congestionLevel:r}),t||(this.stream.hasAudio=t),n||(this.stream.hasVideo=n)}else this.off("publishComplete",Hn),this.once("publishComplete",Hn)},Kn=(0,fe.default)({isPublisher:!0}),Ln=function(){var t=(0,o.default)(i.default.mark((function t(r,o,a){var l,c,d,u,A,h,g,Q,F;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(l="rtcStatsReport"===o)||Y.default){t.next=5;break}return c=ze.GET_RTC_STATS_REPORT_NOT_SUPPORTED,a(qe(Ke.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error($e.getTitleByCode(c)),c)),t.abrupt("return");case 5:return t.prev=5,t.next=8,Nn();case 8:if(0!==(A=t.sent).length){t.next=12;break}throw c=ze.PEER_CONNECTION_NOT_CONNECTED,qe(Ke.PEER_CONNECTION_NOT_CONNECTED,new Error($e.getTitleByCode(c)),c);case 12:if(null!=(d=n.session)&&null!=(u=d.sessionInfo)&&u.p2pEnabled){t.next=24;break}if(!l){t.next=17;break}null!=(h=n.session)&&null!=(g=h.sessionInfo)&&g.isAdaptiveEnabled&&(A=A.filter(e=>e.getSourceStreamId()===oe)),t.next=24;break;case 17:return t.t0=a,t.next=20,Kn.getStats(A.map(e=>({pc:e,metadata:p(e)})),oe);case 20:return t.t1=t.sent,t.t2=[t.t1],(0,t.t0)(null,t.t2),t.abrupt("return");case 24:return t.next=26,e.all(A.map(e=>(l?(0,T.default)(e.getRtcStatsReport.bind(e)):(0,T.default)(e.getStats.bind(e)))(r).then(t=>({pc:e,stats:t}))));case 26:Q=t.sent,F=Q.map(e=>{let t=e.pc,n=e.stats;const r=p(t),i=r.remoteConnectionId,o=r.remoteSubscriberId;return(0,s.default)(i.match(/^symphony\./)?{}:{subscriberId:o,connectionId:i},l?{rtcStatsReport:n}:{stats:t.processStats(n)})}),a(null,F),t.next=34;break;case 31:t.prev=31,t.t3=t.catch(5),a(t.t3);case 34:case"end":return t.stop()}}),t,null,[[5,31]])})));return function(e,n,r){return t.apply(this,arguments)}}(),zn=(e,t)=>{const n={name:_t.name||"",streamId:this.streamId,subscriberAudioFallbackEnabled:_t.subscriberAudioFallbackEnabled,channels:Et,minBitrate:_t.minVideoBitrate,sourceStreamId:e,e2ee:this.session._.isE2ee(),publisherAudioFallbackEnabled:_t.publisherAudioFallbackEnabled,customProperties:{initials:_t.initials}};this.session._.streamCreate(n,t)},On=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le=!1,e.next=3,Tn();case 3:if(!(t=e.sent)){e.next=19;break}return n.trigger("sourceStreamIdChanged","P2P"),_t.publisherAudioFallbackEnabled&&t.disableCongestionLevelEstimation(),t.disableVideoQualityWatcher(),e.next=10,(0,V.default)(bt);case 10:if(!le){e.next=13;break}return Pe.debug("Cancelling stop sending RTP to MANTIS."),e.abrupt("return");case 13:return vt.muteAudioInPeerConnection(v,t),e.next=16,t.changeMediaDirectionToInactive();case 16:if(!(et.env.isFirefox&&et.env.version<96)){e.next=19;break}return e.next=19,Pn();case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),jn=function(){var e=(0,o.default)(i.default.mark((function e(){var t,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le=!0,e.next=3,Tn();case 3:if(!(t=e.sent)){e.next=16;break}return vt.unmuteAudioInPeerConnection(v,t),e.next=8,t.changeMediaDirectionToRecvOnly();case 8:if(t.enableVideoQualityWatcher(),ae&&clearTimeout(ae),n.trigger("sourceStreamIdChanged","MANTIS"),!_t.publisherAudioFallbackEnabled){e.next=16;break}return e.next=14,Yn();case 14:r=e.sent,t.enableCongestionLevelEstimation(null==r?void 0:r.getAudioFallbackState());case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pn=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tn();case 2:(t=e.sent)&&(ae=setTimeout((0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("P2P"!==oe){e.next=9;break}return e.next=3,t.changeMediaDirectionToRecvOnly();case 3:return e.next=5,(0,V.default)(Bt);case 5:return e.next=7,t.changeMediaDirectionToInactive();case 7:return e.next=9,Pn();case 9:case"end":return e.stop()}}),e)}))),Zt));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_n=()=>{cn("Attempt");const e=e=>{const t=(0,q.default)(e);this.trigger("streamCreateForP2PComplete",t),cn("Failure",{reason:t.message})};if(!this.session)return void cn("Failure",{reason:"Not connected to the session."});const t=setTimeout(()=>{cn("Failure",{reason:"Timeout"})},nt);this.once("streamCreateForP2PComplete",()=>{clearTimeout(t)}),Pe.debug("streamCreateWithSource: send a message to RUMOR for creating the stream with the sourceStreaId P2P and stream "+this.streamId),zn("P2P",t=>{t?e(t):this.trigger("streamCreateForP2PComplete")})},qn=function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("P2P"===oe){e.next=2;break}return e.abrupt("return");case 2:if(sn("Attempt"),n.session){e.next=6;break}return sn("Failure",{reason:"Not connected to the session."}),e.abrupt("return");case 6:if(n.streamId){e.next=9;break}return sn("Failure",{reason:"No streamId available"}),e.abrupt("return");case 9:return e.next=11,jn();case 11:return n.session._.streamDestroy(n.streamId,"P2P"),e.t0=n,e.next=15,Yn();case 15:e.t1=e.sent,e.t0._removePeerConnection.call(e.t0,e.t1),sn("Success"),n.trigger("streamDestroyForP2PComplete");case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$n=(e,t)=>{var n,r;return(null==(n=this.session)||null==(r=n.sessionInfo)?void 0:r.isAdaptiveEnabled)&&"P2P"===t&&"generateoffer"===e&&k.isMigrating()},er=(e,t)=>{var n,r;return(null==(n=this.session)||null==(r=n.sessionInfo)?void 0:r.isAdaptiveEnabled)&&"MANTIS"===t&&"answer"===e&&"P2P"===oe},tr=e=>{const t=dt({socket:this.session._.getSocket(),uri:mt,content:{peerId:ke,sourceStreamId:e}});return(e,n)=>{"offer"===e&&this.trigger("connected"),t({type:e,content:n})}},nr=()=>{Fe=setTimeout(()=>{nn("Migrate","Failed"),this.destroy()},this.session.MIGRATION_TIMEOUT)};this.publish=e=>(Pe.debug("OT.Publisher: publish"),(k.isAttemptingToPublish()||k.isPublishing())&&Dn(),k.set("GetUserMedia"),_t.style&&this.setStyle(_t.style,null,!0),_t.classNames="OT_root OT_publisher",He.onLoad(()=>{Pe.debug("OT.Publisher: publish: environment loaded"),S=new ct(e,Object.assign({},_t,{widgetType:"publisher"})),Pt&&(0,O.default)({publisher:this,widgetView:S}),S.on("error",Zn),this.id=S.domId(),this.element=S.domElement,this.element&&wn&&wn.init(S),S.on("videoDimensionsChanged",(e,t)=>{_t.publishVideo&&(this.stream&&this.stream.setVideoDimensions(t.width,t.height),this.dispatchEvent(new Le.VideoDimensionsChangedEvent(this,e,t)))}),S.on("mediaStopped",e=>{const t=new Le.MediaStoppedEvent(this,e);if("ended"===(null==e?void 0:e.readyState)&&!(null==e||!e.writable)||this.dispatchEvent(t),!t.isDefaultPrevented()){if(e){const t=String(e.kind).toLowerCase();return"audio"===t?lr():"video"===t?ur():Pe.warn("Track with invalid kind has ended: "+e.kind),void nn("mediaStopped","Event",{kind:t})}this.session?this._.unpublishFromSession(this.session,"mediaStopped"):this.destroy("mediaStopped")}}),S.on("videoElementCreated",e=>{this.dispatchEvent(new Le.MediaStreamAvailableEvent(v));const t=new Le.VideoElementCreatedEvent(e);this.dispatchEvent(t)}),qt().catch(kt).then(function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee=Kt.audioDevices,te=Kt.videoDevices,a=!!_t.videoFilter,_t.disableAudioInputDeviceManagement||(l=Qt(),Qe=l(n)),c=(null==(r=ee)?void 0:r.length)>0||(null==(o=te)?void 0:o.length)>0,e.next=7,(0,ve.default)(c).then(e=>{e.on("accessDenied",e=>{n.accessAllowed=!1,n.dispatchEvent((0,Je.default)(e,"during the call"))})});case 7:return a&&(Qr=(0,_.default)(t,te)),e.next=10,bn(t);case 10:return _t.publishVideo||n._toggleVideo(_t.publishVideo,hn()),zt||jt||a||(Qr=(0,_.default)(t,te),_t.publishVideo&&Wr(Qr)),e.abrupt("return",mn().catch(e=>{if(!(e instanceof b.CancellationError))throw e}).then(()=>{gn(),k.isDestroyed()||(n.trigger("initSuccess"),n.trigger("loaded",n))},e=>{Pe.error("OT.Publisher.publish failed to bind video: "+e),Qn(e)}));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),this),this._getVideoSenders=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Nn().then(e=>e[0].getSenders().filter(e=>"video"===e.track.kind)));case 1:case"end":return e.stop()}}),e)}))),this._setScalableValues=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,a,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._getVideoSenders();case 2:return o=e.sent,a=o[0],(l=a.getParameters()).encodings.forEach((e,n)=>{e[t]=r[n]}),e.next=8,a.setParameters(l);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this._setScalabilityMode=function(){var e=(0,o.default)(i.default.mark((function e(t,r){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",gt(n,t,r));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this._getNumEncodings=()=>(0,We.default)(this),this._setScalableFramerates=function(){var e=(0,o.default)(i.default.mark((function e(t){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=or(t))||!rr(r)){e.next=4;break}return e.next=4,n._setScalableValues("maxFramerate",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._setScalableVideoLayers=function(){var e=(0,o.default)(i.default.mark((function e(t){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=or(t))||!ir(r)){e.next=4;break}return e.next=4,n._setScalableValues("scaleResolutionDownBy",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();const rr=e=>{let t=0;return e.every(e=>!(15!==e&&30!==e||e<t)&&(t=e,!0))},ir=e=>{let t=17;return e.every(e=>!(e<1||e>=t)&&(t=e,!0))},or=e=>{let t;if("string"!=typeof e)return t;const n=e.split(":");return 0===n.length||n.length>3?t:n.every(e=>!isNaN(e))?(t=n.map(e=>parseInt(e,10)).reverse(),t):t},ar=e=>v&&v[`get${(0,F.default)(e)}Tracks`]().length>0&&v[`get${(0,F.default)(e)}Tracks`]().every(e=>"ended"!==e.readyState),lr=e=>{const t=ar("audio")&&_t.publishAudio;wn&&wn.setMuted(!t),G&&G.muted(!t),se&&se.originalTrack&&(se.originalTrack.enabled=t),Hn(e)};this.publishAudio=e=>{nn("publishAudio","Attempt",{publishAudio:e}),_t.publishAudio=e;try{lr(),nn("publishAudio","Success",{publishAudio:e})}catch(e){nn("publishAudio","Failure",{message:e.message})}return this};const cr=e=>{try{r.dispatchEvent(new Le.PublisherCaptionsEnabled(e)),this.stream.setChannelActiveState({id:"caption1",activeState:e}),nn("publishCaptions","Success",{publishCaptions:e})}catch(t){nn("publishCaptions","Failure",{message:t.message,publishCaptions:e})}};let sr;this.publishCaptions=e=>{nn("publishCaptions","Attempt",{publishCaptions:e}),this.stream?cr(e):R.add(()=>cr(e))};let dr=!1;const ur=()=>{const e=ar("video")&&_t.publishVideo;if((0,o.default)(i.default.mark((function t(){var n,r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Nn();case 2:return n=t.sent,e&&Ue?n.forEach(e=>{Lr(e)}):"Chrome"===C.default.name&&C.default.version>=69&&(sr&&sr.cancel(),sr=new b.default,sr.isCanceled()||n.forEach(t=>{t.setVideoActiveState(e)})),t.next=7,kn(oe);case 7:r=t.sent,e?r.enableVideoQualityWatcher():r.disableVideoQualityWatcher();case 9:case"end":return t.stop()}}),t)})))(),jt&&St){const t=St.getOriginalVideoTrack();t&&(t.enabled=e)}if(jt&&ce){const t=ce.originalTrack;t&&(t.enabled=e)}v&&v.getVideoTracks().forEach(t=>{t.enabled=e,t.isCreatedCanvas&&(t.enabled=!1)}),Hn()},Ar=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=St.getOriginalVideoTrack(),e.prev=1,e.next=4,St.destroy();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),Pe.warn("Error cleaning up mediaProcessor: "+e.t0);case 9:t.stop();case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),hr=e=>!Fr&&!ce&&e===Cr(),gr=(e,t)=>!(!Fr&&!ce)||(e?Qr!==t:void 0!==t);let Qr,Fr,pr;this._toggleVideo=(0,E.default)(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var o,a,l,c,s,d,u,A;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(zt||jt||dr)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Er();case 4:if(a=e.sent,l=Vr()){e.next=8;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher._toggleVideo cannot toggleVideo when you have no video source."));case 8:if(c=null==(o=a.find(e=>e.label===l.label))?void 0:o.deviceId,gr(t,c)){e.next=11;break}return e.abrupt("return");case 11:if("ended"!==l.readyState){e.next=14;break}return dr=!0,e.abrupt("return");case 14:if(t&&et.env.isAndroid&&(et.env.isChrome||et.env.isSamsung)&&l&&l.stop&&l.stop(),t){e.next=31;break}e.prev=16,s=(0,P.default)(n),e.next=23;break;case 20:return e.prev=20,e.t0=e.catch(16),e.abrupt("return");case 23:if(c&&(Qr=c),Wr(s.label),!(d=St.getVideoFilter())){e.next=30;break}return Fr=d,e.next=30,Ar();case 30:ce&&(ce.destroy(),ce.stopOriginalTrack());case 31:if(!Qr||-1!==a.findIndex(e=>e.deviceId===Qr)){e.next=33;break}throw qe(Ke.NO_DEVICES_FOUND,new Error("Previous device no longer available - deviceId not found"));case 33:if(r.emit("streamDestroy"),!t){e.next=64;break}if(!hr(Qr)){e.next=37;break}return e.abrupt("return");case 37:return e.prev=37,e.next=40,yr(Qr);case 40:s=e.sent,e.next=47;break;case 43:throw e.prev=43,e.t1=e.catch(37),Pe.error(`Error getting new track for current device(${Qr}): ${e.t1}`),e.t1;case 47:if(s){e.next=50;break}return Pe.error("Failed to enable video. It was not possible to get a new track from the camera"),e.abrupt("return");case 50:if(!Fr){e.next=59;break}return u=St.getOriginalVideoTrack(),e.next=54,St.setVideoFilter(Fr);case 54:return e.next=56,St.setMediaStream(v);case 56:return e.next=58,St.setVideoTrack(s);case 58:s=e.sent;case 59:if(!ce){e.next=64;break}return u=ce.originalTrack,e.next=63,ce.setTrack(s);case 63:s=e.sent;case 64:return e.prev=64,e.next=67,Ir(l,s);case 67:null==(A=u)||A.stop(),e.next=73;break;case 70:throw e.prev=70,e.t2=e.catch(64),e.t2;case 73:case"end":return e.stop()}}),e,null,[[16,20],[37,43],[64,70]])})));return function(t,n){return e.apply(this,arguments)}}());const Ur=(0,Be.callWithCancellation)(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nn();case 2:r=e.sent,n.isCanceled()||r.forEach(e=>{t?e.enableCongestionLevelEstimation():e.disableCongestionLevelEstimation()});case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),mr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==(r=wn)||r.videoDisabledIndicator.disableVideo(!1),null==(o=wn)||o.videoDisabledIndicator.setWarning(!1),Lr(),t===Z.default.SUSPENDED_VIDEO?n.trigger("videoEnabled",{reason:"quality"}):n.trigger("videoDisableWarningLifted");case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),br=()=>{var e;_t.publishVideo&&(null==(e=wn)||e.videoDisabledIndicator.setWarning(!0));this.trigger("videoDisableWarning")},Br=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_t.publishVideo&&(null==(t=wn)||t.videoDisabledIndicator.disableVideo(!0)),n.trigger("videoDisabled",{reason:"quality"});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();let Zr;if(_t.publisherAudioFallbackEnabled){Zr=Xe({getAllPeerConnections:Nn});const e={[Z.default.ACTIVE_VIDEO]:mr,[Z.default.ACTIVE_VIDEO_WITH_WARNING]:br,[Z.default.SUSPENDED_VIDEO]:Br};Zr.on("stateChange",t=>{let n=t.previousState,r=t.state;try{e[r](n)}catch(e){throw Pe.error("Audio fallback error: "+e),e}})}this.publishVideo=(e,t)=>{if(_t.publishVideo===e)return t&&setTimeout(()=>{t()}),this;const n=(0,Se.default)(t),r=n.onResolve,i=n.onReject;return nn("publishVideo","Attempt",{publishVideo:e}),this._publishVideo(e).then(()=>{nn("publishVideo","Success",{publishVideo:e}),r()},e=>{nn("publishVideo","Failure",{message:e.message}),i(e)}),this},this._publishVideo=function(){var t=(0,o.default)(i.default.mark((function t(r){var o;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=hn(),_t.publishVideo=r,_t.publisherAudioFallbackEnabled&&(Ur(r),!1===r&&Zr.getState()!==Z.default.ACTIVE_VIDEO&&(yt=!0,i=void 0,a=void 0,Zr.reset(),null==(i=wn)||i.videoDisabledIndicator.disableVideo(!1),null==(a=wn)||a.videoDisabledIndicator.setWarning(!1))),t.next=5,e.all([n._toggleVideo(_t.publishVideo,o),ur()]);case 5:case"end":return t.stop()}var i,a}),t)})));return function(e){return t.apply(this,arguments)}}(),this.setVideoContentHint=e=>{zt&&_t._setDefaultScalabilityMode&&this._setScalabilityMode((0,Ve.default)(e)),(0,N.setVideoContentHint)(v,e)},this.getVideoContentHint=()=>(0,N.getVideoContentHint)(v),this.destroy=function(e,t){return k.isAttemptingToPublish()&&this.session&&on("Cancel",{reason:"destroy"}),k.isDestroyed()||(k.set("Destroyed"),Dn(),Kt&&(Kt.off(),Kt=null),wn&&(wn.destroy(),wn=null),r&&(r.off(),r=null),!0!==t&&this.dispatchEvent(new Le.DestroyedEvent(X.default.PUBLISHER_DESTROYED,this,e)),this.off(),ce&&(ce.destroy(),ce.stopOriginalTrack()),se&&(se.destroy(),se.stopOriginalTrack()),void 0!==Qe&&Qe()),this},this.disconnect=()=>{Object.keys(Dt).forEach(e=>{const t=Xn(e);delete Dt[e],t.then(e=>this._removePeerConnection(e))}),Et.length=0},this.processMessage=(e,t,n)=>{const r=(0,c.default)(n,"params.subscriber",t).replace(/^INVALID-STREAM$/,t),i=(0,c.default)(n,"content.peerId"),o=(0,c.default)(n,"content.sourceStreamId","MANTIS"),l=`${r}~${i}~${o}`;Pe.debug(`OT.Publisher.processMessage: Received ${e} from ${t} for ${l}`),Pe.debug(n);const s=Xn(l),d=()=>{ke=i,mt=n.uri;const c=tr(o);Jn({peerConnectionId:l,send:c,log:function(e,t,n,r,a){void 0===r&&(r={});const l=Object.assign({peerId:i,sourceStreamId:(0,$.default)(o)},r);return nn(e,t,n,l,a)},logQoS:e=>{o===oe&&An(Object.assign({},e,{peerId:i,remoteConnectionId:t,sourceStreamId:o}))},sourceStreamId:o}).then(c=>(((e,t)=>{a.set(e,t)})(c,{remoteConnectionId:t,remoteSubscriberId:r,peerId:i,sourceStreamId:o,peerConnectionId:l}),c.processMessage(e,n),null)).catch(e=>{Pe.error("OT.Publisher failed to create a peerConnection",e)})};switch(e){case"unsubscribe":this._removeSubscriber(r);break;default:if(s)s.then(t=>{t.processMessage(e,n),($n(e,o)||er(e,o))&&On()});else{var u,A;if(!k.isMigrating()&&null!=(u=this.session)&&null!=(A=u.sessionInfo)&&A.isAdaptiveEnabled&&Yn())return;d()}}},this.getImgData=function(){if(!xt)return Pe.error("OT.Publisher.getImgData: Cannot getImgData before the Publisher is publishing."),null;const e=S&&S.video();return e?e.imgData():null};const fr=e=>{e.getSenders().forEach(e=>"audio"===e.track.kind&&v.getAudioTracks().length?e.replaceTrack(v.getAudioTracks()[0]):"video"===e.track.kind&&v.getVideoTracks().length?e.replaceTrack(v.getVideoTracks()[0]):void 0)},Rr=function(t){return void 0===t&&(t=fr),Nn().then(n=>(n.map(t),e.all([])))};{let e=0;const t=function(){var t=(0,o.default)(i.default.mark((function t(){var n,o,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!et.env.isLegacyEdge&&st.RTCRtpSender&&"function"==typeof st.RTCRtpSender.prototype.replaceTrack){t.next=2;break}throw qe(Ke.UNSUPPORTED_BROWSER,new Error("Publisher#cycleVideo is not supported in your browser."),ze.UNABLE_TO_PUBLISH);case 2:if(!jt&&!zt){t.next=4;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher#cycleVideo: The publisher is not using a camera video source"));case 4:if(Vr()){t.next=7;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher#cycleVideo cannot cycleVideo when you have no video source."));case 7:return e+=1,t.next=10,Er();case 10:if(n=t.sent,n.filter(e=>e.deviceId!==Qr).length>0){t.next=14;break}return t.abrupt("return",Qr);case 14:for(;n[e%n.length].deviceId===Qr;)e+=1;return r.emit("streamDestroy"),o=n[e%n.length],a=o.deviceId,t.next=20,Dr(a);case 20:return t.abrupt("return",Qr);case 21:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();this.cycleVideo=(0,E.default)((0,o.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:n=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),Pe.error("Publisher#cycleVideo: could not cycle video: "+e.t0),e.t0;case 10:return e.abrupt("return",{deviceId:n});case 11:case"end":return e.stop()}}),e,null,[[0,6]])}))))}const Ir=function(){var t=(0,o.default)(i.default.mark((function t(a,l){var c,s,d;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Nn();case 2:return c=t.sent,t.next=5,e.all(c.map(function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.findAndReplaceTrack(a,l);case 2:t._setP2PDefaultMaxBitrate();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:if(v.removeTrack(a),v.addTrack(l),a&&a.stop){try{s=l instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(l).toString().includes("MediaStreamTrackGenerator")}catch(e){s=!1}s||a.stop()}"Firefox"!==et.env.name&&"Safari"!==et.env.name||(n.videoElement().srcObject=null,n.videoElement().srcObject=v),(d=S&&S.video())&&d.refreshTracks(),r.emit("streamChange"),ur();case 13:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),yr=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o,a,l,c,s,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Cr(),Wr(n),(a=(0,d.default)(t)).audioSource=null,a.videoSource=n,Kt=pt(a,"OT.Publisher.getTrackFromDeviceId",()=>k&&k.isDestroyed()),Kt.on({accessDialogOpened:Tt,accessDialogClosed:Yt}),l=Kt.getUserMedia,e.prev=8,e.next=11,l();case 11:c=e.sent,e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(8),Pe.error(e.t0),e.t0;case 18:return s=null==(r=c)?void 0:r.getVideoTracks(),(u=s[0])||Wr(o),e.abrupt("return",u);case 21:case"end":return e.stop()}}),e,null,[[8,14]])})));return function(t){return e.apply(this,arguments)}}(),Vr=()=>v.getVideoTracks()[0],Cr=()=>ie,Wr=e=>{ie=e},Er=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Me.shouldAskForDevices();case 2:if(t=e.sent,n=t.videoDevices,t.video&&n&&n.length){e.next=6;break}throw qe(Ke.NO_DEVICES_FOUND,new Error("No video devices available"),ze.UNABLE_TO_PUBLISH);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Sr=function(){var t=(0,o.default)(i.default.mark((function t(r,o){var a,l,c,s;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.session){t.next=2;break}return t.abrupt("return");case 2:if(null==(a=n.session.sessionInfo)||!a.isAdaptiveEnabled||"P2P"!==oe){t.next=15;break}return t.next=5,Yn();case 5:return l=t.sent,t.next=8,null==l?void 0:l.findAndReplaceTrack(r,o);case 8:return t.next=10,Tn();case 10:return c=t.sent,t.next=13,vt.replaceTrackInMutedAudioTracks(c,r,o);case 13:t.next=20;break;case 15:return t.next=17,Nn();case 17:return s=t.sent,t.next=20,e.all(s.map(e=>e.findAndReplaceTrack(r,o)));case 20:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),vr=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==n){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Sr(t,n);case 4:n&&v.addTrack(n),t&&v.removeTrack(t),(o=S&&S.video())&&o.refreshTracks(),wn&&(n&&!t&&wn.addAudioTrack(),t&&!n&&wn.removeAudioTrack());try{a=n instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(n).toString().includes("MediaStreamTrackGenerator")}catch(e){a=!1}t&&t.stop&&!a&&t.stop(),n&&(lr(),G=new _e(v,!_t.publishAudio)),r.emit("streamChange"),Hn();case 14:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Jr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getSettings().deviceId,e.prev=1,e.next=4,n.setAudioSource(r);case 4:(o=v.getAudioTracks()[0])&&(o.onmute=()=>Nr(o),o.onunmute=()=>Gr(o)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),Pe.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),Nr=e=>{let t=!1;_t.publishVideo&&document.hidden&&(t=!0,this.publishVideo(!1));const r=function(){var a=(0,o.default)(i.default.mark((function o(){return i.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(document.hidden){i.next=5;break}return i.next=3,Jr(e);case 3:t&&n.publishVideo(!0),document.removeEventListener("visibilitychange",r);case 5:case"end":return i.stop()}}),o)})));return function(){return a.apply(this,arguments)}}();document.addEventListener("visibilitychange",r)},Gr=e=>{var t;Mn()&&(xn()?this.videoElement().pause():Jr(e)),null==this||null==(t=this.session)||t.trigger("gsmCallEnded")},Xr=!(et.env.isLegacyEdge||!st.RTCRtpSender||"function"!=typeof st.RTCRtpSender.prototype.replaceTrack),kr=()=>qe(Ke.CANCEL,new Error("Operation did not succeed due to a new request."));let Tr;const Yr=function(){var e=(0,o.default)(i.default.mark((function e(r){var a,l,c,s,u,A,h,g,Q,F,p;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Xr){e.next=2;break}throw qe(Ke.UNSUPPORTED_BROWSER,new Error("Publisher#setAudioSource is not supported in your browser."));case 2:if(Tr&&Tr.cancel(),Tr=new b.default,a=Tr,l=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCanceled()){e.next=3;break}throw t.getTracks(e=>e.stop()),kr();case 3:return e.abrupt("return",Yr(t.getAudioTracks()[0]));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=n._getAudioSource()){e.next=7;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher#setAudioSource cannot add an audio source when you started without one."));case 7:if(!((U=r)instanceof MediaStreamTrack||U&&"object"==typeof U&&Object.getPrototypeOf(U).toString().includes("MediaStreamTrack"))){e.next=26;break}if(!a.isCanceled()){e.next=10;break}throw kr();case 10:if(!se){e.next=23;break}return e.prev=11,e.next=14,se.setTrack(r);case 14:return s=e.sent,e.next=17,vr(c,s);case 17:return e.abrupt("return",e.sent);case 20:e.prev=20,e.t0=e.catch(11),Pe.error("Error setting track on audioMediaProcessorConnector: "+e.t0);case 23:return e.abrupt("return",vr(c,r));case 26:if("string"!=typeof r){e.next=73;break}return(u=(0,d.default)(t)).audioSource=r,u.videoSource=null,Kt=pt(u,"OT.Publisher.setAudioSource",()=>a.isCanceled()||k&&k.isDestroyed()),Kt.on({accessDialogOpened:Tt,accessDialogClosed:Yt}),A=c.label,h=c.getConstraints&&c.getSettings().deviceId||void 0,c&&c.stop(),g=Kt.getUserMedia,e.prev=36,e.t1=l,e.next=40,g();case 40:return e.t2=e.sent,e.next=43,(0,e.t1)(e.t2);case 43:return e.abrupt("return",e.sent);case 46:if(e.prev=46,e.t3=e.catch(36),!a.isCanceled()){e.next=50;break}throw kr();case 50:if((Q=(0,d.default)(t)).videoSource=null,Q.audioSource=h,Q.audioSource||!A){e.next=60;break}return e.next=56,Te();case 56:if(F=e.sent.find(e=>e.label===A),!a.isCanceled()){e.next=59;break}throw kr();case 59:F&&(Q.audioSource=F.deviceId);case 60:if(Q.audioSource){e.next=63;break}throw e.t3.message+=" (could not determine previous audio device)",qe(Ke.NOT_FOUND,e.t3);case 63:return Kt=pt(Q,"OT.Publisher.setAudioSource",()=>a.isCanceled()||k&&k.isDestroyed()),e.next=66,Kt.getUserMedia().catch(e=>{throw e.message+=" (could not obtain previous audio device)",e});case 66:return p=e.sent,e.next=69,l(p);case 69:throw e.t3.message+=" (reverted to previous audio device)",e.t3;case 71:e.next=74;break;case 73:throw qe(Ke.INVALID_PARAMETER,new Error("Invalid parameter passed to OT.Publisher.setAudioSource(). Expected string or MediaStreamTrack."));case 74:case"end":return e.stop()}var U}),e,null,[[11,20],[36,46]])})));return function(t){return e.apply(this,arguments)}}();this.setAudioSource=Yr,this._getAudioSource=()=>v&&v.getAudioTracks().length>0?v.getAudioTracks()[0]:null,this.getAudioSource=()=>se?se.originalTrack:this._getAudioSource();const wr=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=qe(Ke.INVALID_VIDEO_SOURCE,new Error("Invalid video source. Video source must be a valid video input deviceId"),1041),r=qe(Ke.SET_VIDEO_SOURCE_FAILURE,new Error("You cannot reset the video source on a publisher that does not currently use a camera source."),1040),!et.env.isLegacyEdge&&st.RTCRtpSender&&"function"==typeof st.RTCRtpSender.prototype.replaceTrack){e.next=4;break}throw qe(Ke.UNSUPPORTED_BROWSER,new Error("setVideoSource is not supported in your browser."),ze.UNABLE_TO_PUBLISH);case 4:if("string"==typeof t){e.next=6;break}throw n;case 6:if(o=!v||0===v.getVideoTracks().length,!(jt||zt||o)){e.next=9;break}throw r;case 9:return e.next=11,Te();case 11:if(a=e.sent,a.find(e=>"videoInput"===e.kind&&e.deviceId===t)){e.next=15;break}throw n;case 15:return e.next=17,Dr(t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoSource=wr;const Dr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c,s,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Qr,Qr=t,_t.publishVideo){e.next=4;break}return e.abrupt("return");case 4:if(!hr(t)){e.next=6;break}return e.abrupt("return");case 6:if(a=Vr(),l=et.env.isChrome||et.env.isFirefox||et.env.isSamsung,!(_t.publishVideo&&et.env.isAndroid&&l)){e.next=15;break}if(!Fr){e.next=14;break}return c=Fr,e.next=13,Ar();case 13:Fr=null;case 14:a&&a.stop&&a.stop();case 15:return e.prev=15,e.next=18,yr(t);case 18:s=e.sent,e.next=26;break;case 21:throw e.prev=21,e.t0=e.catch(15),Qr=o,Pe.error(e.t0),e.t0;case 26:if(s){e.next=29;break}return Pe.warn("Unable to aquire video track. Moving to next device."),e.abrupt("return");case 29:if(!Fr){e.next=34;break}return d=St.getOriginalVideoTrack(),e.next=33,St.setVideoTrack(s);case 33:s=e.sent;case 34:if(!ce){e.next=39;break}return d=ce.originalTrack,e.next=38,ce.setTrack(s);case 38:s=e.sent;case 39:return e.next=41,Ir(a,s);case 41:if(!c){e.next=44;break}return e.next=44,n.applyVideoFilter(c);case 44:null==(r=d)||r.stop(),_t.publishVideo&&(dr=!1);case 46:case"end":return e.stop()}}),e,null,[[15,21]])})));return function(t){return e.apply(this,arguments)}}();var xr,Mr;this.getVideoSource=()=>{const e={},t=!v||0===v.getVideoTracks().length;return e.track=v&&_t.publishVideo&&v.getVideoTracks()[0]||null,e.deviceId=zt||jt||!Qr?null:Qr,e.type=jt?"custom":zt?"screen":t?null:"camera",e},this._={privateEvents:r,setIceConfig:e=>(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Nn();case 2:t.sent.forEach(t=>t.setIceConfig(e));case 4:case"end":return t.stop()}}),t)})))(),publishToSession:(t,r)=>{if("PublishingToSession"===k.current||k.isPublishing())return Pe.warn("This publisher is already publishing to the session. If you want to\n republish, please unpublish first."),e.resolve();r&&(y=r),this.session=t,It=t,this.streamId=(0,U.default)(),Vt&&(ft=new Ut({socket:this.session._.getSocket(),streamId:this.streamId})),on("Attempt",{dataChannels:_t.channels,properties:(0,L.default)(_t)});const a=new e((e,t)=>{xt?e():(this.once("initSuccess",e),this.once("destroyed",e=>{let n=e.reason,r="";n&&(r=" Reason: "+n),t(new Error("Publisher destroyed before it finished loading."+r))}))});Pe.debug("publishToSession: waiting for publishComplete, which is triggered by stream#created from rumor");const l=function(){var e=(0,o.default)(i.default.mark((function e(){var t,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=!_t.constraints.video,e.t0){e.next=6;break}return e.next=4,n._getNumEncodings();case 4:e.t1=e.sent,e.t0=e.t1<=1;case 6:if(!e.t0){e.next=8;break}return e.abrupt("return");case 8:r=["VP9"],!zt&&!jt?t="L3T3":_t._setDefaultScalabilityMode&&zt&&(o=n.getVideoContentHint(),t=(0,Ve.default)(o)),t&&n._setScalabilityMode(t,r);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=new e((e,t)=>{this.once("publishComplete",n=>{n?t(n):(this._setScalableFramerates(_t.scalableFramerates),this._setScalableVideoLayers(_t.scalableVideoLayers),l(),this.stream&&(this.stream.setChannelActiveState({channelType:"audio",activeState:Mn()}),this.stream.setChannelActiveState({channelType:"video",activeState:xn()})),Pe.debug("publishToSession: got publishComplete"),e())})}),s=e=>{const t=(0,q.default)(e);throw on("Failure",{},{failureReason:"Publish",failureCode:t.code,failureMessage:t.message}),k.isAttemptingToPublish()&&this.trigger("publishComplete",t),$e.handleJsException({errorMsg:e.message,code:t.code,target:this,error:e,analytics:y}),t};Pe.debug("publishToSession: waiting for loaded");const d=a.then(()=>t._.getVideoCodecsCompatible(v)).then(n=>{if(Pe.debug("publishToSession: loaded"),!this.session)return;const r=setTimeout(()=>{Bn(t)},nt);this.once("publishComplete",()=>{clearTimeout(r)}),k.set("PublishingToSession");const i=n&&S&&S.video(),o=v.getVideoTracks().length>0,a=null!==_t.videoSource&&!1!==_t.videoSource;i&&o&&a&&Et.push(new ot({id:"video1",type:"video",active:_t.publishVideo,orientation:lt.ROTATED_NORMAL,frameRate:_t.frameRate,width:this.videoWidth(),height:this.videoHeight(),e2ee:t._.isE2ee(),source:zt?"screen":jt?"custom":"camera",fitMode:_t.fitMode}));const l=v.getAudioTracks().length>0;return null!==_t.audioSource&&!1!==_t.audioSource&&l&&(Et.push(new ot({id:"audio1",type:"audio",active:_t.publishAudio})),Et.push(new ot({id:"caption1",type:"data",active:_t.publishCaptions}))),Vt&&Et.push(new ot({id:"downlinkStats1",type:"data",active:!0})),this._.streamChannels=Et,Pe.debug("publishToSession: creating rumor stream id"),new e((e,t)=>{zn(null,(n,r,i)=>{n?t(s(n)):e({streamId:r,message:i})})})}).then(e=>{if(void 0===e)return;const t=e.streamId,n=e.message;if(Pe.debug("publishToSession: rumor stream id created:",t,"(this is different from stream#created, which requires media to actually be flowing for mantis sessions)"),t!==this.streamId)throw new Error("streamId response does not match request");this.streamId=t,D=tt(n)}).catch(e=>{throw this.trigger("publishComplete",e),e});return e.all([d,c])},unpublishFromSession:(e,t)=>{if(!this.session||e.id!==this.session.id){if("unpublished"===t){const t=this.session&&this.session.id||"no session";Pe.warn(`The publisher ${wt} is trying to unpublish from a session ${e.id} it is not attached to (it is attached to ${t})`)}return this}if(e.isConnected()&&(this.stream||k.isAttemptingToPublish())&&e._.streamDestroy(this.streamId),B.releaseAll(),R.empty(),this.disconnect(),k.isAttemptingToPublish()){on("Cancel",{reason:"unpublish"});const e=new Error((()=>{switch(t){case"mediaStopped":return"The video element fired the ended event, indicating there is an issue with the media";case"unpublished":return"The publisher was unpublished before it could be published";case"reset":return"The publisher was reset";default:return"The publisher was destroyed due to "+t}})());this.trigger("publishComplete",qe("mediaStopped"===t?Ke.MEDIA_ENDED:Ke.CANCEL,e))}return this.session=null,nn("unpublish","Success"),this._.streamDestroyed(t),this},unpublishStreamFromSession:(e,t,n)=>e.id!==this.streamId?(Pe.warn(`The publisher ${wt} is trying to destroy a stream ${e.id} that is not attached to it`),this):this._.unpublishFromSession(t,n),startMigration:(Mr=(0,o.default)(i.default.mark((function e(){var t,r,o,a,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k.set("Migrating"),nn("Migrate","Attempt"),nr(),e.next=5,Yn();case 5:if(null==(a=e.sent)||a.setSendMessage(tr("P2P")),null==(t=ft)||t.setSocket(n.session._.getSocket()),l=e=>{if(e)throw new Error(e)},null==(r=n.session)||null==(o=r.sessionInfo)||!o.p2pEnabled){e.next=13;break}zn("P2P",l),e.next=17;break;case 13:return e.next=15,Tn();case 15:pe=e.sent,zn("MANTIS",l);case 17:case"end":return e.stop()}}),e)}))),function(){return Mr.apply(this,arguments)}),finishMigration:()=>{var e,t;clearTimeout(Fe);const n=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=7;break}return e.next=3,Kn.removePeerConnection(t);case 3:n=p(t),r=n.peerConnectionId,delete Dt[r],t.off("iceConnectionStateChange"),t.destroy();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var r;(n(pe),pe=null,null!=(e=this.session)&&null!=(t=e.sessionInfo)&&t.isAdaptiveEnabled&&"MANTIS"===oe)&&(null==(r=Yn())||r.then(n));k.set("Publishing"),nn("Migrate","Success")},streamDestroyed:e=>{["reset"].indexOf(e)<0&&(k.isDestroyed()||k.set("MediaBound"));const t=new Le.StreamEvent("streamDestroyed",this.stream,e,!0);this.dispatchEventOnce(t,this.streamId),t.isDefaultPrevented()||this.destroy(),this.streamId=null},archivingStatus:e=>(wn&&wn.setArchivingStatus(e),e),webRtcStream:()=>v,switchTracks:()=>(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,qt().catch(kt);case 3:t=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),Pe.error("OT.Publisher.switchTracks failed to getUserMedia: "+e.t0),e.t0;case 10:n=t,Fn(),v=n,r.emit("streamChange"),G=new _e(v,!_t.publishAudio),e.prev=11,mn(),e.next=21;break;case 15:if(e.prev=15,e.t1=e.catch(11),!(e.t1 instanceof b.CancellationError)){e.next=19;break}return e.abrupt("return");case 19:throw Pe.error("Error while binding video",e.t1),e.t1;case 21:e.prev=21,Rr(),e.next=29;break;case 25:throw e.prev=25,e.t2=e.catch(21),Pe.error("Error replacing tracks",e.t2),e.t2;case 29:case"end":return e.stop()}var n}),e,null,[[0,6],[11,15],[21,25]])})))(),getDataChannel(e,t,n){const r=Xn(Object.keys(Dt)[0]);r?r.then(r=>{r.getDataChannel(e,t,n)}):n(new et.Error("Cannot create a DataChannel before there is a subscriber."))},iceRestart(e){void 0===e&&(e=!1),Nn().then(t=>{t.forEach(t=>{const n=p(t).remoteConnectionId;an("Attempt",{remoteConnectionId:n}),Pe.debug("Publisher: ice restart attempt"),t.iceRestart(),e&&t.generateOffer()})})},getState:()=>k,demoOnlyCycleVideo:this.cycleVideo,testOnlyGetFramesEncoded:()=>(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nn();case 2:if((t=e.sent).length){e.next=5;break}throw new Error("No established PeerConnections yet");case 5:return e.abrupt("return",t[0]._testOnlyGetFramesEncoded());case 6:case"end":return e.stop()}}),e)})))(),onStreamAvailable:bn,startRoutedToRelayedTransition:()=>{l.startTransitionToRelayed(),_n()},startRelayedToRoutedTransition:()=>{l.startTransitionToRouted(qn)},forceMuteAudio:function(){nn("publishAudio","Attempt",{publishAudio:!1}),_t.publishAudio=!1;try{lr("auto"),this.dispatchEvent(new Le.MuteForcedEvent),nn("publishAudio","Success",{publishAudio:!1})}catch(e){nn("publishAudio","Failure",{message:e.message})}}.bind(this),setCongestionLevel:(xr=(0,o.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Zr){e.next=15;break}if(!n){e.next=8;break}return e.next=4,Xn(n);case 4:e.t1=e.sent,e.t0=[e.t1],e.next=11;break;case 8:return e.next=10,Nn();case 10:e.t0=e.sent;case 11:e.t0.forEach(e=>{e.setCongestionLevel(t)}),e.next=16;break;case 15:Pe.warn("Audio Fallback is not enabled");case 16:case"end":return e.stop()}}),e)}))),function(e,t){return xr.apply(this,arguments)})},this.detectDevices=function(){Pe.warn("Publisher.detectDevices() is not implemented.")},this.detectMicActivity=function(){Pe.warn("Publisher.detectMicActivity() is not implemented.")},this.getEchoCancellationMode=function(){return Pe.warn("Publisher.getEchoCancellationMode() is not implemented."),"fullDuplex"},this.setMicrophoneGain=function(){Pe.warn("Publisher.setMicrophoneGain() is not implemented.")},this.getMicrophoneGain=function(){return Pe.warn("Publisher.getMicrophoneGain() is not implemented."),.5},this.setCamera=function(){Pe.warn("Publisher.setCamera() is not implemented.")},this.setMicrophone=function(){Pe.warn("Publisher.setMicrophone() is not implemented.")},this.guid=function(){return wt},this.videoElement=function(){const e=S&&S.video();return e?e.domElement():null},this.setStream=e=>{if("PublishingToSession"!==k.current&&!k.isPublishing())throw new Error("assignStream called when publisher is not successfully publishing");B.releaseAll(),this.stream=e,this.stream.on("destroyed",this.disconnect,this),B.add(()=>{this.stream&&this.stream.off("destroyed",this.disconnect,this)}),k.isMigrating()||(k.set("Publishing"),J=Date.now(),this.dispatchEvent(new Le.StreamEvent("streamCreated",e,null,!1))),S.loading(!xt),on("Success"),this.trigger("publishComplete",null,this),R.releaseAll()},this.isWebRTC=!0,this.isLoading=function(){return S&&S.loading()},this.videoWidth=()=>hn().width,this.videoHeight=()=>hn().height,this.getStats=function(e){dn(),((e,t)=>{Ln(e,null,t)})(de.default.SDK,(t,n)=>{t?e(t):e(null,n)})},this.getRtcStatsReport=()=>(un(),new e((e,t)=>{var n;n=de.default.SDK_RAW,Ln(n,"rtcStatsReport",(n,r)=>{n?t(n):e(r)})})),k=new it(e=>{Pe.error("OT.Publisher State Change Failed: ",e.message),Pe.debug(e)}),this.accessAllowed=!1,this.applyVideoFilter=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(0,x.default)(t),nn("applyVideoFilter","Attempt",{videoFilter:r}),e.prev=2,!ce){e.next=5;break}throw qe(Ke.NOT_SUPPORTED,new Error("Cannot apply video filter when videoMediaProcessorConnector is set."));case 5:if(ut.isSupported()){e.next=8;break}throw qe(Ke.NOT_SUPPORTED,new Error("Browser does not support video filters (Insertable Streams and Worker APIs are required)"));case 8:if(St.isValidVideoFilter(t)){e.next=10;break}throw qe(Ke.INVALID_PARAMETER,new Error("Video filter has invalid configuration"));case 10:if(v){e.next=15;break}return nn("applyVideoFilter","Failure",{message:o="Ignoring. No mediaStream"}),Pe.warn(o),e.abrupt("return");case 15:if(!zt){e.next=17;break}throw qe(Ke.INVALID_PARAMETER,new Error("Video filters can not be applied to screen share"));case 17:if(rn(),_t.publishVideo){e.next=22;break}return Fr=t,nn("applyVideoFilter","Success",{videoFilter:r}),e.abrupt("return");case 22:if(!St.getVideoFilter()){e.next=37;break}if(!St.canUpdateVideoFilter(t.type)){e.next=35;break}return e.prev=24,e.next=27,St.updateVideoFilter(t);case 27:return Fr=t,nn("applyVideoFilter","Success",{videoFilter:r}),e.abrupt("return");case 32:e.prev=32,e.t0=e.catch(24),Pe.warn("Error updating video filter: "+e.t0);case 35:return e.next=37,n.clearVideoFilter();case 37:if(a=v.getVideoTracks(),l=a[0]){e.next=43;break}return nn("applyVideoFilter","Failure",{message:o="Ignoring. No video"}),Pe.warn(o),e.abrupt("return");case 43:return e.next=45,St.setVideoFilter(t);case 45:return e.next=47,St.setMediaStream(v);case 47:if(!(c=e.sent)){e.next=51;break}return e.next=51,Ir(l,c);case 51:e.next=58;break;case 53:throw e.prev=53,e.t1=e.catch(2),Pe.error("Error applying video filter: "+e.t1),nn("applyVideoFilter","Failure",{message:e.t1.message}),e.t1;case 58:Fr=t,nn("applyVideoFilter","Success",{videoFilter:r});case 60:case"end":return e.stop()}}),e,null,[[2,53],[24,32]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>(nn("getVideoFilter","Attempt"),nn("getVideoFilter","Success"),Fr||null),this.applyAudioFilter=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("applyAudioFilter","Attempt",{audioFilter:t}),ut.isSupported()){e.next=4;break}throw qe(Ke.NOT_SUPPORTED,new Error("Browser does not support audio filters (Insertable Streams and Worker APIs are required)"));case 4:if((0,Ie.default)(t)){e.next=6;break}throw qe(Ke.INVALID_PARAMETER,new Error("Audio filter has invalid configuration"));case 6:if(!se){e.next=8;break}throw qe(Ke.NOT_SUPPORTED,new Error("Cannot apply audio filter when audioMediaProcessorConnector is set."));case 8:if(v){e.next=13;break}return nn("applyAudioFilter","Failure",{message:r="Ignoring. No mediaStream"}),Pe.warn(r),e.abrupt("return");case 13:if(_t.publishAudio){e.next=17;break}return pr=t,nn("applyAudioFilter","Success",{audioFilter:t}),e.abrupt("return");case 17:if(!n.getAudioFilter()){e.next=20;break}return e.next=20,n.clearAudioFilter();case 20:if(e.prev=20,"advancedNoiseSuppression"!==t.type){e.next=32;break}return o=(0,ye.default)({proxyUrl:(0,Ee.getProxyUrl)()}),a=o.assetsDirBaseUrl,l=ht(),e.next=26,l.init({assetsDirBaseUrl:a});case 26:return e.next=28,l.getConnector();case 28:return c=e.sent,e.next=31,Hr(c);case 31:pr=t;case 32:e.next=39;break;case 34:throw e.prev=34,e.t0=e.catch(20),Pe.error("Error applying audio filter: "+e.t0),nn("applyAudioFilter","Failure",{message:e.t0.message}),e.t0;case 39:nn("applyAudioFilter","Success");case 40:case"end":return e.stop()}}),e,null,[[20,34]])})));return function(t){return e.apply(this,arguments)}}(),this.clearAudioFilter=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("clearAudioFilter","Attempt"),_t.publishAudio||!n.getAudioFilter()){e.next=5;break}return pr=null,nn("clearAudioFilter","Success"),e.abrupt("return");case 5:if(ut.isSupported()){e.next=10;break}return nn("clearAudioFilter","Success",{message:t='Ignoring. "clearAudioFilter" not supported.'}),Pe.warn(t),e.abrupt("return");case 10:if(n.getAudioFilter()){e.next=15;break}return nn("clearAudioFilter","Success",{message:t="Ignoring. No audio filter applied"}),Pe.debug(t),e.abrupt("return");case 15:if(v){e.next=20;break}return nn("clearAudioFilter","Success",{message:t="Ignoring. No mediaStream"}),Pe.warn(t),e.abrupt("return");case 20:return e.prev=20,e.next=23,Hr(null);case 23:pr=null,e.next=30;break;case 26:return e.prev=26,e.t0=e.catch(20),nn("clearAudioFilter","Failure",{error:e.t0}),e.abrupt("return");case 30:nn("clearAudioFilter","Success");case 31:case"end":return e.stop()}}),e,null,[[20,26]])}))),this.getAudioFilter=()=>(nn("getAudioFilter","Attempt"),nn("getAudioFilter","Success"),pr||null),this.setVideoMediaProcessorConnector=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("setVideoMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),!n.getVideoFilter()){e.next=4;break}throw nn("setVideoMediaProcessorConnector","Failure",{message:"Tried to set video MediaProcessorConnector when video filter applied."}),qe(Ke.NOT_SUPPORTED,new Error("setVideoMediaProcessorConnector: Cannot use this method when videoFilter is set."));case 4:if(!ce){e.next=14;break}return r=v.getVideoTracks(),o=r[0],e.next=8,yr(Qr);case 8:return a=e.sent,e.next=11,Ir(o,a);case 11:ce.destroy(),ce.stopOriginalTrack(),ce=null;case 14:if(t){e.next=17;break}return nn("setVideoMediaProcessorConnector","Success",{message:"clearing the connector"}),e.abrupt("return");case 17:if(At.isValidConnector(t)){e.next=20;break}throw nn("setVideoMediaProcessorConnector","Failure",{message:"Invalid MediaProcessorConnector"}),qe(Ke.INVALID_PARAMETER,new Error("setVideoMediaProcessorConnector: Tried to set invalid MediaProcessorConnector"));case 20:if(ce=new At(t),l=v.getVideoTracks(),c=l[0]){e.next=28;break}return nn("setVideoMediaProcessorConnector","Failure",{message:s="Connector not set as no video track is present."}),Pe.warn("setVideoMediaProcessorConnector: "+s),ce=null,e.abrupt("return");case 28:return e.prev=28,e.next=31,ce.setTrack(c);case 31:return o=e.sent,e.next=34,Ir(c,o);case 34:e.next=42;break;case 36:throw e.prev=36,e.t0=e.catch(28),ce=null,Pe.error("setVideoMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),nn("setVideoMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 42:nn("setVideoMediaProcessorConnector","Success");case 43:case"end":return e.stop()}}),e,null,[[28,36]])})));return function(t){return e.apply(this,arguments)}}(),this.setAudioMediaProcessorConnector=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return nn("setAudioMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),e.prev=1,e.next=4,Hr(t);case 4:nn("setAudioMediaProcessorConnector","Success",{message:t?void 0:"clearing the connector"}),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(1),nn("setAudioMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}();const Hr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.getAudioFilter()||!t){e.next=3;break}throw r="Tried to set audio MediaProcessorConnector when audio filter applied.",qe(Ke.NOT_SUPPORTED,new Error(r));case 3:if(!se){e.next=9;break}return o=v.getAudioTracks(),a=o[0],e.next=7,vr(a,se.originalTrack);case 7:se.destroy(),se=null;case 9:if(t){e.next=11;break}return e.abrupt("return");case 11:if(At.isValidConnector(t)){e.next=14;break}throw r="Invalid MediaProcessorConnector",qe(Ke.INVALID_PARAMETER,new Error(r));case 14:if(l=v.getAudioTracks(),c=l[0]){e.next=20;break}throw r="Connector not set as no audio track is present.",Pe.warn("setAudioMediaProcessorConnector: "+r),se=null,new Error(r);case 20:return se=new At(t),e.prev=21,e.next=24,se.setTrack(c);case 24:return a=e.sent,e.next=27,vr(n._getAudioSource(),a);case 27:e.next=34;break;case 29:throw e.prev=29,e.t0=e.catch(21),se=null,Pe.error("setAudioMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),e.t0;case 34:case"end":return e.stop()}}),e,null,[[21,29]])})));return function(t){return e.apply(this,arguments)}}();this.clearVideoFilter=(0,o.default)(i.default.mark((function e(){var t,n,r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("clearVideoFilter","Attempt"),_t.publishVideo||St.getVideoFilter()){e.next=5;break}return Fr=null,nn("clearVideoFilter","Success"),e.abrupt("return");case 5:if(St.getVideoFilter()||Fr){e.next=10;break}return nn("clearVideoFilter","Success",{message:t="Ignoring. No video filter applied"}),Pe.debug(t),e.abrupt("return");case 10:if(ut.isSupported()){e.next=15;break}return nn("clearVideoFilter","Success",{message:t='Ignoring. "clearVideoFilter" not supported.'}),Pe.warn(t),e.abrupt("return");case 15:if(v){e.next=20;break}return nn("clearVideoFilter","Success",{message:t="Ignoring. No mediaStream"}),Pe.warn(t),e.abrupt("return");case 20:return n=Fr,Fr=null,r=v.getVideoTracks(),o=r[0],e.prev=23,e.next=26,yr(Qr);case 26:a=e.sent,e.next=33;break;case 29:return e.prev=29,e.t0=e.catch(23),Pe.error(e.t0),e.abrupt("return");case 33:if(a){e.next=36;break}return Pe.warn("Failed to clear filter because there is no video track."),e.abrupt("return");case 36:return e.prev=36,e.next=39,Ir(o,a);case 39:return e.next=41,Ar();case 41:e.next=46;break;case 43:e.prev=43,e.t1=e.catch(36),Fr=n;case 46:nn("clearVideoFilter","Success");case 47:case"end":return e.stop()}}),e,null,[[23,29],[36,43]])})));const Kr=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.setMaxBitrate(Ue);case 2:if(!e.sent){e.next=8;break}if(0!==Ue){e.next=6;break}return e.abrupt("return");case 6:"string"==typeof Ue?(_t.videoBitratePreset=Ue.toLowerCase(),_t.videoMaxBitrate=0):(_t.videoMaxBitrate=Ue,_t.videoBitratePreset="custom");case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.getMaxVideoBitrate=()=>_t.videoMaxBitrate,this.getVideoBitratePreset=()=>_t.videoBitratePreset;const Lr=function(){var t=(0,o.default)(i.default.mark((function t(r){var a,l,c;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==Ue){t.next=2;break}return t.abrupt("return");case 2:if((a=isNaN(Ue)?{Preset:Ue.toLowerCase()}:0===Ue?{Preset:"default"}:{BitrateBps:Ue}).NearestResolution=(0,Ne.default)(n.videoWidth(),n.videoHeight()),nn("SetMaxVideoBitrateOnRtpSender","Attempt",{},a),l=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Kr(t);case 3:nn("SetMaxVideoBitrateOnRtpSender","Success",{},a),e.next=11;break;case 6:throw e.prev=6,e.t0=e.catch(0),a.failureReason=e.t0.message,nn("SetMaxVideoBitrateOnRtpSender","Failure",{},a),qe(Ke.UNEXPECTED_ERROR_CODE,new Error("An unexpected error was encountered"));case 11:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),!r){t.next=11;break}return t.next=9,l(r);case 9:t.next=16;break;case 11:return t.next=13,Nn();case 13:return c=t.sent,t.next=16,e.all(c.map(l));case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),zr=()=>{const e={width:{ideal:me},height:{ideal:Re},frameRate:{ideal:Ce}};return v.getVideoTracks().at(0).applyConstraints(e)};this.setPreferredResolution=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,a,l,c,s,d,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("setPreferredResolution","Attempt",{preferredResolution:t}),_t.publishVideo&&null!=(n=v)&&null!=(r=n.getVideoTracks())&&r.length){e.next=5;break}throw nn("setPreferredResolution","Failure",{preferredResolution:t,message:l="setPreferredResolution needs to be called on a video publisher"}),new Error(l);case 5:if(!(!t||!Number.isInteger(t.width)||t.width<=0||!Number.isInteger(t.height)||t.height<=0)){e.next=9;break}throw nn("setPreferredResolution","Failure",{preferredResolution:t,message:l="preferredResolution must be an object with positive integer width and height properties"}),new Error(l);case 9:if(c=(null==(o=_t.videoDimensions)?void 0:o.width)||Ye,s=(null==(a=_t.videoDimensions)?void 0:a.height)||we,d=c*s,!(t.width*t.height>d)){e.next=17;break}throw nn("setPreferredResolution","Failure",{preferredResolution:t,message:l="preferredResolution cannot be higher than the initial publishing resolution"}),new Error(l);case 17:return me=t.width,Re=t.height,e.prev=19,e.next=22,zr();case 22:return u=e.sent,nn("setPreferredResolution","Success",{preferredResolution:t}),e.abrupt("return",u);case 27:throw e.prev=27,e.t0=e.catch(19),nn("setPreferredResolution","Failure",{preferredResolution:t,message:e.t0.message}),e.t0;case 31:case"end":return e.stop()}}),e,null,[[19,27]])})));return function(t){return e.apply(this,arguments)}}(),this.setPreferredFrameRate=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("setPreferredFrameRate","Attempt",{frameRate:t}),_t.publishVideo&&null!=(n=v)&&null!=(r=n.getVideoTracks())&&r.length){e.next=5;break}throw nn("setPreferredFrameRate","Failure",{frameRate:t,message:o="setPreferredFrameRate needs to be called on a video publisher"}),new Error(o);case 5:if(Number.isInteger(t)&&!(t<1)){e.next=9;break}throw nn("setPreferredFrameRate","Failure",{frameRate:t,message:o="Invalid frameRate: must be an integer ≥ 1"}),new Error(o);case 9:return Ce=t,e.prev=10,e.next=13,zr();case 13:return a=e.sent,nn("setPreferredFrameRate","Success",{frameRate:t}),e.abrupt("return",a);case 18:throw e.prev=18,e.t0=e.catch(10),nn("setPreferredFrameRate","Failure",{frameRate:t,message:e.t0.message}),e.t0;case 22:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(t){return e.apply(this,arguments)}}(),this.setMaxVideoBitrate=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("number"==typeof t){e.next=2;break}throw qe(Ke.INVALID_PARAMETER,new Error("Invalid bitrate: it must be 0 or any number between 5000 and 10000000"));case 2:if(n=parseInt(t,10),!(isNaN(n)||0!==n&&(n<5e3||n>1e7))){e.next=5;break}throw qe(Ke.INVALID_PARAMETER,new Error("Invalid bitrate: it must be 0 or any number between 5000 and 10000000"));case 5:if(Ue=0===n?Ge.default.DEFAULT:n,Sn()){e.next=11;break}return e.next=9,Lr();case 9:e.next=12;break;case 11:Pe.debug("Video is currently inactive, max bitrate will be applied once active.");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.setVideoBitratePreset=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof t){e.next=2;break}throw qe(Ke.INVALID_PARAMETER,new Error('Invalid preset. It must be either "default", "bw_saver", or "extra_bw_saver"'));case 2:if(void 0!==(n=Ge.default[t.toUpperCase()])){e.next=5;break}throw qe(Ke.INVALID_PARAMETER,new Error('Invalid preset. It must be either "default", "bw_saver", or "extra_bw_saver"'));case 5:if(Ue=n,Sn()){e.next=11;break}return e.next=9,Lr();case 9:e.next=12;break;case 11:Pe.debug("Video is currently inactive, bitrate preset will be applied once active.");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._getVideoMaxBitrateSetting=()=>Ue}};var i=r(n(4)),o=r(n(5)),a=r(n(347)),l=r(n(348)),c=r(n(61)),s=r(n(10)),d=r(n(64)),u=r(n(77)),A=r(n(307)),h=r(n(51)),g=r(n(53)),Q=r(n(749)),F=r(n(283)),p=r(n(160)),U=r(n(20)),m=r(n(213)),b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=Xe(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(115)),B=n(759),Z=r(n(79)),f=n(28),R=r(n(760)),I=r(n(7)),y=r(n(2)),V=r(n(96)),C=r(n(3)),W=r(n(22)),E=r(n(762)),S=r(n(75)),v=r(n(9)),J=r(n(23)),N=n(318),G=r(n(155)),X=r(n(30)),k=r(n(31)),T=r(n(178)),Y=r(n(342)),w=r(n(295)),D=r(n(14)),x=r(n(349)),M=r(n(6)),H=r(n(148)),K=r(n(168)),L=r(n(763)),z=r(n(179)),O=r(n(764)),j=r(n(180)),P=r(n(765)),_=r(n(766)),q=r(n(767)),$=r(n(183)),ee=r(n(278)),te=r(n(310)),ne=r(n(159)),re=r(n(17)),ie=r(n(173)),oe=r(n(320)),ae=r(n(8)),le=n(111),ce=r(n(292)),se=r(n(321)),de=r(n(39)),ue=r(n(330)),Ae=r(n(162)),he=r(n(164)),ge=r(n(345)),Qe=r(n(768)),Fe=r(n(184)),pe=r(n(774)),Ue=r(n(775)),me=r(n(776)),be=r(n(778)),Be=n(779),Ze=r(n(337)),fe=r(n(339)),Re=r(n(181)),Ie=r(n(780)),ye=r(n(781)),Ve=r(n(782)),Ce=r(n(783)),We=r(n(784)),Ee=n(73),Se=r(n(785)),ve=r(n(786)),Je=r(n(787)),Ne=r(n(328)),Ge=r(n(327));function Xe(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(Xe=function(e){return e?n:t})(e)}const ke=(0,z.default)(),Te=(0,W.default)().getInputMediaDevices,Ye=640,we=480}).call(this,n(1))},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";(function(e,r){var i=n(0);t.__esModule=!0,t.WebglSelfieSegmentationType=t.WarningType=t.VonageMediaProcessor=t.RenderingType=t.PipelineInfoData=t.MediapipeHelper=t.ErrorFunction=t.BlurRadius=t.BackgroundTransformerType=t.BackgroundTransformer=void 0,t.createVonageMediaProcessor=function(e){return xo.apply(this,arguments)},t.getSupportedBrowserFeatures=ve,t.getVonageFaceDetection=function(){return Ye},t.getVonageFaceMash=function(){return we},t.getVonageHands=function(){return ke},t.getVonageHolistic=function(){return Te},t.getVonageObjectron=function(){return De},t.getVonagePose=function(){return xe},t.getVonageSelfieSegmentation=function(){return Xe},t.isSupported=function(){return Se.apply(this,arguments)};var o=i(n(4)),a=i(n(24)),l=i(n(26)),c=i(n(5)),s=function(e){function t(){var t=this||self;return delete e.prototype.__magic__,t}return"object"==typeof globalThis?globalThis:this?t():(e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t}),__magic__)}(Object);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(){return new e((e,t)=>{typeof MediaStreamTrackProcessor>"u"||typeof MediaStreamTrackGenerator>"u"?t("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):e()})}let Q=function(){};function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Q.updates={transformer_new:"New transformer",transformer_null:"Null transformer"},Q.errors={transformer_none:"No transformers provided",transformer_start:"Cannot start transformer",transformer_transform:"Cannot transform frame",transformer_flush:"Cannot flush transformer",readable_null:"Readable is null",writable_null:"Writable is null"};const p=new WeakMap,U=new WeakMap,m=new WeakMap,b=Symbol("anyProducer"),B=e.resolve(),Z=Symbol("listenerAdded"),f=Symbol("listenerRemoved");let R=!1;function I(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function y(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function V(e,t){const n=U.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function C(e,t){const n="string"==typeof t||"symbol"==typeof t?t:b,r=m.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function W(t,n,r){const i=m.get(t);if(i.has(n))for(var o,a=A(i.get(n));!(o=a()).done;){o.value.enqueue(r)}if(i.has(b)){const t=e.all([n,r]);for(var l,c=A(i.get(b));!(l=c()).done;){l.value.enqueue(t)}}}function E(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},a=[];const l={enqueue(e){a.push(e),i()},finish(){r=!0,i()}};for(var s,d=A(n);!(s=d()).done;){const e=s.value;C(t,e).add(l)}return{next(){var t=this;return(0,c.default)(o.default.mark((function n(){return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!a){n.next=20;break}if(0!==a.length){n.next=12;break}if(!r){n.next=6;break}n.t2=(a=void 0,t.next()),n.next=9;break;case 6:return n.next=8,new e(e=>{i=e});case 8:n.t2=t.next();case 9:n.t1=n.t2,n.next=17;break;case 12:return n.t3=!1,n.next=15,a.shift();case 15:n.t4=n.sent,n.t1={done:n.t3,value:n.t4};case 17:n.t0=n.t1,n.next=21;break;case 20:n.t0={done:!0};case 21:return n.abrupt("return",n.t0);case 22:case"end":return n.stop()}}),n)})))()},return(e){var r=arguments;return(0,c.default)(o.default.mark((function c(){var s,d,u;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:for(a=void 0,s=A(n);!(d=s()).done;)u=d.value,C(t,u).delete(l);if(i(),!(r.length>0)){o.next=11;break}return o.t1=!0,o.next=7,e;case 7:o.t2=o.sent,o.t0={done:o.t1,value:o.t2},o.next=12;break;case 11:o.t0={done:!0};case 12:return o.abrupt("return",o.t0);case 13:case"end":return o.stop()}}),c)})))()},[Symbol.asyncIterator](){return this}}}function S(e){if(void 0===e)return N;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(var t,n=A(e);!(t=n()).done;){const e=t.value;if(!N.includes(e))throw"string"!=typeof e?new TypeError("`methodNames` element must be a string"):new Error(e+" is not Emittery method")}return e}const v=e=>e===Z||e===f;let J=function(){function t(e){void 0===e&&(e={}),p.set(this,new Set),U.set(this,new Map),m.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{try{r=JSON.stringify(r)}catch(e){r="Object with the following keys failed to stringify: "+Object.keys(r).join(",")}"symbol"==typeof n&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}t.mixin=function(e,n){return n=S(n),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(var i,o=A(n);!(i=o()).done;){const e=i.value;if(void 0!==r.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``)}Object.defineProperty(r.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new t}),this[e]}});const a=t=>function(){return this[e][t](...arguments)};for(var l,c=A(n);!(l=c()).done;){const e=l.value;Object.defineProperty(r.prototype,e,{enumerable:!1,value:a(e)})}return r}};var n=t.prototype;return n.logIfDebugEnabled=function(e,n,r){(t.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,n,r)},n.on=function(e,t){y(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;I(e),V(this,e).add(t),this.logIfDebugEnabled("subscribe",e,void 0),v(e)||this.emit(Z,{eventName:e,listener:t})}return this.off.bind(this,e,t)},n.off=function(e,t){y(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;I(e),V(this,e).delete(t),this.logIfDebugEnabled("unsubscribe",e,void 0),v(e)||this.emit(f,{eventName:e,listener:t})}},n.once=function(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})},n.events=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){I(t.value)}return E(this,e)},n.emit=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i,a,l,s;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return I(n),this.logIfDebugEnabled("emit",n,r),W(this,n,r),i=V(this,n),a=p.get(this),l=[...i],s=v(n)?[]:[...a],t.next=4,B;case 4:return t.next=6,e.all([...l.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.has(t)){e.next=2;break}return e.abrupt("return",t(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),...s.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.has(t)){e.next=2;break}return e.abrupt("return",t(n,r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 6:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.emitSerial=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d,u,A;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(t),this.logIfDebugEnabled("emitSerial",t,n),r=V(this,t),i=p.get(this),a=[...r],l=[...i],e.next=4,B;case 4:c=0,s=a;case 5:if(!(c<s.length)){e.next=14;break}if(d=s[c],e.t0=r.has(d),!e.t0){e.next=11;break}return e.next=11,d(n);case 11:c++,e.next=5;break;case 14:u=0,A=l;case 15:if(!(u<A.length)){e.next=24;break}if(d=A[u],e.t1=i.has(d),!e.t1){e.next=21;break}return e.next=21,d(t,n);case 21:u++,e.next=15;break;case 24:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),n.onAny=function(e){return y(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),p.get(this).add(e),this.emit(Z,{listener:e}),this.offAny.bind(this,e)},n.anyEvent=function(){return E(this)},n.offAny=function(e){y(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(f,{listener:e}),p.get(this).delete(e)},n.clearListeners=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){const e=t.value;if(this.logIfDebugEnabled("clear",e,void 0),"string"==typeof e||"symbol"==typeof e){V(this,e).clear();const t=C(this,e);for(var r,i=A(t);!(r=i()).done;){r.value.finish()}t.clear()}else{p.get(this).clear();for(var o,a=A(U.get(this).values());!(o=a()).done;){o.value.clear()}for(var l,c=A(m.get(this).values());!(l=c()).done;){const e=l.value;for(var s,d=A(e);!(s=d()).done;){s.value.finish()}e.clear()}}}},n.listenerCount=function(e){let t=0;for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;if("string"!=typeof e){typeof e<"u"&&I(e),t+=p.get(this).size;for(var i,o=A(U.get(this).values());!(i=o()).done;){t+=i.value.size}for(var a,l=A(m.get(this).values());!(a=l()).done;){t+=a.value.size}}else t+=p.get(this).size+V(this,e).size+C(this,e).size+C(this).size}return t},n.bindMethods=function(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");for(var n,r=A(t=S(t));!(n=r()).done;){const t=n.value;if(void 0!==e[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(e,t,{enumerable:!1,value:this[t].bind(this)})}},(0,l.default)(t,null,[{key:"isDebugEnabled",get:function(){if("object"!=typeof r)return R;const e=(r||{env:{}}).env;return"emittery"===e.DEBUG||"*"===e.DEBUG||R},set:function(e){R=e}}]),t}();const N=Object.getOwnPropertyNames(J.prototype).filter(e=>"constructor"!==e);Object.defineProperty(J,"listenerAdded",{value:Z,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(J,"listenerRemoved",{value:f,writable:!1,enumerable:!0,configurable:!1});const G=F(J);function X(e){return function(e){if(function(e){return"object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message}(e))return e;try{return new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}}(e).message}var k=Object.defineProperty,T=(e,t,n)=>(((e,t,n)=>{t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,t+"",n),n);let Y;const w=new Uint8Array(16);function D(){if(!Y&&(Y=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Y))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Y(w)}const x=[];for(let e=0;e<256;++e)x.push((e+256).toString(16).slice(1));const M={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function H(e,t,n){if(M.randomUUID&&!t&&!e)return M.randomUUID();const r=(e=e||{}).random||(e.rng||D)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t){return void 0===t&&(t=0),(x[e[t+0]]+x[e[t+1]]+x[e[t+2]]+x[e[t+3]]+"-"+x[e[t+4]]+x[e[t+5]]+"-"+x[e[t+6]]+x[e[t+7]]+"-"+x[e[t+8]]+x[e[t+9]]+"-"+x[e[t+10]]+x[e[t+11]]+x[e[t+12]]+x[e[t+13]]+x[e[t+14]]+x[e[t+15]]).toLowerCase()}(r)}function K(e,t){s.vonage||(s.vonage={}),s.vonage.workerizer||(s.vonage.workerizer={});let n=s.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const L=K("globals",{});var z=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(z||{});function O(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let j=0;function P(t,n,r,i,o){const a=j++;return t.postMessage({id:a,type:n,functionName:r,args:i},i.filter(e=>O(e))),new e(e=>{null==o||o.set(a,e)})}function _(e,t){const n=e.id,r=e.type,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>O(e)))}const q=K("workerized",{});function $(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ee(){return te.apply(this,arguments)}function te(){return(te=(0,c.default)(o.default.mark((function t(){var n,r,i,a,l;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!$()){t.next=4;break}_({type:z.GLOBALS_SYNC},L),t.next=8;break;case 4:for(r in n=[],q)i=q[r].workerContext,a=i.worker,l=i.resolvers,a&&n.push(P(a,z.GLOBALS_SYNC,"",[L],l));return t.next=8,e.all(n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ne(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],ne(e[n],t[n])):"object"==typeof e[n]?(t[n]={},ne(e[n],t[n])):t[n]=e[n]}function re(e,t){return ie.apply(this,arguments)}function ie(){return(ie=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.functionName,i=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(r){e.next=5;break}throw"missing function name to call";case 5:if(n.instance[r]){e.next=7;break}throw`undefined function [${r}] in class ${n.instance.constructor.workerId}`;case 7:return e.t0=_,e.t1=t,e.next=11,n.instance[r](...null!=i?i:[]);case 11:e.t2=e.sent,(0,e.t0)(e.t1,e.t2);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const oe=K("registeredWorkers",{});function ae(e,t){if(!e.args)throw"Missing className while initializing worker";const n=e.args,r=n[0],i=n[1],o=oe[r];if(!o)throw"unknown worker class "+r;t.instance=new o(e.args.slice(1)),ne(i,L),_(e,void 0!==typeof t.instance)}function le(e,t){return ce.apply(this,arguments)}function ce(){return(ce=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(e.t0=n.instance.terminate,!e.t0){e.next=8;break}return e.next=7,n.instance.terminate(...null!=r?r:[]);case 7:i=e.sent;case 8:_(t,i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(e){if(!e.args)throw"Missing globals while syncing";ne(e.args[0],L),_(e,{})}$()&&function(){const e={};onmessage=function(){var t=(0,c.default)(o.default.mark((function t(n){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,t.t0=r.type,t.next=t.t0===z.INIT?4:t.t0===z.FORWARD?6:t.t0===z.TERMINATE?8:t.t0===z.GLOBALS_SYNC?10:12;break;case 4:return ae(r,e),t.abrupt("break",12);case 6:return re(r,e),t.abrupt("break",12);case 8:return le(r,e),t.abrupt("break",12);case 10:return se(r),t.abrupt("break",12);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}();const de=function(e,t){return L[e]||(L[e]=t),[()=>L[e],function(){var t=(0,c.default)(o.default.mark((function t(n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L[e]=n,t.next=3,ee();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()]}("metadata",he),ue=de[0],Ae=de[1];var he;function ge(){return ue()}let Qe=function(){function e(e,t){T(this,"uuid"),this.config=e,this.uuid=null!=t?t:H()}var t=e.prototype;return t.send=function(){var e=(0,c.default)(o.default.mark((function e(t){var n,r,i,a,l,c,s,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null!=(n=ge())?n:{},l=a.appId,c=a.sourceType,l&&c){e.next=3;break}return e.abrupt("return","metadata missing");case 3:return s=new AbortController,d=setTimeout(()=>s.abort(),1e4),e.next=6,(null!=(i=null==(r=this.config)?void 0:r.fetch)?i:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(t)),signal:s.signal});case 6:return clearTimeout(d),e.abrupt("return","success");case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getUrl=function(){var e;let t=null!=(e=ge().proxyUrl)?e:"https://";return t+=("/"===t.at(-1)?"":"/")+"hlg.tokbox.com/prod/logging/vcp_webrtc",t},t.getHeaders=function(){return{"Content-Type":"application/json"}},t.buildReport=function(e){const t=ge();return Object.assign({guid:this.uuid},e,{applicationId:t.appId,timestamp:Date.now(),proxyUrl:t.proxyUrl,source:t.sourceType})},e}();const Fe="2.0.4";let pe=function(){function e(e,t){this.config=e,this.frameTransformedCount=0,this.frameFromSourceCount=0,this.startAt=0,this.reporter=new Qe(e,t)}var t=e.prototype;return t.onFrameFromSource=function(){var e=(0,c.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.frameFromSourceCount++;case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.onFrameTransformed=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===t&&(t={}),void 0===n&&(n=!1),0===this.startAt&&(this.startAt=Date.now()),this.frameTransformedCount++,r=this.startAt,i=this.frameTransformedCount,a=this.frameFromSourceCount,l=Date.now(),s=i/(c=(l-r)/1e3),d=a/c,e.abrupt("return",n||this.frameTransformedCount>=this.config.loggingIntervalFrameCount?(this.frameFromSourceCount=0,this.frameTransformedCount=0,this.startAt=l,this.reporter.config=this.config,this.reporter.send(Object.assign({},this.config.report,{variation:"QoS",fps:d,transformedFps:s,framesTransformed:i},t))):"success");case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),(0,l.default)(e,[{key:"fps",get:function(){const e=this.startAt;return this.frameFromSourceCount/((Date.now()-e)/1e3)}}]),e}();var Ue=(e=>(e.FPS_DROP="fps_drop",e))(Ue||{}),me=(e=>(e.start="start",e.transform="transform",e.flush="flush",e))(me||{}),be=(e=>(e.pipeline_ended="pipeline_ended",e.pipeline_ended_with_error="pipeline_ended_with_error",e.pipeline_started="pipeline_started",e.pipeline_started_with_error="pipeline_started_with_error",e.pipeline_restarted="pipeline_restarted",e.pipeline_restarted_with_error="pipeline_restarted_with_error",e))(be||{});t.PipelineInfoData=be,t.ErrorFunction=me,t.WarningType=Ue;let Be=function(e){function t(t,n){var r;return(r=e.call(this)||this).reporter_=new Qe,r.reporterQos_=new pe({loggingIntervalFrameCount:500,report:{version:Fe}}),r.index_=n,r.transformer_=t,r.shouldStop_=!1,r.isFlashed_=!1,r.mediaTransformerQosReportStartTimestamp_=0,r.videoHeight_=0,r.videoWidth_=0,r.trackExpectedRate_=-1,r.transformerType_="Custom","getTransformerType"in t&&(r.transformerType_=t.getTransformerType()),r.report({variation:"Create"}),r}(0,a.default)(t,e);var n=t.prototype;return n.setTrackExpectedRate=function(e){this.trackExpectedRate_=e},n.start=function(){var e=(0,c.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.controller_=t,!this.transformer_||"function"!=typeof this.transformer_.start){e.next=11;break}return e.prev=1,e.next=4,this.transformer_.start(t);case 4:e.next=11;break;case 6:e.prev=6,e.t0=e.catch(1),this.report({message:Q.errors.transformer_start,variation:"Error",error:X(e.t0)}),n={eventMetaData:{transformerIndex:this.index_},error:e.t0,function:"start"},this.emit("error",n);case 11:case"end":return e.stop()}}),e,this,[[1,6]])})));return function(t){return e.apply(this,arguments)}}(),n.transform=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===this.mediaTransformerQosReportStartTimestamp_&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),t instanceof VideoFrame&&(this.videoHeight_=null!=(r=null==t?void 0:t.displayHeight)?r:0,this.videoWidth_=null!=(i=null==t?void 0:t.displayWidth)?i:0),this.reporterQos_.onFrameFromSource(),!this.transformer_){e.next=17;break}if(!this.shouldStop_){e.next=5;break}console.warn("[Pipeline] flush from transform"),t.close(),this.flush(n),n.terminate(),e.next=17;break;case 5:return e.prev=5,e.next=8,null==(l=(a=this.transformer_).transform)?void 0:l.call(a,t,n);case 8:this.reportQos(),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(5),this.report({message:Q.errors.transformer_transform,variation:"Error",error:X(e.t0)}),c={eventMetaData:{transformerIndex:this.index_},error:e.t0,function:"transform"},this.emit("error",c);case 16:-1!=this.trackExpectedRate_&&.8*this.trackExpectedRate_>this.reporterQos_.fps&&(s={eventMetaData:{transformerIndex:this.index_},warningType:"fps_drop",dropInfo:{requested:this.trackExpectedRate_,current:this.reporterQos_.fps}},this.emit("warn",s));case 17:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t,n){return e.apply(this,arguments)}}(),n.flush=function(){var e=(0,c.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.transformer_||"function"!=typeof this.transformer_.flush||this.isFlashed_){e.next=12;break}return this.isFlashed_=!0,e.prev=2,e.next=5,this.transformer_.flush(t);case 5:e.next=12;break;case 7:e.prev=7,e.t0=e.catch(2),this.report({message:Q.errors.transformer_flush,variation:"Error",error:X(e.t0)}),n={eventMetaData:{transformerIndex:this.index_},error:e.t0,function:"flush"},this.emit("error",n);case 12:this.reportQos(!0),this.report({variation:"Delete"});case 13:case"end":return e.stop()}}),e,this,[[2,7]])})));return function(t){return e.apply(this,arguments)}}(),n.stop=function(){console.log("[Pipeline] Stop stream."),this.controller_&&(this.flush(this.controller_),this.controller_.terminate()),this.shouldStop_=!0},n.report=function(e){this.reporter_.send(Object.assign({version:Fe,action:"MediaTransformer",transformerType:this.transformerType_},e))},n.reportQos=function(e){void 0===e&&(e=!1),this.reporterQos_.config=Object.assign({},this.reporterQos_.config),this.reporterQos_.onFrameTransformed({version:Fe,action:"MediaTransformer",transformerType:this.transformerType_,videoWidth:this.videoWidth_,videoHeight:this.videoHeight_},e)},t}(G),Ze=function(e){function t(t){var n;(n=e.call(this)||this).transformers_=[],n.trackExpectedRate_=-1;for(let e=0;e<t.length;e++){let r=new Be(t[e],e);r.on("error",e=>{n.emit("error",e)}),r.on("warn",e=>{n.emit("warn",e)}),n.transformers_.push(r)}return n}(0,a.default)(t,e);var n=t.prototype;return n.setTrackExpectedRate=function(e){this.trackExpectedRate_=e;for(var t,n=A(this.transformers_);!(t=n()).done;){t.value.setTrackExpectedRate(this.trackExpectedRate_)}},n.start=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,s=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.transformers_&&0!==this.transformers_.length){e.next=3;break}return console.log("[Pipeline] No transformers."),e.abrupt("return");case 3:for(e.prev=3,r=t,i=A(this.transformers_);!(a=i()).done;)l=a.value,t=t.pipeThrough(new TransformStream(l));t.pipeTo(n).then((0,c.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("[Pipeline] Setup."),e.next=3,n.abort();case 3:return e.next=5,r.cancel();case 5:s.emit("pipelineInfo","pipeline_ended");case 6:case"end":return e.stop()}}),e)})))).catch(function(){var e=(0,c.default)(o.default.mark((function e(i){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.cancel().then(()=>{console.log("[Pipeline] Shutting down streams after abort.")}).catch(e=>{console.error("[Pipeline] Error from stream transform:",e)}),e.next=3,n.abort(i);case 3:return e.next=5,r.cancel(i);case 5:s.emit("pipelineInfo","pipeline_ended_with_error");case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),this.emit("pipelineInfo","pipeline_started_with_error"),this.destroy(),e.abrupt("return");case 13:this.emit("pipelineInfo","pipeline_started"),console.log("[Pipeline] Pipeline started.");case 14:case"end":return e.stop()}}),e,this,[[3,9]])})));return function(t,n){return e.apply(this,arguments)}}(),n.destroy=function(){var e=(0,c.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(console.log("[Pipeline] Destroying Pipeline."),t=A(this.transformers_);!(n=t()).done;)n.value.stop();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t}(G),fe=function(t){function n(){var e;return(e=t.call(this)||this).reporter_=new Qe,e.trackExpectedRate_=-1,e.report({variation:"Create"}),e}(0,a.default)(n,t);var r=n.prototype;return r.setTrackExpectedRate=function(e){this.trackExpectedRate_=e,this.pipeline_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_)},r.transform=function(e,t){return this.readable_=e,this.writable_=t,this.transformInternal()},r.transformInternal=function(){var t=this;return new e(function(){var e=(0,c.default)(o.default.mark((function e(n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.transformers_&&0!==t.transformers_.length){e.next=3;break}return t.report({message:Q.errors.transformer_none,variation:"Error"}),r("[MediaProcessor] Need to set transformers."),e.abrupt("return");case 3:if(t.readable_){e.next=6;break}return t.report({variation:"Error",message:Q.errors.readable_null}),r("[MediaProcessor] Readable is null."),e.abrupt("return");case 6:if(t.writable_){e.next=9;break}return t.report({variation:"Error",message:Q.errors.writable_null}),r("[MediaProcessor] Writable is null."),e.abrupt("return");case 9:i=!1,t.pipeline_&&(i=!0,t.pipeline_.clearListeners(),t.pipeline_.destroy()),t.pipeline_=new Ze(t.transformers_),t.pipeline_.on("warn",e=>{t.emit("warn",e)}),t.pipeline_.on("error",e=>{t.emit("error",e)}),t.pipeline_.on("pipelineInfo",e=>{i&&("pipeline_started"===e?e=be.pipeline_restarted:"pipeline_started_with_error"===e&&(e=be.pipeline_restarted_with_error)),t.emit("pipelineInfo",e)}),-1!=t.trackExpectedRate_&&t.pipeline_.setTrackExpectedRate(t.trackExpectedRate_),t.pipeline_.start(t.readable_,t.writable_).then(()=>{n()}).catch(e=>{r(e)});case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())},r.setTransformers=function(t){return this.report({variation:"Update",message:Q.updates.transformer_new}),this.transformers_=t,this.readable_&&this.writable_?this.transformInternal():e.resolve()},r.destroy=function(){var t=this;return new e(function(){var e=(0,c.default)(o.default.mark((function e(n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.pipeline_&&t.pipeline_.destroy(),t.report({variation:"Delete"}),n();case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},r.report=function(e){this.reporter_.send(Object.assign({version:Fe,action:"MediaProcessor"},e))},n}(G),Re=function(){function t(){this.processor_=null,this.generator_=null}var n=t.prototype;return n.init=function(t){return new e((e,n)=>{try{this.processor_=new MediaStreamTrackProcessor(t)}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackProcessor failed: "+e),n(e)}try{"audio"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):"video"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):n("kind not supported")}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackGenerator failed: "+e),n(e)}e()})},n.getReadable=function(){return this.processor_.readable},n.getWriteable=function(){return this.generator_.writable},n.getProccesorTrack=function(){return this.generator_},t}(),Ie=function(){function t(e){this.insertableStreamHelper_=new Re,this.mediaProcessor_=e}var n=t.prototype;return n.setTrack=function(t){return new e((e,n)=>{this.insertableStreamHelper_.init(t).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{e(this.insertableStreamHelper_.getProccesorTrack())}).catch(e=>{n(e)})}).catch(e=>{n(e)})})},n.destroy=function(){return new e((e,t)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(e=>{t(e)}):t("no processor")})},t}();var ye=(e=>(e.Low="Low",e.High="High",e))(ye||{}),Ve=(e=>(e.BackgroundBlur="BackgroundBlur",e.VirtualBackground="VirtualBackground",e.VideoBackground="VideoBackground",e.SilhouetteBlur="SilhouetteBlur",e))(Ve||{}),Ce=(e=>(e.FAST="FAST",e.PRECISE="PRECISE",e))(Ce||{}),We=(e=>(e.CANVAS="CANVAS",e.WEBGL="WEBGL",e))(We||{});t.RenderingType=We,t.WebglSelfieSegmentationType=Ce,t.BackgroundTransformerType=Ve,t.BlurRadius=ye;const Ee=function(){var e=(0,c.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function Se(){return(Se=(0,c.default)(o.default.mark((function e(){var t,n,r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ve();case 2:if(t=e.sent,n=t.wasm,r=t.insertableStreams,i=t.simd,a=t.webgl,n.supported){e.next=9;break}throw n.message;case 9:if(r.supported){e.next=11;break}throw r.message;case 11:if(i.supported){e.next=13;break}throw i.message;case 13:if(a.supported){e.next=15;break}throw a.message;case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return Je.apply(this,arguments)}function Je(){return(Je=(0,c.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0={supported:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate,message:"Your browser does not support WebAssembly features."},e.next=3,Ee();case 3:return e.t1=e.sent,e.t2={supported:e.t1,message:"Your browser does not support simd features."},e.t3={supported:!0},e.t4={message:"Your browser does not support gpu features.",supported:!0},e.t5=Ne(),e.t6=Ge(),t={wasm:e.t0,simd:e.t2,insertableStreams:e.t3,gpu:e.t4,webgl:e.t5,performance:e.t6},e.prev=10,e.next=13,g();case 13:e.next=18;break;case 15:e.prev=15,e.t7=e.catch(10),t.insertableStreams.supported=!1,t.insertableStreams.message=e.t7;case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[10,15]])})))).apply(this,arguments)}function Ne(){if(!OffscreenCanvas)return{supported:!1,message:"Your browser does not support offscreen canvas"};const e=new OffscreenCanvas(0,0).getContext("webgl2");if(!e)return{supported:!1,message:"Your browser does not support webgl 2"};{const t=null==e?void 0:e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return{supported:!0}}function Ge(){const e=new OffscreenCanvas(0,0).getContext("webgl2",{failIfMajorPerformanceCaveat:!0});if(!e)return{supported:!1,message:"Your hardware does not perform good enough to run the library efficiently"};{const t=null==e?void 0:e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return{supported:!0}}const Xe={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(e,t){return t=new Z(new m(t)),h&&e.prototype&&h(t,e.prototype),t}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s};var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var C,W,E=typeof TextDecoder<"u",S=typeof TextEncoder<"u";function v(e){if(S)e=(W||(W=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var J={},N=null;function G(e,t){void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array.prototype.slice;function w(e,t,n){return t===n?T||(T=new Uint8Array(0)):Y?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var D=0;function x(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.l=!1,this.v=t,e&&M(this,e)}function M(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?X(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.j=0,e.i=e.h.length,e.g=e.j}function H(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&e.g++,r)))))}function K(e){var t=e.h[e.g],n=e.h[e.g+1],r=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,e=2*((n=(t<<0|n<<8|r<<16|i<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))}x.prototype.reset=function(){this.g=this.j};var L=[];function z(){this.g=new Uint8Array(64),this.h=0}function O(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function j(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,L.length?(n=L.pop(),t&&(n.v=t.v),e&&M(n,e),e=n):e=new x(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function P(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.m=e.g.g;var n=7&(t=H(e.g));return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function _(e,t,n){var r=e.g.i,i=H(e.g);return i=e.g.g+i,e.g.i=i,n(t,e),e.g.g=i,e.g.i=r,t}function q(e){var t,n=H(e.g),r=(e=e.g).g;if(e.g+=n,e=e.h,E)(t=C)||(t=C=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(r,r+n));else{n=r+n;for(var i,o,a,l=[],c=null;r<n;)128>(i=e[r++])?l.push(i):224>i?r>=n?l.push(65533):(o=e[r++],194>i||128!=(192&o)?(r--,l.push(65533)):l.push((31&i)<<6|63&o)):240>i?r>=n-1?l.push(65533):128!=(192&(o=e[r++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[r++]))?(r--,l.push(65533)):l.push((15&i)<<12|(63&o)<<6|63&t):244>=i?r>=n-2?l.push(65533):128!=(192&(o=e[r++]))||o-144+(i<<28)>>30||128!=(192&(t=e[r++]))||128!=(192&(a=e[r++]))?(r--,l.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&a,i-=65536,l.push(55296+(i>>10&1023),56320+(1023&i))):l.push(65533),8192<=l.length&&(c=V(c,l),l.length=0);t=V(c,l)}return t}function $(){this.h=[],this.i=0,this.g=new z}function ee(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function te(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var n=e.h,r=n.length,i=0,o=0;o<r;o++){var a=n[o];0!==a.length&&(t.set(a,i),i+=a.length)}return 0!==(r=(n=e.g).h)&&(t.set(n.g.subarray(0,r),i),n.h=0),e.h=[t],t}function ne(e,t,n){if(null!=n){O(e.g,8*t+5),e=e.g;var r=n;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?D=0:(0,D=2147483648):isNaN(r)?(0,D=2147483647):34028234663852886e22<r?(0,D=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,D=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),r=8388607&Math.round(8388608*r),0,D=(n<<31|t+127<<23|r)>>>0),n=D,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}z.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},z.prototype.length=function(){return this.h},z.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,w(e,0,t)},j.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var re="function"==typeof Uint8Array;function ie(e,t,n){if(null!=e)return"object"==typeof e?re&&e instanceof Uint8Array?n(e):oe(e,t,n):t(e)}function oe(e,t,n){if(Array.isArray(e)){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=ie(e[i],t,n);return Array.isArray(e)&&e.W&&se(r),r}for(i in r={},e)r[i]=ie(e[i],t,n);return r}function ae(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var le,ce={W:{value:!0,configurable:!0}};function se(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,ce),e}function de(e,t,n){var r=le;if(le=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=r?0:-1,this.i=null,this.g=e,e=(r=this.g.length)-1,r&&null!==(r=this.g[e])&&"object"==typeof r&&r.constructor===Object?(this.l=e-this.j,this.h=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.g[e])?se(r):this.g[e]=ue):(Ae(this),(r=this.h[e])?se(r):this.h[e]=ue)}var ue=Object.freeze(se([]));function Ae(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function he(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function ge(e){var t=void 0!==t&&t,n=he(e,1,t);return null==n&&(n=ue),n===ue&&Fe(e,1,n=se([]),t),n}function Qe(e,t,n){var r;return null!=(r=e=null==(e=he(e,t))?e:+e)?r:void 0===n?0:n}function Fe(e,t,n,r){void 0!==r&&r||t>=e.l?(Ae(e),e.h[t]=n):e.g[t+e.j]=n}function pe(e,t){e.i||(e.i={});var n=e.i[1];if(!n){var r=ge(e);n=[];for(var i=0;i<r.length;i++)n[i]=new t(r[i]);e.i[1]=n}return n}function Ue(e,t,n,r){var i=pe(e,n);t=t||new n,e=ge(e),null!=r?(i.splice(r,0,t),e.splice(r,0,me(t))):(i.push(t),e.push(me(t)))}function me(e,t){if(e.i)for(var n in e.i){var r=e.i[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&me(r[i]);else r&&me(r)}return e.g}function be(e,t){var n;return null!=(n=e=he(e,t))?n:0}function Be(e,t){var n;return null!=(n=e=he(e,t))?n:""}function Ze(e,t){if(e=e.m){ee(t,t.g.end());for(var n=0;n<e.length;n++)ee(t,e[n])}}function fe(e,t){if(4==t.h)return!1;var n=t.m;return function e(t){switch(t.h){case 0:if(0!=t.h)e(t);else{for(t=t.g;128&t.h[t.g];)t.g++;t.g++}break;case 1:1!=t.h?e(t):(t=t.g).g+=8;break;case 2:if(2!=t.h)e(t);else{var n=H(t.g);(t=t.g).g+=n}break;case 5:5!=t.h?e(t):(t=t.g).g+=4;break;case 3:for(n=t.l;;){if(!P(t)){t.j=!0;break}if(4==t.h){t.l!=n&&(t.j=!0);break}e(t)}break;default:t.j=!0}}(t),t.N||(t=w(t.g.h,n,t.g.g),(n=e.m)?n.push(t):e.m=[t]),!0}function Re(t,n){var r=void 0;return new(r||(r=e))((function(e,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,a)}l((n=n.apply(t,void 0)).next())}))}function Ie(e){de.call(this,e)}function ye(e,t){for(;P(t);)switch(t.i){case 8:var n=H(t.g);Fe(e,1,n);break;case 21:Fe(e,2,n=K(t.g));break;case 26:Fe(e,3,n=q(t));break;case 34:Fe(e,4,n=q(t));break;default:if(!fe(e,t))return e}return e}function Ve(e){de.call(this,e,-1,Ce)}de.prototype.toJSON=function(){return oe(me(this),ae,G)},de.prototype.toString=function(){return me(this).toString()},g(Ie,de),g(Ve,de),Ve.prototype.addClassification=function(e,t){Ue(this,e,Ie,t)};var Ce=[1];function We(e){de.call(this,e)}function Ee(e,t){for(;P(t);)switch(t.i){case 13:var n=K(t.g);Fe(e,1,n);break;case 21:Fe(e,2,n=K(t.g));break;case 29:Fe(e,3,n=K(t.g));break;case 37:Fe(e,4,n=K(t.g));break;case 45:Fe(e,5,n=K(t.g));break;default:if(!fe(e,t))return e}return e}function Se(e){de.call(this,e,-1,ve)}g(We,de),g(Se,de);var ve=[1];function Je(e){de.call(this,e)}function Ne(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Ge(e){return pe(e,Ie).map((function(e){return{index:be(e,1),Y:Qe(e,2),label:null!=he(e,3)?Be(e,3):void 0,displayName:null!=he(e,4)?Be(e,4):void 0}}))}function Xe(e){return{x:Qe(e,1),y:Qe(e,2),z:Qe(e,3),visibility:null!=he(e,4)?Qe(e,4):void 0}}function ke(e,t){this.h=e,this.g=t,this.l=0}function Te(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Ne(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Ne(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Ye(e){this.g=e}g(Je,de);var we=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function De(e,t){return t+e}function xe(e,t){window[e]=t}function Me(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||De,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function He(t){return Re(t,(function t(){var n,r,i,o,a,l,s,d,u,A,h,g=this;return f(t,(function(t){switch(t.g){case 1:return n=g,g.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(g,g.j),U(t,function(){return Re(this,(function e(){return f(e,(function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(we),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):t.return();case 2:if(i=t.h,"object"==typeof window)return xe("createMediapipeSolutionsWasm",{locateFile:g.locateFile}),xe("createMediapipeSolutionsPackedAssets",{locateFile:g.locateFile}),l=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(t){var r=Ke(n,t.url);if(void 0!==t.path){var i=t.path;r=r.then((function(t){return n.overrideFile(i,t),e.resolve(t)}))}return r}))),u=e.all(s.map((function(t){return void 0===t.simd||t.simd&&i||!t.simd&&!i?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(n.locateFile(t.url,n.S)):e.resolve()}))).then((function(){return Re(n,(function e(){var t,n,r=this;return f(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,U(e,t(n),2);r.h=e.h,e.g=0}))}))})),A=Re(n,(function e(){var t=this;return f(e,(function(e){return t.g.graph&&t.g.graph.url?e=U(e,Ke(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),U(t,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter((function(e){return void 0===e.simd||e.simd&&i||!e.simd&&!i})).map((function(e){return n.locateFile(e.url,n.S)})),importScripts.apply(null,c(o)),U(t,createMediapipeSolutionsWasm(Module),6);case 6:g.h=t.h,g.l=new OffscreenCanvas(1,1),g.h.canvas=g.l,a=g.h.GL.createContext(g.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),g.h.GL.makeContextCurrent(a),t.g=4;break;case 7:if(g.l=document.createElement("canvas"),!(h=g.l.getContext("webgl2",{}))&&!(h=g.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();g.D=h,g.h.canvas=g.l,g.h.createContext(g.l,!0,!0,{});case 4:g.i=new g.h.SolutionWasm,g.R=!1,t.g=0}}))}))}function Ke(e,t){return Re(e,(function e(){var n,r,i=this;return f(e,(function(e){return t in i.F?e.return(i.F[t]):(n=i.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),i.F[t]=r,e.return(r))}))}))}function Le(e,t,n){return Re(e,(function e(){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p,m=this;return f(e,(function(e){switch(e.g){case 1:if(!n)return e.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(m.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){e.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(e,function(e,t,n){return Re(e,(function e(){var r,i=this;return f(e,(function(e){return"number"==typeof n||n instanceof Uint8Array||n instanceof i.h.Uint8BlobList?e.return(n):n instanceof i.h.Texture2dDataOut?((r=i.s[t])||(r=new ke(i.h,i.D),i.s[t]=r),e.return(Te(r,n,i.G))):e.return(void 0)}))}))}(m,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=b.get(I);e:{var V=new Je;for(y=new j(y);P(y);)switch(y.i){case 13:var C=K(y.g);Fe(V,1,C);break;case 21:Fe(V,2,C=K(y.g));break;case 29:Fe(V,3,C=K(y.g));break;case 37:Fe(V,4,C=K(y.g));break;case 45:Fe(V,5,C=K(y.g));break;case 48:for(var W=y.g,E=128,S=0,v=C=0;4>v&&128<=E;v++)S|=(127&(E=W.h[W.g++]))<<7*v;if(128<=E&&(S|=(127&(E=W.h[W.g++]))<<28,C|=(127&E)>>4),128<=E)for(v=0;5>v&&128<=E;v++)C|=(127&(E=W.h[W.g++]))<<7*v+3;128>E?(W=S>>>0,(C=2147483648&(E=C>>>0))&&(E=~E>>>0,0==(W=1+~W>>>0)&&(E=E+1>>>0)),W=4294967296*E+(W>>>0),C=C?-W:W):(W.l=!0,C=void 0),Fe(V,6,C);break;default:if(!fe(V,y))break e}}V={Z:Qe(V,1),$:Qe(V,2),height:Qe(V,3),width:Qe(V,4),rotation:Qe(V,5,0),X:be(V,6)},C=B.get(I);e:for(y=new Se,C=new j(C);P(C);)switch(C.i){case 10:Ue(y,W=_(C,new We,Ee),We,void 0);break;default:if(!fe(y,C))break e}y=pe(y,We).map(Xe),W=Z.get(I);e:for(C=new Ve,W=new j(W);P(W);)switch(W.i){case 10:C.addClassification(_(W,new Ie,ye));break;default:if(!fe(C,W))break e}V={T:V,O:y,M:Ge(C)},R.push(V)}b=R}else b=[];r[u]=b,e.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===A.type){r[u]=h,e.g=7;break}if("proto"===A.type){r[u]=h,e.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=m.s[u])||(g=new ke(m.h,m.D),m.s[u]=g),U(e,Te(g,h,m.G),13);case 13:Q=e.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),e.g=3;break;case 14:F[p]=e.h;case 3:a=d.next(),e.g=2;break;case 4:return e.return(r)}}))}))}function ze(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=Le(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Oe(e){switch(void 0===e&&(e=0),e){case 1:return"selfie_segmentation_landscape.tflite";default:return"selfie_segmentation.tflite"}}function je(e){var t=this;e=e||{},this.g=new Me({locateFile:e.locateFile,files:function(e){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:Oe(e.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(e){return Re(t,(function t(){var n,r,i,o=this;return f(t,(function(t){return 1==t.g?(n=Oe(e),r="third_party/mediapipe/modules/selfie_segmentation/"+n,U(t,Ke(o.g,n),2)):(i=t.h,o.g.overrideFile(r,i),t.return(!0))}))}))}}}})}(t=Me.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){return Re(this,(function e(){var t=this;return f(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return Re(n,(function t(){var n=this;return f(t,(function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(r))}},t.initialize=function(){return Re(this,(function e(){var t=this;return f(e,(function(e){return 1==e.g?U(e,He(t),2):3!=e.g?U(e,function(e){return Re(e,(function e(){var t,n,r,i,o,a,c,s,d=this;return f(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,U(e,Ke(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),n=l(Object.keys(d.B)),r=n.next();!r.done;r=n.next())i=r.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(o=l(d.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,ze(d,c);s=d.j,d.j={},d.setOptions(s),e.g=0}))}))}(t),3):U(e,function(e){return Re(e,(function e(){var t,n,r,i,o,a,c=this;return f(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=l(c.u),n=t.next();case 3:if(n.done){e.g=5;break}return U(e,(0,n.value)(),4);case 4:n=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(r=new c.h.GraphOptionChangeRequestList,i=l(c.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);c.i.changeOptions(r),r.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){return Re(this,(function n(){var r,i,o,a,c,s,d,u,A,h=this;return f(n,(function(n){switch(n.g){case 1:return h.g.inputs?(r=1e3*(null!=t?t:performance.now()),U(n,h.C,2)):n.return();case 2:return U(n,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,o=l(Object.keys(e)),a=o.next();!a.done;a=o.next())if(c=a.value,s=h.g.inputs[c]){e:{var g=h,Q=e[c];switch(s.type){case"video":var F=g.m[s.stream];if(F||(F=new ke(g.h,g.D),g.m[s.stream]=F),0===(g=F).l&&(g.l=g.h.createTexture()),typeof HTMLVideoElement<"u"&&Q instanceof HTMLVideoElement){var p=Q.videoWidth;F=Q.videoHeight}else typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement?(p=Q.naturalWidth,F=Q.naturalHeight):(p=Q.width,F=Q.height);F={glName:g.l,width:p,height:F},(p=g.g).canvas.width=F.width,p.canvas.height=F.height,p.activeTexture(p.TEXTURE0),g.h.bindTexture2d(g.l),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,Q),g.h.bindTexture2d(0),g=F;break e;case"detections":for((F=g.m[s.stream])||(F=new Ye(g.h),g.m[s.stream]=F),(g=F).data||(g.data=new g.g.DetectionListData),g.data.reset(Q.length),F=0;F<Q.length;++F){p=Q[F];var m=g.data,b=m.setBoundingBox,B=F,Z=p.T,f=new Je;Fe(f,1,Z.Z),Fe(f,2,Z.$),Fe(f,3,Z.height),Fe(f,4,Z.width),Fe(f,5,Z.rotation),Fe(f,6,Z.X);var R=Z=new $;ne(R,1,he(f,1)),ne(R,2,he(f,2)),ne(R,3,he(f,3)),ne(R,4,he(f,4)),ne(R,5,he(f,5));var I=he(f,6);if(null!=I&&null!=I){O(R.g,48);var y=R.g,V=I;I=0>V;var C=(V=Math.abs(V))>>>0;for(V=Math.floor((V-C)/4294967296),V>>>=0,I&&(V=~V>>>0,4294967295<(C=1+(~C>>>0))&&(C=0,4294967295<++V&&(V=0))),I=D=C,C=V;0<C||127<I;)y.push(127&I|128),I=(I>>>7|C<<25)>>>0,C>>>=7;y.push(I)}if(Ze(f,R),Z=te(Z),b.call(m,B,Z),p.O)for(m=0;m<p.O.length;++m)R=!!(f=p.O[m]).visibility,B=(b=g.data).addNormalizedLandmark,Z=F,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Fe(R=new We,1,f.x),Fe(R,2,f.y),Fe(R,3,f.z),f.visibility&&Fe(R,4,f.visibility),ne(y=f=new $,1,he(R,1)),ne(y,2,he(R,2)),ne(y,3,he(R,3)),ne(y,4,he(R,4)),ne(y,5,he(R,5)),Ze(R,y),f=te(f),B.call(b,Z,f);if(p.M)for(m=0;m<p.M.length;++m){if(B=(b=g.data).addClassification,Z=F,f=p.M[m],Fe(R=new Ie,2,f.Y),f.index&&Fe(R,1,f.index),f.label&&Fe(R,3,f.label),f.displayName&&Fe(R,4,f.displayName),y=f=new $,null!=(C=he(R,1))&&null!=C)if(O(y.g,8),I=y.g,0<=C)O(I,C);else{for(V=0;9>V;V++)I.push(127&C|128),C>>=7;I.push(1)}ne(y,2,he(R,2)),null!=(I=he(R,3))&&(I=v(I),O(y.g,26),O(y.g,I.length),ee(y,y.g.end()),ee(y,I)),null!=(I=he(R,4))&&(I=v(I),O(y.g,34),O(y.g,I.length),ee(y,y.g.end()),ee(y,I)),Ze(R,y),f=te(f),B.call(b,Z,f)}}g=g.data;break e;default:g={}}}switch(d=g,u=s.stream,s.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:r}));break;case"detections":(A=d).stream=u,A.timestamp=r,i.pushDetectionList(A);break;default:throw Error("Unknown input config type: '"+s.type+"'")}}return h.i.send(i),U(n,h.C,4);case 4:i.delete(),n.g=0}}))}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Me),y("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=je.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){return Re(this,(function e(){var t=this;return f(e,(function(e){return U(e,t.g.initialize(),0)}))}))},t.reset=function(){this.g.reset()},t.send=function(e){return Re(this,(function t(){var n=this;return f(t,(function(t){return U(t,n.g.send(e),0)}))}))},t.setOptions=function(e){this.g.setOptions(e)},y("SelfieSegmentation",je),y("VERSION","0.1.1632777926")}).call(Xe);const ke={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ra=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={fa:t,ga:!0},e.g=e.o||e.u}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ga)throw t.fa;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.s):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.s=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.M(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.s=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).M(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).M(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(){throw Error("Invalid UTF8")}function C(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var W,E,S=typeof TextDecoder<"u",v=typeof TextEncoder<"u",J={},N=null;function G(e){var t;void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),i!==n?r.subarray(0,i):r}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array;function w(e){return Y&&null!=e&&e instanceof Uint8Array}function D(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var x="function"==typeof Uint8Array.prototype.slice,M=0;function H(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function K(){return Error("Failed to read varint, encoding is invalid.")}function L(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&z(this,e)}function z(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return X(e);if(e.constructor===D)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||w(t)?t:"string"==typeof t?X(t):null,(e=e.L=t)?new Uint8Array(e):T||(T=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function O(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function j(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,O(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,O(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,O(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,O(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return O(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw K();return O(e),r}L.prototype.reset=function(){this.g=this.j};var P=[];function _(){this.g=[]}function q(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function $(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,P.length?(n=P.pop(),t&&(n.v=t.v),e&&z(n,e),e=n):e=new L(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=j(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw H(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(!(128&e.h[t++])){e.g=t,O(e);break e}throw K()}break;case 1:(e=e.g).g+=8,O(e);break;case 2:2!=e.h?te(e):(t=j(e.g)>>>0,(e=e.g).g+=t,O(e));break;case 5:(e=e.g).g+=4,O(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw H(e.h,e.j)}}_.prototype.length=function(){return this.g.length},_.prototype.end=function(){var e=this.g;return this.g=[],e},$.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new _}function ie(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(oe?e[oe]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function le(e){var t;return null!=(t=oe?e[oe]:e.N)?t:0}function ce(e){return ae(e,1),e}function se(e){return!!Array.isArray(e)&&!!(2&le(e))}function de(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function ue(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var Ae=Object.freeze(ce([]));function he(e){if(se(e.m))throw Error("Cannot mutate an immutable Message")}var ge,Qe=typeof Symbol<"u"&&typeof Symbol.hasInstance<"u";function Fe(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function pe(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function Ue(e,t,n,r){r=void 0!==r&&r,he(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function me(e,t,n,r){n=void 0===n||n;var i=pe(e,t,r=void 0!==r&&r);return null==i&&(i=Ae),se(e.m)?n&&(de(i),Object.freeze(i)):(i===Ae||se(i))&&Ue(e,t,i=ce(i.slice()),r),i}function be(e,t,n){var r;return null!=(r=e=null==(e=pe(e,t))?e:+e)?r:void 0===n?0:n}function Be(e,t,n,r){e.j||(e.j={});var i=se(e.m),o=e.j[n];if(!o){r=me(e,n,!0,void 0!==r&&r),o=[],i=i||se(r);for(var a=0;a<r.length;a++)o[a]=new t(r[a]),i&&de(o[a].m);i&&(de(o),Object.freeze(o)),e.j[n]=o}return o}function Ze(e,t,n,r,i){var o=void 0!==o&&o;return he(e),o=Be(e,n,t,o),n=r||new n,e=me(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.m)):(o.push(n),e.push(n.m)),n}function fe(e,t){var n;return null!=(n=e=pe(e,t))?n:0}function Re(e,t){var n;return null!=(n=e=pe(e,t))?n:""}function Ie(e){var t=Ce;return Ve(e,t=void 0===t?We:t)}function ye(e,t){if(null!=e){if(Array.isArray(e))e=Ve(e,t);else if(ue(e)){var n,r={};for(n in e)r[n]=ye(e[n],t);e=r}else e=t(e);return e}}function Ve(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=ye(n[r],t);return Array.isArray(e)&&1&le(e)&&ce(n),n}function Ce(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(w(e))return G(e);if(e instanceof D){var t=e.L;return t=null==t||"string"==typeof t?t:Y&&t instanceof Uint8Array?G(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?Ie(e):e)}function We(e){return w(e)?new Uint8Array(e):e}function Ee(e,t,n){e||(e=ge),ge=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&ue(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)e+=this.h,(r=this.m[e])?Array.isArray(r)&&ce(r):this.m[e]=Ae;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];i?Array.isArray(i)&&ce(i):r[e]=Ae}}function Se(){Ee.apply(this,arguments)}if(Ee.prototype.toJSON=function(){return Ie(this.m)},Ee.prototype.toString=function(){return this.m.toString()},g(Se,Ee),Qe){var ve={};Object.defineProperties(Se,(ve[Symbol.hasInstance]=Fe((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),ve))}function Je(e,t,n){if(n){var r,i={};for(r in n){var o=n[r],a=o.ja;a||(i.F=o.pa||o.ha.P,o.ba?(i.U=we(o.ba),a=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(i)):o.da?(i.T=De(o.X.g,o.da),a=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(i)):a=i.F,o.ja=a),a(t,e,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(e,t){if(t=t.ca){ie(e,e.g.end());for(var n=0;n<t.length;n++)ie(e,t[n])}}(t,e)}var Ne=Symbol();function Ge(e,t,n){return e[Ne]||(e[Ne]=function(e,r){return t(e,r,n)})}function Xe(e){var t=e[Ne];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ne]=t}return t}function ke(e){var t=function(e){var t=e.ba;return t?Xe(t):(t=e.oa)?Ge(e.X.g,t,e.da):void 0}(e),n=e.X,r=e.ha.O;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Te(e,t,n,r,i,o){var a=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),a++);a<e.length;){n=e[a++];for(var l=a+1;l<e.length&&"number"!=typeof e[l];)l++;var c=e[a++];switch(l-=a){case 0:r(t,n,c);break;case 1:r(t,n,c,e[a++]);break;case 2:i(t,n,c,e[a++],e[a++]);break;case 3:l=e[a++];var s=e[a++],d=e[a++];Array.isArray(d)?i(t,n,c,l,s,d):o(t,n,c,l,s,d);break;case 4:o(t,n,c,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return t}var Ye=Symbol();function we(e){var t=e[Ye];if(!t){var n=ze(e);t=function(e,t){return nt(e,t,n)},e[Ye]=t}return t}function De(e,t){var n=e[Ye];return n||(n=function(e,n){return Je(e,n,t)},e[Ye]=n),n}var xe=Symbol();function Me(e,t){e.push(t)}function He(e,t,n){e.push(t,n.P)}function Ke(e,t,n,r,i){var o=we(i),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,o)}))}function Le(e,t,n,r,i,o){var a=De(r,o),l=n.P;e.push(t,(function(e,t,n){return l(e,t,n,r,a)}))}function ze(e){return e[xe]||Te(e,e[xe]=[],Me,He,Ke,Le)}var Oe=Symbol();function je(e,t){e[0]=t}function Pe(e,t,n,r){var i=n.O;e[t]=r?function(e,t,n){return i(e,t,n,r)}:i}function _e(e,t,n,r,i,o){var a=n.O,l=Xe(i);e[t]=function(e,t,n){return a(e,t,n,r,l,o)}}function qe(e,t,n,r,i,o,a){var l=n.O,c=Ge(r,i,o);e[t]=function(e,t,n){return l(e,t,n,r,c,a)}}function $e(e){return e[Oe]||Te(e,e[Oe]={},je,Pe,_e,qe)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=ke(o))}if(!(i&&i(t,e,r)||(i=t,r=e,o=i.j,te(i),i.W))){var a=i.g.h;i=o===(i=i.g.g)?T||(T=new Uint8Array(0)):x?a.slice(o,i):new Uint8Array(a.subarray(o,i)),(o=r.ca)?o.push(i):r.ca=[i]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(z(r.g,e),r.i=-1,r.h=-1),e=r}else e=new $(e);try{return et(new t,e,$e(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,i=r%2==1,o=i?1:0;o<r;o+=2)(0,n[o+1])(t,e,n[o]);Je(e,t,i?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,ze(t)),ie(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,i=0,o=0;o<r;o++){var a=t[o];e.set(a,i),i+=a.length}return n.i=[e],e}function it(e,t){return{O:e,P:t}}var ot=it((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,O(e),e=2*((i=(r<<0|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,Ue(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){q(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?M=0:(0,M=2147483648):isNaN(r)?(0,M=2147483647):34028234663852886e22<r?(0,M=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,M=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,M=(n<<31|t+127<<23|8388607&r)>>>0),n=M,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=it((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,a=e=0;4>a&&128<=i;a++)i=r.h[r.g++],O(r),o|=(127&i)<<7*a;if(128<=i&&(i=r.h[r.g++],O(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)i=r.h[r.g++],O(r),e|=(127&i)<<7*a+3;if(!(128>i))throw K();return r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),Ue(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t){q(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=M=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),lt=it((function(e,t,n){return 0===e.h&&(Ue(t,n,j(e.g)),!0)}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t)if(q(e.g,8*n),e=e.g,0<=(n=t))q(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ct=it((function(e,t,n){if(2!==e.h)return!1;var r,i=j(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,O(e),e=e.h,S)(r=W)||(r=W=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?V():(l=e[o++],194>a||128!=(192&l)?(o--,V()):s.push((31&a)<<6|63&l)):240>a?o>=i-1?V():128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,V()):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?V():128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,V()):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):V(),8192<=s.length&&(d=C(d,s),s.length=0);r=C(d,s)}return Ue(t,n,r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){var r=!1;if(r=void 0!==r&&r,v){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(E||(E=new TextEncoder)).encode(t)}else{for(var i=0,o=new Uint8Array(3*t.length),a=0;a<t.length;a++){var l=t.charCodeAt(a);if(128>l)o[i++]=l;else{if(2048>l)o[i++]=l>>6|192;else{if(55296<=l&&57343>=l){if(56319>=l&&a<t.length){var c=t.charCodeAt(++a);if(56320<=c&&57343>=c){l=1024*(l-55296)+c-56320+65536,o[i++]=l>>18|240,o[i++]=l>>12&63|128,o[i++]=l>>6&63|128,o[i++]=63&l|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");l=65533}o[i++]=l>>12|224,o[i++]=l>>6&63|128}o[i++]=63&l|128}}t=o.subarray(0,i)}q(e.g,8*n+2),q(e.g,t.length),ie(e,e.g.end()),ie(e,t)}})),st=it((function(e,t,n,r,i){if(2!==e.h)return!1;t=Ze(t,n,r),n=e.g.i,r=j(e.g)>>>0;var o=e.g.g+r,a=o-n;if(0>=a&&(e.g.i=o,i(t,e),a=o-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=n,!0}),(function(e,t,n,r,i){if(null!=(t=Be(t,r,n)))for(r=0;r<t.length;r++){var o=e;q(o.g,8*n+2);var a=o.g.end();ie(o,a),a.push(o.h),o=a,i(t[r],e),a=e;var l=o.pop();for(l=a.h+a.g.length()-l;127<l;)o.push(127&l|128),l>>>=7,a.h++;o.push(l),a.h++}}));function dt(){Se.apply(this,arguments)}if(g(dt,Se),Qe){var ut={};Object.defineProperties(dt,(ut[Symbol.hasInstance]=Fe(Object[Symbol.hasInstance]),ut))}function At(e){dt.call(this,e)}function ht(){return[1,lt,2,ot,3,ct,4,ct]}function gt(e){dt.call(this,e,-1,Ft)}function Qt(){return[1,st,At,ht]}g(At,dt),g(gt,dt),gt.prototype.addClassification=function(e,t){return Ze(this,1,At,e,t),this};var Ft=[1];function pt(e){dt.call(this,e)}function Ut(){return[1,ot,2,ot,3,ot,4,ot,5,ot]}function mt(e){dt.call(this,e,-1,Bt)}function bt(){return[1,st,pt,Ut]}g(pt,dt),g(mt,dt);var Bt=[1];function Zt(e){dt.call(this,e)}function ft(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,at]}function Rt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function It(e){return Be(e,At,1).map((function(e){return{index:fe(e,1),score:be(e,2),label:null!=pe(e,3)?Re(e,3):void 0,displayName:null!=pe(e,4)?Re(e,4):void 0}}))}function yt(e){return{x:be(e,1),y:be(e,2),z:be(e,3),visibility:null!=pe(e,4)?be(e,4):void 0}}function Vt(e){return e.map((function(e){return Be(tt(e,mt,bt),pt,1).map(yt)}))}function Ct(e,t){this.h=e,this.g=t,this.l=0}function Wt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.o){var r=Rt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Rt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),qa:i},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Et(e){this.g=e}g(Zt,dt);var St=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function vt(e,t){return t+e}function Jt(e,t){window[e]=t}function Nt(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.$=!0,this.D=e.resolve(),this.Z="",this.C={},this.locateFile=t&&t.locateFile||vt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.aa=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Gt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.$?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.o=2,U(e,WebAssembly.instantiate(St),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return Jt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Jt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=Xt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.aa)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,Xt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.aa)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,na:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.G=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.$=!1,g.g=0}}))}function Xt(e,t){var n,r;return f((function(i){return t in e.H?i.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,i.return(r))}))}function kt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.I=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Ct(e.h,e.G),e.u[t]=r),i.return(Wt(r,n,e.I))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=tt(b.get(I),Zt,ft);y={ea:{ka:be(y,1),la:be(y,2),height:be(y,3),width:be(y,4),rotation:be(y,5,0),ia:fe(y,6)},Y:Be(tt(B.get(I),mt,bt),pt,1).map(yt),V:It(tt(Z.get(I),gt,Qt))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.u[u])||(g=new Ct(e.h,e.G),e.u[u]=g),U(m,Wt(g,h,e.I),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Tt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.D=kt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Yt(e){return void 0===e&&(e=0),1===e?"hand_landmark_full.tflite":"hand_landmark_lite.tflite"}function wt(e){var t=this;e=e||{},this.g=new Nt({locateFile:e.locateFile,files:function(e){return[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"},{data:!0,url:Yt(e.modelComplexity)}]},graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","multi_hand_world_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"proto_list",stream:"multi_hand_landmarks",transform:Vt},multiHandWorldLandmarks:{type:"proto_list",stream:"multi_hand_world_landmarks",transform:Vt},multiHandedness:{type:"proto_list",stream:"multi_handedness",transform:function(e){return e.map((function(e){return It(tt(e,gt,Qt))[0]}))}}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i;return f((function(o){return 1==o.g?(n=Yt(e),r="third_party/mediapipe/modules/hand_landmark/"+n,U(o,Xt(t.g,n),2)):(i=o.h,t.g.overrideFile(r,i),o.return(!0))}))}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}(t=Nt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={R:o.R,S:o.S},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.R=c.onChange,o.S=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Gt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.Z===e.g.graph.url?d.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Z=e.g.graph.url,U(d,Xt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Tt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.s)return c.return();if(!e.A){c.g=2;break}t=l(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.B),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.D,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.o[c.stream];if(Q||(Q=new Ct(A.h,A.G),A.o[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.o[c.stream])||(Q=new Et(A.h),A.o[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.ea,f=new Zt;if(Ue(f,1,Z.ka),Ue(f,2,Z.la),Ue(f,3,Z.height),Ue(f,4,Z.width),Ue(f,5,Z.rotation),Ue(f,6,Z.ia),Z=rt(f,ft),b.call(m,B,Z),F.Y)for(m=0;m<F.Y.length;++m){var R=!!(f=F.Y[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ue(R=new pt,1,f.x),Ue(R,2,f.y),Ue(R,3,f.z),f.visibility&&Ue(R,4,f.visibility),f=rt(R,Ut),B.call(b,Z,f)}if(F.V)for(m=0;m<F.V.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.V[m],Ue(R=new At,2,f.score),f.index&&Ue(R,1,f.index),f.label&&Ue(R,3,f.label),f.displayName&&Ue(R,4,f.displayName),f=rt(R,ht),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.D,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Nt),y("OptionType",{BOOL:0,NUMBER:1,ma:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=wt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Hands",wt),y("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),y("VERSION","0.4.1646424915")}).call(ke);var Te={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.da=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e){!function(e){I.setTimeout((function(){throw e}),0)}(e)}function C(e,t){V(Error("Invalid wire type: "+e+" (at position "+t+")"))}function W(){V(Error("Failed to read varint, encoding is invalid."))}function E(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var S,v,J=typeof TextDecoder<"u",N=typeof TextEncoder<"u";function G(e){if(N)e=(v||(v=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var X={},k=null;function T(e){var t;void 0===t&&(t=0),w(),t=X[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function Y(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=k[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}w();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function w(){if(!k){k={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));X[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===k[o]&&(k[o]=i)}}}}var D,x="function"==typeof Uint8Array;function M(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}M.prototype.toJSON=function(){if(null==this.g)var e="";else e=this.g,e=this.g=null==e||"string"==typeof e?e:x&&e instanceof Uint8Array?T(e):null;return e};var H="function"==typeof Uint8Array.prototype.slice;function K(e,t,n){return t===n?D||(D=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var L=0;function z(e,t){t=void 0!==(t=void 0===t?{}:t).u&&t.u,this.h=null,this.g=this.i=this.m=0,this.l=!1,this.u=t,e&&O(this,e)}function O(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return Y(e);if(e.constructor===M){if(null==e.g)var t=D||(D=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||x&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?Y(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.m=0,e.i=e.h.length,e.g=e.m}function j(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.l=!0,W()}function P(e){e.g>e.i&&(e.l=!0,V(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}z.prototype.reset=function(){this.g=this.m},z.prototype.j=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,P(this),n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,P(this),n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,P(this),n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,P(this),n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,P(this),n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]?(this.l=!0,W(),n):(P(this),n))))))},z.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,P(this),e=2*((n=(e<<0|t<<8|n<<16|r<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var _=[];function q(){this.g=new Uint8Array(64),this.h=0}function $(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ee(e,t){for(;127<t;)$(e,127&t|128),t>>>=7;$(e,t)}function te(e){var t={},n=void 0!==t.N&&t.N;this.m={u:void 0!==t.u&&t.u},this.N=n,t=this.m,_.length?(n=_.pop(),t&&(n.u=t.u),e&&O(n,e),e=n):e=new z(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ne(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=e.g.j();return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,C(n,e.l),!1)}function re(e){switch(e.h){case 0:if(0!=e.h)re(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(!(128&e.h[t])){e.g=t+1,P(e);break e}t++}e.l=!0,W()}break;case 1:(e=e.g).g+=8,P(e);break;case 2:2!=e.h?re(e):(t=e.g.j(),(e=e.g).g+=t,P(e));break;case 5:(e=e.g).g+=4,P(e);break;case 3:for(t=e.i;;){if(!ne(e)){e.j=!0,V(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,V(Error("Unmatched end-group tag")));break}re(e)}break;default:e.j=!0,C(e.h,e.l)}}function ie(e,t,n){e.N||(e=K(e.g.h,n,e.g.g),(n=t.o)?n.push(e):t.o=[e])}function oe(e,t,n){var r=e.g.i,i=e.g.j(),o=e.g.g+i;if(e.g.i=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=r,t}function ae(e,t,n){var r=e.g.j();for(r=e.g.g+r;e.g.g<r;)n.push(t.call(e.g))}q.prototype.length=function(){return this.h},q.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,K(e,0,t)},te.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var le=[];function ce(){this.h=[],this.i=0,this.g=new q}function se(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function de(e,t,n){ee(e.g,8*t+2),ee(e.g,n.length),se(e,e.g.end()),se(e,n)}var ue,Ae="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function he(e,t){Object.isFrozen(e)||(Ae?e[Ae]|=t:void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ge(e){var t;return e?null!=(t=Ae?e[Ae]:e.g)?t:0:0}function Qe(e){return Array.isArray(e)&&he(e,1),e}function Fe(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");he(e,2)}function pe(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Ue(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":return x&&null!=e&&e instanceof Uint8Array?T(e):e;default:return e}}function me(e,t){if(null!=e)return Array.isArray(e)||pe(e)?be(e,t):t(e)}function be(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=me(e[r],t);return 1&ge(e)&&Qe(n),n}for(r in n={},e)n[r]=me(e[r],t);return n}function Be(e,t,n){var r=ue;if(ue=null,e||(e=r),r=this.constructor.ba,e||(e=r?[r]:[]),this.j=(r?0:-1)-(this.constructor.$||0),this.m=this.g=null,this.h=e,e=(r=this.h.length)-1,r&&pe(r=this.h[e])?(this.l=e-this.j,this.i=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.h[e])?Qe(r):this.h[e]=fe):(Re(this),(r=this.i[e])?Qe(r):this.i[e]=fe)}var Ze,fe=Object.freeze(Qe([]));function Re(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function Ie(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ye(e,t,n){n=void 0===n||n;var r=void 0!==r&&r,i=Ie(e,t,r);return null==i&&(i=fe),i===fe?Ee(e,t,i=Qe([]),r):n&&Array.isArray(i)&&2&ge(i)&&Ee(e,t,i=i.slice(),r),i}function Ve(e){var t=ye(e,3,!1);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n<t.length;n++)t[n]=+t[n];e.m[3]=!0}return t}function Ce(e,t,n){var r;return null!=(r=e=Ie(e,t))?r:n}function We(e,t,n){var r;return null!=(r=e=null==(e=Ie(e,t))?e:+e)?r:void 0===n?0:n}function Ee(e,t,n,r){void 0!==r&&r||t>=e.l?(Re(e),e.i[t]=n):e.h[t+e.j]=n}function Se(e,t,n){if(-1===n)return null;e.g||(e.g={});var r=e.g[n];if(r)return r;var i=Ie(e,n,!1);return null==i?r:(t=new t(i),e.g[n]=t)}function ve(e,t,n){e.g||(e.g={});var r=e.g[n];if(!r){var i=ye(e,n,!1);r=[];for(var o=!!Array.isArray(i)&&!!(2&ge(i)),a=0;a<i.length;a++)r[a]=new t(i[a]),o&&Fe(r[a].h);o&&(Fe(r),Object.freeze(r)),e.g[n]=r}return r}function Je(e,t,n,r,i){var o=ve(e,r,t);n=n||new r,e=ye(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,Ne(n))):(o.push(n),e.push(Ne(n)))}function Ne(e){if(e.g)for(var t in e.g){var n=e.g[t];if(Array.isArray(n))for(var r=0;r<n.length;r++)n[r]&&Ne(n[r]);else n&&Ne(n)}return e.h}function Ge(e,t){if(e=e.o){se(t,t.g.end());for(var n=0;n<e.length;n++)se(t,e[n])}}function Xe(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=e[2];return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],a=e[2],l=e[3];return function(e,n,r){return t(e,n,r,o,a,l)};default:throw Error("unsupported number of parameters, expected [2-4], got "+e.length)}}function ke(e,t,n){for(;ne(t)&&4!=t.h;){var r=t.i,i=n[r];if(i){if(Array.isArray(i)&&(i=n[r]=Xe(i)),!i(t,e,r)){i=e;var o=(r=t).l;re(r),ie(r,i,o)}}else i=e,o=(r=t).l,re(r),ie(r,i,o)}return e}function Te(e,t){var n=new ce;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var a=r[o];0!==a.length&&(e.set(a,t),t+=a.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function Ye(e,t,n){if(le.length){var r=le.pop();e&&(O(r.g,e),r.i=-1,r.h=-1),e=r}else e=new te(e);try{return n(new t,e)}finally{(t=e.g).h=null,t.m=0,t.i=0,t.g=0,t.l=!1,t.u=!1,e.i=-1,e.h=-1,e.j=!1,100>le.length&&le.push(e)}}function we(e,t,n){if(null!=(t=Ie(t,n))){ee(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?L=0:(0,L=2147483648):isNaN(r)?(0,L=2147483647):34028234663852886e22<r?(0,L=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,L=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,L=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=L)>>>0&255),$(e,n>>>8&255),$(e,n>>>16&255),$(e,n>>>24&255)}}function De(e,t,n){return 5===e.h&&(Ee(t,n,e.g.o()),!0)}function xe(e,t,n){return(5===e.h||2===e.h)&&(t=ye(t,n),2==e.h?ae(e,z.prototype.o,t):t.push(e.g.o()),!0)}function Me(e,t,n){return 0===e.h&&(Ee(t,n,j(e.g)),!0)}function He(e,t,n){return 0===e.h&&(Ee(t,n,e.g.j()),!0)}function Ke(e,t,n){if(2!==e.h)return!1;var r,i=e.g.j(),o=(e=e.g).g;if(e.g+=i,P(e),e=e.h,J)(r=S)||(r=S=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?s.push(65533):(l=e[o++],194>a||128!=(192&l)?(o--,s.push(65533)):s.push((31&a)<<6|63&l)):240>a?o>=i-1?s.push(65533):128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,s.push(65533)):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?s.push(65533):128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,s.push(65533)):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):s.push(65533),8192<=s.length&&(d=E(d,s),s.length=0);r=E(d,s)}return Ee(t,n,r),!0}function Le(e,t,n,r,i){if(2!==e.h)return!1;e=oe(e,new r,i);var o=void 0!==o&&o;return t.g||(t.g={}),r=e&&Ne(e),t.g[n]=e,Ee(t,n,r,o),!0}function ze(e,t,n,r,i){return 2===e.h&&(Je(t,n,e=oe(e,new r,i),r,void 0),!0)}function Oe(e,t,n){return(0===e.h||2===e.h)&&(t=ye(t,n),2==e.h?ae(e,z.prototype.j,t):t.push(e.g.j()),!0)}function je(e,t,n){return 0===e.h&&(Ee(t,n,j(e.g)),!0)}function Pe(e){Be.call(this,e,-1,et)}function _e(e,t){return ke(e,t,Ze||(Ze={1:He,2:He,3:xe,4:je}))}Be.prototype.toJSON=function(){return be(Ne(this),Ue)},Be.prototype.toString=function(){return Ne(this).toString()},g(Pe,Be),Pe.prototype.getRows=function(){return Ie(this,1)},Pe.prototype.getCols=function(){return Ie(this,2)},Pe.prototype.getPackedDataList=function(){return Ve(this)},Pe.prototype.getLayout=function(){return Ce(this,4,0)};var qe,$e,et=[3];function tt(e){Be.call(this,e)}function nt(e,t){var n=Ie(e,1);if(null!=n&&null!=n){ee(t.g,8);var r=t.g;if(0<=n)ee(r,n);else{for(var i=0;9>i;i++)$(r,127&n|128),n>>=7;$(r,1)}}we(t,e,2),null!=(r=Ie(e,3))&&de(t,3,G(r)),null!=(r=Ie(e,4))&&de(t,4,G(r)),Ge(e,t)}function rt(e,t){return ke(e,t,qe||(qe={1:He,2:De,3:Ke,4:Ke}))}function it(e){Be.call(this,e,-1,ct)}function ot(e,t){return ke(e,t,$e||($e={1:[ze,tt,rt]}))}g(tt,Be),g(it,Be),it.prototype.addClassification=function(e,t){return Je(this,1,e,tt,t),this};var at,lt,ct=[1];function st(e){Be.call(this,e)}function dt(e,t){we(t,e,1),we(t,e,2),we(t,e,3),we(t,e,4),we(t,e,5),Ge(e,t)}function ut(e,t){return ke(e,t,at||(at={1:De,2:De,3:De,4:De,5:De}))}function At(e){Be.call(this,e,-1,Ft)}function ht(e,t){return ke(e,t,lt||(lt={1:[ze,st,ut]}))}g(st,Be),g(At,Be);var gt,Qt,Ft=[1];function pt(e){Be.call(this,e)}function Ut(e,t){we(t,e,1),we(t,e,2),we(t,e,3),we(t,e,4),we(t,e,5);var n=Ie(e,6);if(null!=n&&null!=n){ee(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=L=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}Ge(e,t)}function mt(e,t){return ke(e,t,gt||(gt={1:De,2:De,3:De,4:De,5:De,6:Me}))}function bt(e){Be.call(this,e,-1,ft)}function Bt(e,t){return ke(e,t,Qt||(Qt={1:je,2:je,3:xe,4:Oe}))}g(pt,Be),g(bt,Be),bt.prototype.getVertexType=function(){return Ce(this,1,0)},bt.prototype.getPrimitiveType=function(){return Ce(this,2,0)},bt.prototype.getVertexBufferList=function(){return Ve(this)},bt.prototype.getIndexBufferList=function(){return ye(this,4)};var Zt,ft=[3,4];function Rt(e){Be.call(this,e)}function It(e,t){return ke(e,t,Zt||(Zt={1:[Le,bt,Bt],2:[Le,Pe,_e]}))}g(Rt,Be),Rt.prototype.getMesh=function(){return Se(this,bt,1)},Rt.prototype.getPoseTransformMatrix=function(){return Se(this,Pe,2)};var yt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Vt=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ct=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Wt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Et=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],St=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],vt=[].concat(c(yt),c(Vt),c(Ct),c(Wt),c(Et),c(St));function Jt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Nt(e){return ve(e,tt,1).map((function(e){return{index:Ce(e,1,0),score:We(e,2),label:null!=Ie(e,3)?Ce(e,3,""):void 0,displayName:null!=Ie(e,4)?Ce(e,4,""):void 0}}))}function Gt(e){return{x:We(e,1),y:We(e,2),z:We(e,3),visibility:null!=Ie(e,4)?We(e,4):void 0}}function Xt(e){return ve(Ye(e,At,ht),st,1).map(Gt)}function kt(e,t){this.h=e,this.g=t,this.l=0}function Tt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Jt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Jt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),ca:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Yt(e){this.g=e}var wt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Dt(e,t){return t+e}function xt(e,t){window[e]=t}function Mt(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||Dt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Ht(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.R?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(wt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return xt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),xt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=Kt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.S)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,Kt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,aa:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.D=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,g.g=0}}))}function Kt(e,t){var n,r;return f((function(i){return t in e.F?i.return(e.F[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.F[t]=r,i.return(r))}))}function Lt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new kt(e.h,e.D),e.s[t]=r),i.return(Tt(r,n,e.G))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=Ye(b.get(I),pt,mt);y={T:{X:We(y,1),Y:We(y,2),height:We(y,3),width:We(y,4),rotation:We(y,5,0),W:Ce(y,6,0)},O:Xt(B.get(I)),M:Nt(Ye(Z.get(I),it,ot))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.s[u])||(g=new kt(e.h,e.D),e.s[u]=g),U(m,Tt(g,h,e.G),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function zt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=Lt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Ot(e){return e.map(jt)}function jt(e){var t=(e=Ye(e,Rt,It)).getMesh();if(!t)return e;var n=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return n};var r=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return r},e}function Pt(e){var t=this;e=e||{},this.g=new Mt({locateFile:e.locateFile,files:[{url:"holistic_solution_packed_assets_loader.js"},{simd:!1,url:"holistic_solution_wasm_bin.js"},{simd:!0,url:"holistic_solution_simd_wasm_bin.js"}],graph:{url:"holistic.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:"left_hand_landmarks right_hand_landmarks face_landmarks pose_landmarks world_landmarks segmentation_mask image_transformed multi_face_geometry".split(" "),outs:{image:{type:"texture",stream:"image_transformed"},leftHandLandmarks:{type:"proto",stream:"left_hand_landmarks",transform:Xt},rightHandLandmarks:{type:"proto",stream:"right_hand_landmarks",transform:Xt},faceLandmarks:{type:"proto",stream:"face_landmarks",transform:Xt},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:Xt},ea:{type:"proto",stream:"world_landmarks",transform:Xt},segmentationMask:{type:"texture",stream:"segmentation_mask"},multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:Ot}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelComplexity:{type:1,default:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i,o;return f((function(a){if(1==a.g){switch(n="",e){case 1:n="pose_landmark_full.tflite";break;case 2:n="pose_landmark_heavy.tflite";break;default:n="pose_landmark_lite.tflite"}return r="third_party/mediapipe/modules/pose_landmark/"+n,i=t.g.locateFile(n,""),U(a,fetch(i),3)}return 2!=a.g?U(a,a.h.arrayBuffer(),2):(o=a.h,t.g.overrideFile(r,o),U(a,t.g.reset(),0))}))}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},refineFaceLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineFaceLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"holisticlandmarkgpu__poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"holisticlandmarkgpu__poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}})}(t=Mt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Ht(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.P===e.g.graph.url?d.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.P=e.g.graph.url,U(d,Kt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.B)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.B[i]);if(e.B={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,zt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.v){c.g=2;break}t=l(e.v),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.v=void 0;case 2:if(e.A){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.A=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.C,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.m[c.stream];if(Q||(Q=new kt(A.h,A.D),A.m[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.m[c.stream])||(Q=new Yt(A.h),A.m[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.T,f=new pt;if(Ee(f,1,Z.X),Ee(f,2,Z.Y),Ee(f,3,Z.height),Ee(f,4,Z.width),Ee(f,5,Z.rotation),Ee(f,6,Z.W),Z=Te(f,Ut),b.call(m,B,Z),F.O)for(m=0;m<F.O.length;++m){var R=!!(f=F.O[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ee(R=new st,1,f.x),Ee(R,2,f.y),Ee(R,3,f.z),f.visibility&&Ee(R,4,f.visibility),f=Te(R,dt),B.call(b,Z,f)}if(F.M)for(m=0;m<F.M.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.M[m],Ee(R=new tt,2,f.score),f.index&&Ee(R,1,f.index),f.label&&Ee(R,3,f.label),f.displayName&&Ee(R,4,f.displayName),f=Te(R,nt),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.C,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Mt),y("OptionType",{BOOL:0,NUMBER:1,Z:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Pt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Holistic",Pt),y("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),y("FACEMESH_LIPS",yt),y("FACEMESH_LEFT_EYE",Vt),y("FACEMESH_LEFT_EYEBROW",Ct),y("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),y("FACEMESH_RIGHT_EYE",Wt),y("FACEMESH_RIGHT_EYEBROW",Et),y("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),y("FACEMESH_FACE_OVAL",St),y("FACEMESH_CONTOURS",vt),y("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),y("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),y("POSE_CONNECTIONS",[[0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]]),y("POSE_LANDMARKS",{NOSE:0,LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,LEFT_EAR:7,RIGHT_EAR:8,LEFT_RIGHT:9,RIGHT_LEFT:10,LEFT_SHOULDER:11,RIGHT_SHOULDER:12,LEFT_ELBOW:13,RIGHT_ELBOW:14,LEFT_WRIST:15,RIGHT_WRIST:16,LEFT_PINKY:17,RIGHT_PINKY:18,LEFT_INDEX:19,RIGHT_INDEX:20,LEFT_THUMB:21,RIGHT_THUMB:22,LEFT_HIP:23,RIGHT_HIP:24,LEFT_KNEE:25,RIGHT_KNEE:26,LEFT_ANKLE:27,RIGHT_ANKLE:28,LEFT_HEEL:29,RIGHT_HEEL:30,LEFT_FOOT_INDEX:31,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_LEFT",{LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,LEFT_EAR:7,LEFT_RIGHT:9,LEFT_SHOULDER:11,LEFT_ELBOW:13,LEFT_WRIST:15,LEFT_PINKY:17,LEFT_INDEX:19,LEFT_THUMB:21,LEFT_HIP:23,LEFT_KNEE:25,LEFT_ANKLE:27,LEFT_HEEL:29,LEFT_FOOT_INDEX:31}),y("POSE_LANDMARKS_RIGHT",{RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,RIGHT_EAR:8,RIGHT_LEFT:10,RIGHT_SHOULDER:12,RIGHT_ELBOW:14,RIGHT_WRIST:16,RIGHT_PINKY:18,RIGHT_INDEX:20,RIGHT_THUMB:22,RIGHT_HIP:24,RIGHT_KNEE:26,RIGHT_ANKLE:28,RIGHT_HEEL:30,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_NEUTRAL",{NOSE:0}),y("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),r=e.getPackedDataList(),i=[],o=0;o<n;o++)i.push(Array(t));for(o=0;o<n;o++)for(var a=0;a<t;a++){var l=1===e.getLayout()?o*t+a:a*n+o;i[o][a]=r[l]}return i})),y("VERSION","0.5.1635989137")}).call(Te);const Ye={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.na=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={da:t,ea:!0},e.g=e.o||e.u}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ea)throw t.da;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.s):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.s=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.M(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.s=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).M(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).M(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(){throw Error("Invalid UTF8")}function C(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var W,E,S=typeof TextDecoder<"u",v=typeof TextEncoder<"u",J={},N=null;function G(e){var t;void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),i!==n?r.subarray(0,i):r}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array;function w(e){return Y&&null!=e&&e instanceof Uint8Array}function D(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var x="function"==typeof Uint8Array.prototype.slice,M=0;function H(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function K(){return Error("Failed to read varint, encoding is invalid.")}function L(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&z(this,e)}function z(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return X(e);if(e.constructor===D)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||w(t)?t:"string"==typeof t?X(t):null,(e=e.L=t)?new Uint8Array(e):T||(T=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function O(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function j(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,O(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,O(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,O(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,O(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return O(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw K();return O(e),r}L.prototype.reset=function(){this.g=this.j};var P=[];function _(){this.g=[]}function q(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function $(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,P.length?(n=P.pop(),t&&(n.v=t.v),e&&z(n,e),e=n):e=new L(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=j(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw H(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(!(128&e.h[t++])){e.g=t,O(e);break e}throw K()}break;case 1:(e=e.g).g+=8,O(e);break;case 2:2!=e.h?te(e):(t=j(e.g)>>>0,(e=e.g).g+=t,O(e));break;case 5:(e=e.g).g+=4,O(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw H(e.h,e.j)}}_.prototype.length=function(){return this.g.length},_.prototype.end=function(){var e=this.g;return this.g=[],e},$.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new _}function ie(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(oe?e[oe]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function le(e){var t;return null!=(t=oe?e[oe]:e.N)?t:0}function ce(e){return ae(e,1),e}function se(e){return!!Array.isArray(e)&&!!(2&le(e))}function de(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function ue(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var Ae=Object.freeze(ce([]));function he(e){if(se(e.m))throw Error("Cannot mutate an immutable Message")}var ge,Qe=typeof Symbol<"u"&&typeof Symbol.hasInstance<"u";function Fe(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function pe(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function Ue(e,t,n,r){r=void 0!==r&&r,he(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function me(e,t,n,r){n=void 0===n||n;var i=pe(e,t,r=void 0!==r&&r);return null==i&&(i=Ae),se(e.m)?n&&(de(i),Object.freeze(i)):(i===Ae||se(i))&&Ue(e,t,i=ce(i.slice()),r),i}function be(e,t,n){var r;return null!=(r=e=null==(e=pe(e,t))?e:+e)?r:void 0===n?0:n}function Be(e,t,n,r){e.j||(e.j={});var i=se(e.m),o=e.j[n];if(!o){r=me(e,n,!0,void 0!==r&&r),o=[],i=i||se(r);for(var a=0;a<r.length;a++)o[a]=new t(r[a]),i&&de(o[a].m);i&&(de(o),Object.freeze(o)),e.j[n]=o}return o}function Ze(e,t,n,r,i){var o=void 0!==o&&o;return he(e),o=Be(e,n,t,o),n=r||new n,e=me(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.m)):(o.push(n),e.push(n.m)),n}function fe(e,t){var n;return null!=(n=e=pe(e,t))?n:0}function Re(e,t){var n;return null!=(n=e=pe(e,t))?n:""}function Ie(e){var t=Ce;return Ve(e,t=void 0===t?We:t)}function ye(e,t){if(null!=e){if(Array.isArray(e))e=Ve(e,t);else if(ue(e)){var n,r={};for(n in e)r[n]=ye(e[n],t);e=r}else e=t(e);return e}}function Ve(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=ye(n[r],t);return Array.isArray(e)&&1&le(e)&&ce(n),n}function Ce(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(w(e))return G(e);if(e instanceof D){var t=e.L;return t=null==t||"string"==typeof t?t:Y&&t instanceof Uint8Array?G(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?Ie(e):e)}function We(e){return w(e)?new Uint8Array(e):e}function Ee(e,t,n){e||(e=ge),ge=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&ue(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)e+=this.h,(r=this.m[e])?Array.isArray(r)&&ce(r):this.m[e]=Ae;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];i?Array.isArray(i)&&ce(i):r[e]=Ae}}function Se(){Ee.apply(this,arguments)}if(Ee.prototype.toJSON=function(){return Ie(this.m)},Ee.prototype.toString=function(){return this.m.toString()},g(Se,Ee),Qe){var ve={};Object.defineProperties(Se,(ve[Symbol.hasInstance]=Fe((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),ve))}function Je(e,t,n){if(n){var r,i={};for(r in n){var o=n[r],a=o.ha;a||(i.F=o.la||o.fa.P,o.aa?(i.U=we(o.aa),a=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(i)):o.ca?(i.T=De(o.X.g,o.ca),a=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(i)):a=i.F,o.ha=a),a(t,e,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(e,t){if(t=t.ba){ie(e,e.g.end());for(var n=0;n<t.length;n++)ie(e,t[n])}}(t,e)}var Ne=Symbol();function Ge(e,t,n){return e[Ne]||(e[Ne]=function(e,r){return t(e,r,n)})}function Xe(e){var t=e[Ne];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ne]=t}return t}function ke(e){var t=function(e){var t=e.aa;return t?Xe(t):(t=e.ka)?Ge(e.X.g,t,e.ca):void 0}(e),n=e.X,r=e.fa.O;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Te(e,t,n,r,i,o){var a=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),a++);a<e.length;){n=e[a++];for(var l=a+1;l<e.length&&"number"!=typeof e[l];)l++;var c=e[a++];switch(l-=a){case 0:r(t,n,c);break;case 1:r(t,n,c,e[a++]);break;case 2:i(t,n,c,e[a++],e[a++]);break;case 3:l=e[a++];var s=e[a++],d=e[a++];Array.isArray(d)?i(t,n,c,l,s,d):o(t,n,c,l,s,d);break;case 4:o(t,n,c,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return t}var Ye=Symbol();function we(e){var t=e[Ye];if(!t){var n=ze(e);t=function(e,t){return nt(e,t,n)},e[Ye]=t}return t}function De(e,t){var n=e[Ye];return n||(n=function(e,n){return Je(e,n,t)},e[Ye]=n),n}var xe=Symbol();function Me(e,t){e.push(t)}function He(e,t,n){e.push(t,n.P)}function Ke(e,t,n,r,i){var o=we(i),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,o)}))}function Le(e,t,n,r,i,o){var a=De(r,o),l=n.P;e.push(t,(function(e,t,n){return l(e,t,n,r,a)}))}function ze(e){return e[xe]||Te(e,e[xe]=[],Me,He,Ke,Le)}var Oe=Symbol();function je(e,t){e[0]=t}function Pe(e,t,n,r){var i=n.O;e[t]=r?function(e,t,n){return i(e,t,n,r)}:i}function _e(e,t,n,r,i,o){var a=n.O,l=Xe(i);e[t]=function(e,t,n){return a(e,t,n,r,l,o)}}function qe(e,t,n,r,i,o,a){var l=n.O,c=Ge(r,i,o);e[t]=function(e,t,n){return l(e,t,n,r,c,a)}}function $e(e){return e[Oe]||Te(e,e[Oe]={},je,Pe,_e,qe)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=ke(o))}if(!(i&&i(t,e,r)||(i=t,r=e,o=i.j,te(i),i.W))){var a=i.g.h;i=o===(i=i.g.g)?T||(T=new Uint8Array(0)):x?a.slice(o,i):new Uint8Array(a.subarray(o,i)),(o=r.ba)?o.push(i):r.ba=[i]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(z(r.g,e),r.i=-1,r.h=-1),e=r}else e=new $(e);try{return et(new t,e,$e(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,i=r%2==1,o=i?1:0;o<r;o+=2)(0,n[o+1])(t,e,n[o]);Je(e,t,i?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,ze(t)),ie(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,i=0,o=0;o<r;o++){var a=t[o];e.set(a,i),i+=a.length}return n.i=[e],e}function it(e,t){return{O:e,P:t}}var ot=it((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,O(e),e=2*((i=(r<<0|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,Ue(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){q(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?M=0:(0,M=2147483648):isNaN(r)?(0,M=2147483647):34028234663852886e22<r?(0,M=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,M=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,M=(n<<31|t+127<<23|8388607&r)>>>0),n=M,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=it((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,a=e=0;4>a&&128<=i;a++)i=r.h[r.g++],O(r),o|=(127&i)<<7*a;if(128<=i&&(i=r.h[r.g++],O(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)i=r.h[r.g++],O(r),e|=(127&i)<<7*a+3;if(!(128>i))throw K();return r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),Ue(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t){q(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=M=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),lt=it((function(e,t,n){return 0===e.h&&(Ue(t,n,j(e.g)),!0)}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t)if(q(e.g,8*n),e=e.g,0<=(n=t))q(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ct=it((function(e,t,n){if(2!==e.h)return!1;var r,i=j(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,O(e),e=e.h,S)(r=W)||(r=W=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?V():(l=e[o++],194>a||128!=(192&l)?(o--,V()):s.push((31&a)<<6|63&l)):240>a?o>=i-1?V():128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,V()):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?V():128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,V()):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):V(),8192<=s.length&&(d=C(d,s),s.length=0);r=C(d,s)}return Ue(t,n,r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){var r=!1;if(r=void 0!==r&&r,v){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(E||(E=new TextEncoder)).encode(t)}else{for(var i=0,o=new Uint8Array(3*t.length),a=0;a<t.length;a++){var l=t.charCodeAt(a);if(128>l)o[i++]=l;else{if(2048>l)o[i++]=l>>6|192;else{if(55296<=l&&57343>=l){if(56319>=l&&a<t.length){var c=t.charCodeAt(++a);if(56320<=c&&57343>=c){l=1024*(l-55296)+c-56320+65536,o[i++]=l>>18|240,o[i++]=l>>12&63|128,o[i++]=l>>6&63|128,o[i++]=63&l|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");l=65533}o[i++]=l>>12|224,o[i++]=l>>6&63|128}o[i++]=63&l|128}}t=o.subarray(0,i)}q(e.g,8*n+2),q(e.g,t.length),ie(e,e.g.end()),ie(e,t)}})),st=it((function(e,t,n,r,i){if(2!==e.h)return!1;t=Ze(t,n,r),n=e.g.i,r=j(e.g)>>>0;var o=e.g.g+r,a=o-n;if(0>=a&&(e.g.i=o,i(t,e),a=o-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=n,!0}),(function(e,t,n,r,i){if(null!=(t=Be(t,r,n)))for(r=0;r<t.length;r++){var o=e;q(o.g,8*n+2);var a=o.g.end();ie(o,a),a.push(o.h),o=a,i(t[r],e),a=e;var l=o.pop();for(l=a.h+a.g.length()-l;127<l;)o.push(127&l|128),l>>>=7,a.h++;o.push(l),a.h++}}));function dt(){Se.apply(this,arguments)}if(g(dt,Se),Qe){var ut={};Object.defineProperties(dt,(ut[Symbol.hasInstance]=Fe(Object[Symbol.hasInstance]),ut))}function At(e){dt.call(this,e)}function ht(){return[1,lt,2,ot,3,ct,4,ct]}function gt(e){dt.call(this,e,-1,Ft)}function Qt(){return[1,st,At,ht]}g(At,dt),g(gt,dt),gt.prototype.addClassification=function(e,t){return Ze(this,1,At,e,t),this};var Ft=[1];function pt(e){dt.call(this,e)}function Ut(){return[1,ot,2,ot,3,ot,4,ot,5,ot]}function mt(e){dt.call(this,e,-1,Bt)}function bt(){return[1,st,pt,Ut]}g(pt,dt),g(mt,dt);var Bt=[1];function Zt(e){dt.call(this,e)}function ft(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,at]}g(Zt,dt);var Rt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],It=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],yt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Vt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Ct=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Wt=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Et=[].concat(c(Rt),c(It),c(yt),c(Vt),c(Ct),c(Wt));function St(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function vt(e){return Be(e,At,1).map((function(e){return{index:fe(e,1),ga:be(e,2),label:null!=pe(e,3)?Re(e,3):void 0,displayName:null!=pe(e,4)?Re(e,4):void 0}}))}function Jt(e){return{x:be(e,1),y:be(e,2),z:be(e,3),visibility:null!=pe(e,4)?be(e,4):void 0}}function Nt(e,t){this.h=e,this.g=t,this.l=0}function Gt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.o){var r=St(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=St(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),ma:i},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Xt(e){this.g=e}var kt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Tt(e,t){return t+e}function Yt(e,t){window[e]=t}function wt(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=e.resolve(),this.Y="",this.C={},this.locateFile=t&&t.locateFile||Tt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Dt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.Z?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.o=2,U(e,WebAssembly.instantiate(kt),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return Yt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Yt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=xt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.$)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,xt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.$)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ja:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.G=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.Z=!1,g.g=0}}))}function xt(e,t){var n,r;return f((function(i){return t in e.H?i.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,i.return(r))}))}function Mt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.I=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Nt(e.h,e.G),e.u[t]=r),i.return(Gt(r,n,e.I))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=tt(b.get(I),Zt,ft);y={boundingBox:{xCenter:be(y,1),yCenter:be(y,2),height:be(y,3),width:be(y,4),rotation:be(y,5,0),rectId:fe(y,6)},landmarks:Be(tt(B.get(I),mt,bt),pt,1).map(Jt),V:vt(tt(Z.get(I),gt,Qt))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.u[u])||(g=new Nt(e.h,e.G),e.u[u]=g),U(m,Gt(g,h,e.I),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Ht(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.D=Mt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Kt(e){var t=this;e=e||{};var n={url:"face_detection_short.binarypb"},r={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new wt({locateFile:e.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:n,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(e){var i,o,a,c,s;return f((function(d){switch(d.g){case 1:i=l("short"===e?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"]),o=i.next();case 2:if(o.done){d.g=4;break}return a=o.value,c="third_party/mediapipe/modules/face_detection/"+a,U(d,xt(t.g,a),5);case 5:s=d.h,t.g.overrideFile(c,s),o=i.next(),d.g=2;break;case 4:return n.url="short"===e?"face_detection_short.binarypb":"face_detection_full.binarypb",r.graphOptionXref.calculatorName="short"===e?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",d.return(!0)}}))}},minDetectionConfidence:r}})}(t=wt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={R:o.R,S:o.S},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.R=c.onChange,o.S=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Dt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.Y===e.g.graph.url?d.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Y=e.g.graph.url,U(d,xt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Ht(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.s)return c.return();if(!e.A){c.g=2;break}t=l(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.B),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.D,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.o[c.stream];if(Q||(Q=new Nt(A.h,A.G),A.o[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.o[c.stream])||(Q=new Xt(A.h),A.o[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.boundingBox,f=new Zt;if(Ue(f,1,Z.xCenter),Ue(f,2,Z.yCenter),Ue(f,3,Z.height),Ue(f,4,Z.width),Ue(f,5,Z.rotation),Ue(f,6,Z.rectId),Z=rt(f,ft),b.call(m,B,Z),F.landmarks)for(m=0;m<F.landmarks.length;++m){var R=!!(f=F.landmarks[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ue(R=new pt,1,f.x),Ue(R,2,f.y),Ue(R,3,f.z),f.visibility&&Ue(R,4,f.visibility),f=rt(R,Ut),B.call(b,Z,f)}if(F.V)for(m=0;m<F.V.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.V[m],Ue(R=new At,2,f.ga),f.index&&Ue(R,1,f.index),f.label&&Ue(R,3,f.label),f.displayName&&Ue(R,4,f.displayName),f=rt(R,ht),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.D,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",wt),y("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Kt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("FaceDetection",Kt),y("FACEDETECTION_LIPS",Rt),y("FACEDETECTION_LEFT_EYE",It),y("FACEDETECTION_LEFT_EYEBROW",yt),y("FACEDETECTION_RIGHT_EYE",Vt),y("FACEDETECTION_RIGHT_EYEBROW",Ct),y("FACEDETECTION_FACE_OVAL",Wt),y("FACEDETECTION_CONTOURS",Et),y("FACEDETECTION_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),y("VERSION","0.4.1646425229")}).call(Ye);const we={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(e,t){return t=new Z(new m(t)),h&&e.prototype&&h(t,e.prototype),t}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s};var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var C,W,E=typeof TextDecoder<"u",S=typeof TextEncoder<"u";function v(e){if(S)e=(W||(W=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var J={},N=null;function G(e,t){void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array.prototype.slice;function w(e,t,n){return t===n?T||(T=new Uint8Array(0)):Y?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var D=0;function x(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.j=this.l=0,this.m=!1,this.v=t,e&&M(this,e)}function M(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?X(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.l=0,e.j=e.h.length,e.g=e.l}function H(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.m=!0}x.prototype.reset=function(){this.g=this.l},x.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},x.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,e=2*((n=(e<<0|t<<8|n<<16|r<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var K=[];function L(){this.g=new Uint8Array(64),this.h=0}function z(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function O(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,K.length?(n=K.pop(),t&&(n.v=t.v),e&&M(n,e),e=n):e=new x(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function j(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function P(e,t,n){var r=e.g.j,i=e.g.i(),o=e.g.g+i;if(e.g.j=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.j=r,t}function _(e){return e.g.o()}function q(e){var t,n=e.g.i(),r=(e=e.g).g;if(e.g+=n,e=e.h,E)(t=C)||(t=C=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(r,r+n));else{n=r+n;for(var i,o,a,l=[],c=null;r<n;)128>(i=e[r++])?l.push(i):224>i?r>=n?l.push(65533):(o=e[r++],194>i||128!=(192&o)?(r--,l.push(65533)):l.push((31&i)<<6|63&o)):240>i?r>=n-1?l.push(65533):128!=(192&(o=e[r++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[r++]))?(r--,l.push(65533)):l.push((15&i)<<12|(63&o)<<6|63&t):244>=i?r>=n-2?l.push(65533):128!=(192&(o=e[r++]))||o-144+(i<<28)>>30||128!=(192&(t=e[r++]))||128!=(192&(a=e[r++]))?(r--,l.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&a,i-=65536,l.push(55296+(i>>10&1023),56320+(1023&i))):l.push(65533),8192<=l.length&&(c=V(c,l),l.length=0);t=V(c,l)}return t}function $(e,t,n){var r=e.g.i();for(r=e.g.g+r;e.g.g<r;)n.push(t.call(e.g))}function ee(e,t){2==e.h?$(e,x.prototype.o,t):t.push(_(e))}function te(){this.h=[],this.i=0,this.g=new L}function ne(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function re(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var n=e.h,r=n.length,i=0,o=0;o<r;o++){var a=n[o];0!==a.length&&(t.set(a,i),i+=a.length)}return 0!==(r=(n=e.g).h)&&(t.set(n.g.subarray(0,r),i),n.h=0),e.h=[t],t}function ie(e,t,n){if(null!=n){z(e.g,8*t+5),e=e.g;var r=n;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?D=0:(0,D=2147483648):isNaN(r)?(0,D=2147483647):34028234663852886e22<r?(0,D=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,D=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,D=(n<<31|t+127<<23|8388607&r)>>>0),n=D,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}L.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},L.prototype.length=function(){return this.h},L.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,w(e,0,t)},O.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var oe="function"==typeof Uint8Array;function ae(e,t,n){if(null!=e)return"object"==typeof e?oe&&e instanceof Uint8Array?n(e):le(e,t,n):t(e)}function le(e,t,n){if(Array.isArray(e)){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=ae(e[i],t,n);return Array.isArray(e)&&e.W&&ue(r),r}for(i in r={},e)r[i]=ae(e[i],t,n);return r}function ce(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var se,de={W:{value:!0,configurable:!0}};function ue(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,de),e}function Ae(e,t,n){var r=se;if(se=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=r?0:-1,this.m=this.g=null,this.h=e,e=(r=this.h.length)-1,!r||(null===(r=this.h[e])||"object"!=typeof r||Array.isArray(r)||oe&&r instanceof Uint8Array)?void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE:(this.l=e-this.j,this.i=r),n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.h[e])?ue(r):this.h[e]=he):(ge(this),(r=this.i[e])?ue(r):this.i[e]=he)}var he=Object.freeze(ue([]));function ge(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function Qe(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function Fe(e,t){var n=void 0!==n&&n,r=Qe(e,t,n);return null==r&&(r=he),r===he&&be(e,t,r=ue([]),n),r}function pe(e){var t=Fe(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n<t.length;n++)t[n]=+t[n];e.m[3]=!0}return t}function Ue(e,t,n){var r;return null!=(r=e=Qe(e,t))?r:n}function me(e,t,n){var r;return null!=(r=e=null==(e=Qe(e,t))?e:+e)?r:void 0===n?0:n}function be(e,t,n,r){void 0!==r&&r||t>=e.l?(ge(e),e.i[t]=n):e.h[t+e.j]=n}function Be(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var r=Qe(e,n,!1);r&&(e.g[n]=new t(r))}return e.g[n]}function Ze(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var r=Fe(e,1);n=[];for(var i=0;i<r.length;i++)n[i]=new t(r[i]);e.g[1]=n}return n}function fe(e,t,n){var r=void 0!==r&&r;e.g||(e.g={});var i=n&&Ie(n);e.g[t]=n,be(e,t,i,r)}function Re(e,t,n,r){var i=Ze(e,n);t=t||new n,e=Fe(e,1),null!=r?(i.splice(r,0,t),e.splice(r,0,Ie(t))):(i.push(t),e.push(Ie(t)))}function Ie(e,t){if(e.g)for(var n in e.g){var r=e.g[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&Ie(r[i]);else r&&Ie(r)}return e.h}function ye(e,t){if(e=e.o){ne(t,t.g.end());for(var n=0;n<e.length;n++)ne(t,e[n])}}function Ve(e,t){if(4==t.h)return!1;var n=t.m;return function e(t){switch(t.h){case 0:if(0!=t.h)e(t);else{for(t=t.g;128&t.h[t.g];)t.g++;t.g++}break;case 1:1!=t.h?e(t):(t=t.g).g+=8;break;case 2:if(2!=t.h)e(t);else{var n=t.g.i();(t=t.g).g+=n}break;case 5:5!=t.h?e(t):(t=t.g).g+=4;break;case 3:for(n=t.l;;){if(!j(t)){t.j=!0;break}if(4==t.h){t.l!=n&&(t.j=!0);break}e(t)}break;default:t.j=!0}}(t),t.N||(t=w(t.g.h,n,t.g.g),(n=e.o)?n.push(t):e.o=[t]),!0}function Ce(e){Ae.call(this,e,-1,Ee)}function We(e,t){for(;j(t);)switch(t.i){case 8:var n=t.g.i();be(e,1,n);break;case 16:be(e,2,n=t.g.i());break;case 29:case 26:ee(t,e.getPackedDataList());break;case 32:be(e,4,n=H(t.g));break;default:if(!Ve(e,t))return e}return e}Ae.prototype.toJSON=function(){return le(Ie(this),ce,G)},Ae.prototype.toString=function(){return Ie(this).toString()},g(Ce,Ae),Ce.prototype.getRows=function(){return Qe(this,1)},Ce.prototype.getCols=function(){return Qe(this,2)},Ce.prototype.getPackedDataList=function(){return pe(this)},Ce.prototype.getLayout=function(){return Ue(this,4,0)};var Ee=[3];function Se(t,n){var r=void 0;return new(r||(r=e))((function(e,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,a)}l((n=n.apply(t,void 0)).next())}))}function ve(e){Ae.call(this,e)}function Je(e,t){for(;j(t);)switch(t.i){case 8:var n=t.g.i();be(e,1,n);break;case 21:be(e,2,n=_(t));break;case 26:be(e,3,n=q(t));break;case 34:be(e,4,n=q(t));break;default:if(!Ve(e,t))return e}return e}function Ne(e){Ae.call(this,e,-1,Ge)}g(ve,Ae),g(Ne,Ae),Ne.prototype.addClassification=function(e,t){return Re(this,e,ve,t),this};var Ge=[1];function Xe(e){Ae.call(this,e)}function ke(e,t){for(;j(t);)switch(t.i){case 13:var n=_(t);be(e,1,n);break;case 21:be(e,2,n=_(t));break;case 29:be(e,3,n=_(t));break;case 37:be(e,4,n=_(t));break;case 45:be(e,5,n=_(t));break;default:if(!Ve(e,t))return e}return e}function Te(e){Ae.call(this,e,-1,we)}function Ye(e){e:{var t=new Te;for(e=new O(e);j(e);)switch(e.i){case 10:Re(t,P(e,new Xe,ke),Xe,void 0);break;default:if(!Ve(t,e))break e}}return t}g(Xe,Ae),g(Te,Ae);var we=[1];function De(e){Ae.call(this,e)}function xe(e){Ae.call(this,e,-1,He)}function Me(e,t){for(;j(t);)switch(t.i){case 8:var n=H(t.g);be(e,1,n);break;case 16:be(e,2,n=H(t.g));break;case 29:case 26:ee(t,e.getVertexBufferList());break;case 32:case 34:n=t;var r=e.getIndexBufferList();2==n.h?$(n,x.prototype.i,r):r.push(n.g.i());break;default:if(!Ve(e,t))return e}return e}g(De,Ae),g(xe,Ae),xe.prototype.getVertexType=function(){return Ue(this,1,0)},xe.prototype.getPrimitiveType=function(){return Ue(this,2,0)},xe.prototype.getVertexBufferList=function(){return pe(this)},xe.prototype.getIndexBufferList=function(){return Fe(this,4)};var He=[3,4];function Ke(e){Ae.call(this,e)}function Le(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function ze(e){return Ze(e,ve).map((function(e){return{index:Ue(e,1,0),Y:me(e,2),label:null!=Qe(e,3)?Ue(e,3,""):void 0,displayName:null!=Qe(e,4)?Ue(e,4,""):void 0}}))}function Oe(e){return{x:me(e,1),y:me(e,2),z:me(e,3),visibility:null!=Qe(e,4)?me(e,4):void 0}}function je(e,t){this.h=e,this.g=t,this.l=0}function Pe(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Le(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Le(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function _e(e){this.g=e}g(Ke,Ae),Ke.prototype.getMesh=function(){return Be(this,xe,1)},Ke.prototype.getPoseTransformMatrix=function(){return Be(this,Ce,2)};var qe=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function $e(e,t){return t+e}function et(e,t){window[e]=t}function tt(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||$e,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function nt(t){return Se(t,(function t(){var n,r,i,o,a,l,s,d,u,A,h,g=this;return f(t,(function(t){switch(t.g){case 1:return n=g,g.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(g,g.j),U(t,function(){return Se(this,(function e(){return f(e,(function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(qe),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):t.return();case 2:if(i=t.h,"object"==typeof window)return et("createMediapipeSolutionsWasm",{locateFile:g.locateFile}),et("createMediapipeSolutionsPackedAssets",{locateFile:g.locateFile}),l=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(t){var r=rt(n,t.url);if(void 0!==t.path){var i=t.path;r=r.then((function(t){return n.overrideFile(i,t),e.resolve(t)}))}return r}))),u=e.all(s.map((function(t){return void 0===t.simd||t.simd&&i||!t.simd&&!i?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(n.locateFile(t.url,n.S)):e.resolve()}))).then((function(){return Se(n,(function e(){var t,n,r=this;return f(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,U(e,t(n),2);r.h=e.h,e.g=0}))}))})),A=Se(n,(function e(){var t=this;return f(e,(function(e){return t.g.graph&&t.g.graph.url?e=U(e,rt(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),U(t,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter((function(e){return void 0===e.simd||e.simd&&i||!e.simd&&!i})).map((function(e){return n.locateFile(e.url,n.S)})),importScripts.apply(null,c(o)),U(t,createMediapipeSolutionsWasm(Module),6);case 6:g.h=t.h,g.l=new OffscreenCanvas(1,1),g.h.canvas=g.l,a=g.h.GL.createContext(g.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),g.h.GL.makeContextCurrent(a),t.g=4;break;case 7:if(g.l=document.createElement("canvas"),!(h=g.l.getContext("webgl2",{}))&&!(h=g.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();g.D=h,g.h.canvas=g.l,g.h.createContext(g.l,!0,!0,{});case 4:g.i=new g.h.SolutionWasm,g.R=!1,t.g=0}}))}))}function rt(e,t){return Se(e,(function e(){var n,r,i=this;return f(e,(function(e){return t in i.F?e.return(i.F[t]):(n=i.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),i.F[t]=r,e.return(r))}))}))}function it(e,t,n){return Se(e,(function e(){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p,m=this;return f(e,(function(e){switch(e.g){case 1:if(!n)return e.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(m.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){e.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(e,function(e,t,n){return Se(e,(function e(){var r,i=this;return f(e,(function(e){return"number"==typeof n||n instanceof Uint8Array||n instanceof i.h.Uint8BlobList?e.return(n):n instanceof i.h.Texture2dDataOut?((r=i.s[t])||(r=new je(i.h,i.D),i.s[t]=r),e.return(Pe(r,n,i.G))):e.return(void 0)}))}))}(m,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=b.get(I);e:{var V=new De;for(y=new O(y);j(y);)switch(y.i){case 13:var C=_(y);be(V,1,C);break;case 21:be(V,2,C=_(y));break;case 29:be(V,3,C=_(y));break;case 37:be(V,4,C=_(y));break;case 45:be(V,5,C=_(y));break;case 48:be(V,6,C=H(y.g));break;default:if(!Ve(V,y))break e}}V={Z:me(V,1),$:me(V,2),height:me(V,3),width:me(V,4),rotation:me(V,5,0),X:Ue(V,6,0)},y=Ze(Ye(B.get(I)),Xe).map(Oe);var W=Z.get(I);e:for(C=new Ne,W=new O(W);j(W);)switch(W.i){case 10:C.addClassification(P(W,new ve,Je));break;default:if(!Ve(C,W))break e}V={T:V,O:y,M:ze(C)},R.push(V)}b=R}else b=[];r[u]=b,e.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===A.type){r[u]=h,e.g=7;break}if("proto"===A.type){r[u]=h,e.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=m.s[u])||(g=new je(m.h,m.D),m.s[u]=g),U(e,Pe(g,h,m.G),13);case 13:Q=e.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),e.g=3;break;case 14:F[p]=e.h;case 3:a=d.next(),e.g=2;break;case 4:return e.return(r)}}))}))}function ot(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=it(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function at(e){var t=(e=function(e){e:{var t=new Ke;for(e=new O(e);j(e);)switch(e.i){case 10:var n=P(e,new xe,Me);fe(t,1,n);break;case 18:fe(t,2,n=P(e,new Ce,We));break;default:if(!Ve(t,e))break e}}return t}(e)).getMesh();if(!t)return e;var n=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return n};var r=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return r},e}(t=tt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){return Se(this,(function e(){var t=this;return f(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return Se(n,(function t(){var n=this;return f(t,(function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(r))}},t.initialize=function(){return Se(this,(function e(){var t=this;return f(e,(function(e){return 1==e.g?U(e,nt(t),2):3!=e.g?U(e,function(e){return Se(e,(function e(){var t,n,r,i,o,a,c,s,d=this;return f(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,U(e,rt(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),n=l(Object.keys(d.B)),r=n.next();!r.done;r=n.next())i=r.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(o=l(d.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,ot(d,c);s=d.j,d.j={},d.setOptions(s),e.g=0}))}))}(t),3):U(e,function(e){return Se(e,(function e(){var t,n,r,i,o,a,c=this;return f(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=l(c.u),n=t.next();case 3:if(n.done){e.g=5;break}return U(e,(0,n.value)(),4);case 4:n=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(r=new c.h.GraphOptionChangeRequestList,i=l(c.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);c.i.changeOptions(r),r.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){return Se(this,(function n(){var r,i,o,a,c,s,d,u,A,h=this;return f(n,(function(n){switch(n.g){case 1:return h.g.inputs?(r=1e3*(null!=t?t:performance.now()),U(n,h.C,2)):n.return();case 2:return U(n,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,o=l(Object.keys(e)),a=o.next();!a.done;a=o.next())if(c=a.value,s=h.g.inputs[c]){e:{var g=h,Q=e[c];switch(s.type){case"video":var F=g.m[s.stream];if(F||(F=new je(g.h,g.D),g.m[s.stream]=F),0===(g=F).l&&(g.l=g.h.createTexture()),typeof HTMLVideoElement<"u"&&Q instanceof HTMLVideoElement){var p=Q.videoWidth;F=Q.videoHeight}else typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement?(p=Q.naturalWidth,F=Q.naturalHeight):(p=Q.width,F=Q.height);F={glName:g.l,width:p,height:F},(p=g.g).canvas.width=F.width,p.canvas.height=F.height,p.activeTexture(p.TEXTURE0),g.h.bindTexture2d(g.l),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,Q),g.h.bindTexture2d(0),g=F;break e;case"detections":for((F=g.m[s.stream])||(F=new _e(g.h),g.m[s.stream]=F),(g=F).data||(g.data=new g.g.DetectionListData),g.data.reset(Q.length),F=0;F<Q.length;++F){p=Q[F];var m=g.data,b=m.setBoundingBox,B=F,Z=p.T,f=new De;be(f,1,Z.Z),be(f,2,Z.$),be(f,3,Z.height),be(f,4,Z.width),be(f,5,Z.rotation),be(f,6,Z.X);var R=Z=new te;ie(R,1,Qe(f,1)),ie(R,2,Qe(f,2)),ie(R,3,Qe(f,3)),ie(R,4,Qe(f,4)),ie(R,5,Qe(f,5));var I=Qe(f,6);if(null!=I&&null!=I){z(R.g,48);var y=R.g,V=I;I=0>V;var C=(V=Math.abs(V))>>>0;for(V=Math.floor((V-C)/4294967296),V>>>=0,I&&(V=~V>>>0,4294967295<(C=1+(~C>>>0))&&(C=0,4294967295<++V&&(V=0))),I=D=C,C=V;0<C||127<I;)y.push(127&I|128),I=(I>>>7|C<<25)>>>0,C>>>=7;y.push(I)}if(ye(f,R),Z=re(Z),b.call(m,B,Z),p.O)for(m=0;m<p.O.length;++m)R=!!(f=p.O[m]).visibility,B=(b=g.data).addNormalizedLandmark,Z=F,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),be(R=new Xe,1,f.x),be(R,2,f.y),be(R,3,f.z),f.visibility&&be(R,4,f.visibility),ie(y=f=new te,1,Qe(R,1)),ie(y,2,Qe(R,2)),ie(y,3,Qe(R,3)),ie(y,4,Qe(R,4)),ie(y,5,Qe(R,5)),ye(R,y),f=re(f),B.call(b,Z,f);if(p.M)for(m=0;m<p.M.length;++m){if(B=(b=g.data).addClassification,Z=F,f=p.M[m],be(R=new ve,2,f.Y),f.index&&be(R,1,f.index),f.label&&be(R,3,f.label),f.displayName&&be(R,4,f.displayName),y=f=new te,null!=(C=Qe(R,1))&&null!=C)if(z(y.g,8),I=y.g,0<=C)z(I,C);else{for(V=0;9>V;V++)I.push(127&C|128),C>>=7;I.push(1)}ie(y,2,Qe(R,2)),null!=(I=Qe(R,3))&&(I=v(I),z(y.g,26),z(y.g,I.length),ne(y,y.g.end()),ne(y,I)),null!=(I=Qe(R,4))&&(I=v(I),z(y.g,34),z(y.g,I.length),ne(y,y.g.end()),ne(y,I)),ye(R,y),f=re(f),B.call(b,Z,f)}}g=g.data;break e;default:g={}}}switch(d=g,u=s.stream,s.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:r}));break;case"detections":(A=d).stream=u,A.timestamp=r,i.pushDetectionList(A);break;default:throw Error("Unknown input config type: '"+s.type+"'")}}return h.i.send(i),U(n,h.C,4);case 4:i.delete(),n.g=0}}))}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",tt),y("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var lt={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(at)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return Ze(Ye(e),Xe).map(Oe)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ct=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],st=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],dt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ut=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],At=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ht=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],gt=[].concat(c(ct),c(st),c(dt),c(ut),c(At),c(ht));function Qt(e){e=e||{},e=Object.assign(Object.assign({},lt),e),this.g=new tt(e)}(t=Qt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){return Se(this,(function e(){var t=this;return f(e,(function(e){return U(e,t.g.initialize(),0)}))}))},t.reset=function(){this.g.reset()},t.send=function(e){return Se(this,(function t(){var n=this;return f(t,(function(t){return U(t,n.g.send(e),0)}))}))},t.setOptions=function(e){this.g.setOptions(e)},y("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),y("FaceMesh",Qt),y("FACEMESH_LIPS",ct),y("FACEMESH_LEFT_EYE",st),y("FACEMESH_LEFT_EYEBROW",dt),y("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),y("FACEMESH_RIGHT_EYE",ut),y("FACEMESH_RIGHT_EYEBROW",At),y("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),y("FACEMESH_FACE_OVAL",ht),y("FACEMESH_CONTOURS",gt),y("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),y("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),r=e.getPackedDataList(),i=[],o=0;o<n;o++)i.push(Array(t));for(o=0;o<n;o++)for(var a=0;a<t;a++){var l=1===e.getLayout()?o*t+a:a*n+o;i[o][a]=r[l]}return i})),y("VERSION","0.4.1633559619")}).call(we);const De={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ka=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={V:t,X:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.X)throw t.V;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.G(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.m(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.H(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.F(),this.B()},t.prototype.F=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.G=function(e){var t=this.j();e.K(t.resolve,t.reject)},t.prototype.H=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.K(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.K=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).K(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).K(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e){throw e}function C(e,t){V(Error("Invalid wire type: "+e+" (at position "+t+")"))}function W(){V(Error("Failed to read varint, encoding is invalid."))}function E(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var S,v,J=typeof TextDecoder<"u",N=typeof TextEncoder<"u";function G(e){if(N)e=(v||(v=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var X={},k=null;function T(e){var t;void 0===t&&(t=0),w(),t=X[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function Y(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=k[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}w();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function w(){if(!k){k={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));X[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===k[o]&&(k[o]=i)}}}}var D,x="function"==typeof Uint8Array;function M(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var H="function"==typeof Uint8Array.prototype.slice;function K(e,t,n){return t===n?D||(D=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var L=0;function z(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.l=0,this.j=!1,this.v=t,e&&O(this,e)}function O(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return Y(e);if(e.constructor===M){if(null==e.g)var t=D||(D=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||x&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?Y(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.l=0,e.i=e.h.length,e.g=e.l}function j(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.j=!0,W()}function P(e){e.g>e.i&&(e.j=!0,V(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}function _(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,P(e),r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,P(e),r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,P(e),r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,P(e),r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,P(e),r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]?(e.j=!0,W(),r):(P(e),r))))))}function q(e){var t=e.h[e.g],n=e.h[e.g+1],r=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,P(e),(t<<0|n<<8|r<<16|i<<24)>>>0}z.prototype.reset=function(){this.g=this.l},z.prototype.m=function(){var e=q(this),t=2*(e>>31)+1,n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))};var $=[];function ee(){this.g=new Uint8Array(64),this.h=0}function te(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ne(e,t){for(;127<t;)te(e,127&t|128),t>>>=7;te(e,t)}function re(e){var t={},n=void 0!==t.O&&t.O;this.m={v:void 0!==t.v&&t.v},this.O=n,t=this.m,$.length?(n=$.pop(),t&&(n.v=t.v),e&&O(n,e),e=n):e=new z(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ie(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).j||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=_(e.g);return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,C(n,e.l),!1)}function oe(e){switch(e.h){case 0:if(0!=e.h)oe(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(!(128&e.h[t])){e.g=t+1,P(e);break e}t++}e.j=!0,W()}break;case 1:(e=e.g).g+=8,P(e);break;case 2:2!=e.h?oe(e):(t=_(e.g),(e=e.g).g+=t,P(e));break;case 5:(e=e.g).g+=4,P(e);break;case 3:for(t=e.i;;){if(!ie(e)){e.j=!0,V(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,V(Error("Unmatched end-group tag")));break}oe(e)}break;default:e.j=!0,C(e.h,e.l)}}function ae(e,t,n){var r=e.g.i,i=_(e.g),o=e.g.g+i;if(e.g.i=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=r,t}ee.prototype.length=function(){return this.h},ee.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,K(e,0,t)},re.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var le=[];function ce(){this.h=[],this.i=0,this.g=new ee}function se(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function de(e,t,n){ne(e.g,8*t+2),ne(e.g,n.length),se(e,e.g.end()),se(e,n)}var ue,Ae="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function he(e){return Object.isFrozen(e)||(Ae?e[Ae]|=1:void 0!==e.g?e.g|=1:Object.defineProperties(e,{g:{value:1,configurable:!0,writable:!0,enumerable:!1}})),e}function ge(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Qe(e,t){if(null!=e)return Array.isArray(e)||ge(e)?Fe(e,t):t(e)}function Fe(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=Qe(e[r],t);var i,o;if(t=Array.isArray(e))t=1&(null!=(i=o=Ae?e[Ae]:e.g)?i:0);return t&&he(n),n}for(n in o={},e)o[n]=Qe(e[n],t);return o}function pe(e){return e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(x&&null!=e&&e instanceof Uint8Array)return T(e);if(e instanceof M){if(null==e.g)e="";else{var t=e.g;t=null==t||"string"==typeof t?t:x&&t instanceof Uint8Array?T(t):null,e=e.g=t}return e}}return e}(e),Array.isArray(e)?Fe(e,pe):e}function Ue(e,t,n){var r=ue;if(ue=null,e||(e=r),r=this.constructor.ha,e||(e=r?[r]:[]),this.i=(r?0:-1)-(this.constructor.fa||0),this.l=this.g=null,this.u=e,e=(r=this.u.length)-1,r&&ge(r=this.u[e])?(this.j=e-this.i,this.h=r):void 0!==t&&-1<t?(this.j=Math.max(t,e+1-this.i),this.h=null):this.j=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.j?(e+=this.i,(r=this.u[e])?Array.isArray(r)&&he(r):this.u[e]=me):(be(this),(r=this.h[e])?Array.isArray(r)&&he(r):this.h[e]=me)}var me=Object.freeze(he([]));function be(e){var t=e.j+e.i;e.u[t]||(e.h=e.u[t]={})}function Be(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.j?e.h?e.h[t]:void 0:e.u[t+e.i]}function Ze(e,t,n){var r=Be(e,t,n=void 0!==n&&n);return null==r&&(r=me),r===me&&Ie(e,t,r=he(r.slice()),n),r}function fe(e,t){var n=Ze(e,t);if(e.l||(e.l={}),!e.l[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.l[t]=!0}return n}function Re(e,t,n){var r;return null!=(r=e=null==(e=Be(e,t))?e:+e)?r:void 0===n?0:n}function Ie(e,t,n,r){void 0!==r&&r||t>=e.j?(be(e),e.h[t]=n):e.u[t+e.i]=n}function ye(e,t,n,r){n!==r?Ie(e,t,n):Ie(e,t,void 0,!1)}function Ve(e,t,n){if(-1===n)return null;e.g||(e.g={});var r=e.g[n];if(r)return r;var i=Be(e,n,!1);return null==i?r:(t=new t(i),e.g[n]=t)}function Ce(e,t,n){e.g||(e.g={});var r=e.g[n];if(!r){var i=Ze(e,n,!1);r=[];for(var o=0;o<i.length;o++)r[o]=new t(i[o]);e.g[n]=r}return r}function We(e,t,n,r,i){var o=Ce(e,r,t);n=n||new r,e=Ze(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.u)):(o.push(n),e.push(n.u))}function Ee(e,t){var n;return null!=(n=e=Be(e,t))?n:0}function Se(e,t){var n;return null!=(n=e=Be(e,t))?n:""}function ve(e,t){if(e=e.m){se(t,t.g.end());for(var n=0;n<e.length;n++)se(t,e[n])}}Ue.prototype.toJSON=function(){return Fe(this.u,pe)},Ue.prototype.toString=function(){return this.u.toString()};var Je=Symbol();function Ne(e,t,n){return e[Je]||(e[Je]=function(e,r){return t(e,r,n)})}function Ge(e){var t=e[Je];if(!t){var n=e[Te]||(e[Te]=e());t=function(e,t){return Ye(e,t,n)},e[Je]=t}return t}function Xe(e){var t=function(e){var t=e.da;if(t)return Ge(t);if(t=e.ia){var n=e.Y;return delete e.Y,Ne(e.W.g,t,n)}}(e),n=e.W,r=e.ea;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function ke(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=Ge(e[2]);return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],a=e[3],l=Ge(e[2]);return function(e,n,r){return t(e,n,r,o,l,a)};case 5:var c=e[1],s=Ne(c,e[3],e[4]);return function(e,n,r){return t(e,n,r,c,s)};case 6:var d=e[1],u=e[5],A=Ne(d,e[3],e[4]);return function(e,n,r){return t(e,n,r,d,A,u)};default:throw Error("Unsupported number of parameters, expected [2-6], got "+e.length)}}var Te=Symbol();function Ye(e,t,n){for(;ie(t)&&4!=t.h;){var r=t.i,i=n[r];if(i)Array.isArray(i)&&(i=n[r]=ke(i));else{var o=n[0];o&&(o=o[r])&&(i=n[r]=Xe(o))}i&&i(t,e,r)||(r=e,o=(i=t).l,oe(i),i.O||(i=K(i.g.h,o,i.g.g),(o=r.m)?o.push(i):r.m=[i]))}return e}function we(e,t){var n=new ce;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var a=r[o];0!==a.length&&(e.set(a,t),t+=a.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function De(e,t,n){if(le.length){var r=le.pop();e&&(O(r.g,e),r.i=-1,r.h=-1),e=r}else e=new re(e);try{return Ye(new t,e,n[Te]||(n[Te]=n()))}finally{(t=e.g).h=null,t.l=0,t.i=0,t.g=0,t.j=!1,t.v=!1,e.i=-1,e.h=-1,e.j=!1,100>le.length&&le.push(e)}}function xe(e,t,n){if(null!=(t=Be(t,n))){ne(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?L=0:(0,L=2147483648):isNaN(r)?(0,L=2147483647):34028234663852886e22<r?(0,L=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,L=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,L=(n<<31|t+127<<23|8388607&r)>>>0),te(e,(n=L)>>>0&255),te(e,n>>>8&255),te(e,n>>>16&255),te(e,n>>>24&255)}}function Me(e,t,n){if(1!==e.h)return!1;var r=e.g;e=q(r);var i=q(r);r=2*(i>>31)+1;var o=i>>>20&2047;return e=4294967296*(1048575&i)+e,ye(t,n,2047==o?e?NaN:1/0*r:0==o?r*Math.pow(2,-1074)*e:r*Math.pow(2,o-1075)*(e+4503599627370496),0),!0}function He(e,t,n){return 5===e.h&&(Ie(t,n,e.g.m()),!0)}function Ke(e,t,n){if(5!==e.h&&2!==e.h)return!1;if(t=Ze(t,n),2==e.h){n=z.prototype.m;var r=_(e.g);for(r=e.g.g+r;e.g.g<r;)t.push(n.call(e.g))}else t.push(e.g.m());return!0}function Le(e,t,n){return 5===e.h&&(ye(t,n,e=e.g.m(),0),!0)}function ze(e,t,n){return 0===e.h&&(Ie(t,n,j(e.g)),!0)}function Oe(e,t,n){return 0===e.h&&(Ie(t,n,_(e.g)),!0)}function je(e,t,n){return 0===e.h&&(ye(t,n,e=_(e.g),0),!0)}function Pe(e,t,n){return 0===e.h&&(ye(t,n,e=!!_(e.g),!1),!0)}function _e(e,t,n){if(2!==e.h)return!1;var r,i=_(e.g),o=(e=e.g).g;if(e.g+=i,P(e),e=e.h,J)(r=S)||(r=S=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?s.push(65533):(l=e[o++],194>a||128!=(192&l)?(o--,s.push(65533)):s.push((31&a)<<6|63&l)):240>a?o>=i-1?s.push(65533):128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,s.push(65533)):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?s.push(65533):128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,s.push(65533)):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):s.push(65533),8192<=s.length&&(d=E(d,s),s.length=0);r=E(d,s)}return Ie(t,n,r),!0}function qe(e,t,n,r,i){return 2===e.h&&(e=ae(e,new r,i),t.g||(t.g={}),r=e&&e.u,t.g[n]=e,Ie(t,n,r,!1),!0)}function $e(e,t,n,r,i){return 2===e.h&&(We(t,n,e=ae(e,new r,i),r,void 0),!0)}function et(e,t,n){return 0===e.h&&(Ie(t,n,j(e.g)),!0)}function tt(e){Ue.call(this,e)}function nt(){return{1:Oe,2:He,3:_e,4:_e}}function rt(e,t){var n=Be(e,1);if(null!=n&&null!=n){ne(t.g,8);var r=t.g;if(0<=n)ne(r,n);else{for(var i=0;9>i;i++)te(r,127&n|128),n>>=7;te(r,1)}}xe(t,e,2),null!=(r=Be(e,3))&&de(t,3,G(r)),null!=(r=Be(e,4))&&de(t,4,G(r)),ve(e,t)}function it(e){Ue.call(this,e,-1,at)}function ot(){return{1:[$e,tt,nt]}}g(tt,Ue),g(it,Ue),it.prototype.addClassification=function(e,t){return We(this,1,e,tt,t),this};var at=[1];function lt(e){Ue.call(this,e)}function ct(){return{1:He,2:He,3:He,4:He,5:He}}function st(e,t){xe(t,e,1),xe(t,e,2),xe(t,e,3),xe(t,e,4),xe(t,e,5),ve(e,t)}function dt(e){Ue.call(this,e,-1,At)}function ut(){return{1:[$e,lt,ct]}}g(lt,Ue),g(dt,Ue);var At=[1];function ht(e){Ue.call(this,e)}function gt(){return{1:He,2:He,3:He,4:He,5:He,6:ze}}function Qt(e,t){xe(t,e,1),xe(t,e,2),xe(t,e,3),xe(t,e,4),xe(t,e,5);var n=Be(e,6);if(null!=n&&null!=n){ne(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=L=o,o=i;0<o||127<n;)te(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;te(r,n)}ve(e,t)}function Ft(e){Ue.call(this,e,-1,bt)}function pt(){return{1:et,2:et,3:Ke,4:[qe,Ut,mt],5:Oe,6:Oe,7:Ke,8:Ke,9:Ke}}function Ut(e){Ue.call(this,e)}function mt(){return{1:He,2:He,3:He}}g(ht,Ue),g(Ft,Ue),g(Ut,Ue);var bt=[3,7,8,9];function Bt(e){Ue.call(this,e)}function Zt(){return{1:Le,2:Le,3:Le}}function ft(e){Ue.call(this,e)}function Rt(){return{1:Le,2:Le,3:Le}}function It(e){Ue.call(this,e)}function yt(){return{1:je,2:[qe,ft,Rt],3:[qe,Bt,Zt],4:Pe}}function Vt(e){Ue.call(this,e,-1,Wt)}function Ct(){return{1:je,2:[$e,It,yt],3:Le,4:Ke,5:Ke,6:Ke}}g(Bt,Ue),g(ft,Ue),g(It,Ue),g(Vt,Ue);var Wt=[2,4,5,6];function Et(e){Ue.call(this,e,-1,vt)}function St(){return{1:je,2:[$e,Vt,Ct],3:[qe,Ft,pt],4:Me,5:Ke,6:Ke}}g(Et,Ue);var vt=[2,5,6];function Jt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Nt(e){return Ce(e,tt,1).map((function(e){return{index:Ee(e,1),$:Re(e,2),label:null!=Be(e,3)?Se(e,3):void 0,displayName:null!=Be(e,4)?Se(e,4):void 0}}))}function Gt(e){return{x:Re(e,1),y:Re(e,2),z:Re(e,3),visibility:null!=Be(e,4)?Re(e,4):void 0}}function Xt(e,t){this.h=e,this.g=t,this.l=0}function kt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Jt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Jt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={J:n.getAttribLocation(r,"aVertex"),I:n.getAttribLocation(r,"aTex"),ja:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.J),n.disableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Tt(e){this.g=e}var Yt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function wt(e,t){return t+e}function Dt(e,t){window[e]=t}function xt(t){if(this.g=t,this.listeners={},this.j={},this.G={},this.m={},this.s={},this.H=this.o=this.S=!0,this.D=e.resolve(),this.R="",this.C={},this.locateFile=t&&t.locateFile||wt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.T=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Mt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.S?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(Yt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return Dt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Dt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=Ht(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.T)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,Ht(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.T)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ga:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.F=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.S=!1,g.g=0}}))}function Ht(e,t){var n,r;return f((function(i){return t in e.G?i.return(e.G[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.G[t]=r,i.return(r))}))}function Kt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.H=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new Xt(e.h,e.F),e.s[t]=r),i.return(kt(r,n,e.H))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=De(b.get(I),ht,gt);y={U:{aa:Re(y,1),ba:Re(y,2),height:Re(y,3),width:Re(y,4),rotation:Re(y,5,0),Z:Ee(y,6)},P:Ce(De(B.get(I),dt,ut),lt,1).map(Gt),N:Nt(De(Z.get(I),it,ot))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.s[u])||(g=new Xt(e.h,e.F),e.s[u]=g),U(m,kt(g,h,e.H),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Lt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.D=Kt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function zt(e){var t=Ee(e,1),n=Ve(e,Bt,3);return{id:t,point2d:n={x:Re(n,1),y:Re(n,2),depth:Re(n,3)},point3d:{x:Re(e=Ve(e,ft,2),1),y:Re(e,2),z:Re(e,3)}}}function Ot(e){var t=De(e,Et,St);e=[],t=Ce(t,Vt,2);for(var n=0;n<t.length;n++)e.push({id:Ee(t[n],1),keypoints:Ce(t[n],It,2).map(zt),visibility:Re(t[n],3),scale:fe(t[n],6),translation:fe(t[n],5),rotation:fe(t[n],4)});return e}function jt(e){switch(e){case"Camera":return"Camera";case"Chair":return"Chair";case"Cup":return"Coffee cup, Mug";default:return"Footwear"}}(t=xt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={L:o.L,M:o.M},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.L=c.onChange,o.M=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.L(e.M),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Mt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.R===e.g.graph.url?d.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.R=e.g.graph.url,U(d,Ht(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Lt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.A){c.g=2;break}t=l(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.B),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.B=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.D,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.m[c.stream];if(Q||(Q=new Xt(A.h,A.F),A.m[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.m[c.stream])||(Q=new Tt(A.h),A.m[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.U,f=new ht;if(Ie(f,1,Z.aa),Ie(f,2,Z.ba),Ie(f,3,Z.height),Ie(f,4,Z.width),Ie(f,5,Z.rotation),Ie(f,6,Z.Z),Z=we(f,Qt),b.call(m,B,Z),F.P)for(m=0;m<F.P.length;++m){var R=!!(f=F.P[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ie(R=new lt,1,f.x),Ie(R,2,f.y),Ie(R,3,f.z),f.visibility&&Ie(R,4,f.visibility),f=we(R,st),B.call(b,Z,f)}if(F.N)for(m=0;m<F.N.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.N[m],Ie(R=new tt,2,f.$),f.index&&Ie(R,1,f.index),f.label&&Ie(R,3,f.label),f.displayName&&Ie(R,4,f.displayName),f=we(R,rt),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.D,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",xt),y("OptionType",{BOOL:0,NUMBER:1,ca:2,0:"BOOL",1:"NUMBER",2:"STRING"});var Pt={focalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_x"}},focalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_y"}},principalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_x"}},principalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_y"}},allowedLabels:{type:2,graphOptionXref:{calculatorName:"ConstantSidePacketCalculatorAllowedLabels",calculatorType:"ConstantSidePacketCalculator",fieldName:"string_value"}}};function _t(e){var t=this;e=e||{},this.g=new xt({locateFile:e.locateFile,files:[{url:"objectron_solution_packed_assets_loader.js"},{simd:!1,url:"objectron_solution_wasm_bin.js"},{simd:!0,url:"objectron_solution_simd_wasm_bin.js"}],graph:{url:"objectron.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["lifted_objects","image_transformed"],outs:{image:"image_transformed",objectDetections:{type:"proto",stream:"lifted_objects",transform:Ot}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,default:!1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumObjects:{type:1,default:5,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorMaxNumObjects",fieldName:"int_value"}},staticImageMode:{type:0,default:!0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"objectrongpusubgraph__ConstantSidePacketCalculator",fieldName:"bool_value"}},minDetectionConfidence:{type:1,default:.5,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"objectrongpusubgraph__objectdetectionoidv4subgraph__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,default:.99,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"objectrongpusubgraph__boxlandmarksubgraph__ThresholdingCalculator",fieldName:"threshold"}},modelName:{default:"Shoe",onChange:function(e){var n,r,i,o;return f((function(a){return 1==a.g?(n=e,t.g.setOptions({allowedLabels:jt(n)},Pt),r=function(e){switch(e){case"Camera":return"object_detection_3d_camera.tflite";case"Chair":return"object_detection_3d_chair.tflite";case"Cup":return"object_detection_3d_cup.tflite";default:return"object_detection_3d_sneakers.tflite"}}(n),i="object_detection_3d.tflite",U(a,Ht(t.g,r),2)):(o=a.h,t.g.overrideFile(i,o),a.return(!0))}))}},focalLength:{default:[1,1],onChange:function(e){var n;return f((function(r){return n=e,t.h=n,t.g.setOptions({focalX:n[0],focalY:n[1]},Pt),r.return(!0)}))}},principalPoint:{default:[0,0],onChange:function(e){var n;return f((function(r){return n=e,t.i=n,t.g.setOptions({principalX:n[0],principalY:n[1]},Pt),r.return(!0)}))}},imageSize:{onChange:function(e){var n,r,i,o;return f((function(a){if(void 0===t.h||void 0===t.i)return console.error('"focalLength" and "principalPoint" must be set if setting image size'),a.return();r=[(n=e)[0]/2,n[1]/2],i=[t.h[0]/r[0],t.h[1]/r[1]],o=[t.i[0]/r[0],t.i[1]/r[1]],t.setOptions({focalLength:i,principalPoint:o}),a.g=0}))}}}})}(t=_t.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Objectron",_t),y("BOX_CONNECTIONS",[[1,2],[2,4],[4,3],[3,1],[5,6],[6,8],[8,7],[7,5],[1,5],[2,6],[3,7],[4,8]]),y("BOX_KEYPOINTS",{CENTER:0,BACK_BOTTOM_LEFT:1,FRONT_BOTTOM_LEFT:2,BACK_TOP_LEFT:3,FRONT_TOP_LEFT:4,BACK_BOTTOM_RIGHT:5,FRONT_BOTTOM_RIGHT:6,BACK_TOP_RIGHT:7,FRONT_TOP_RIGHT:8}),y("VERSION","0.4.1636596145")}).call(De);const xe={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e){!function(e){I.setTimeout((function(){throw e}),0)}(e)}function C(e,t){V(Error("Invalid wire type: "+e+" (at position "+t+")"))}function W(){V(Error("Failed to read varint, encoding is invalid."))}function E(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var S,v,J=typeof TextDecoder<"u",N=typeof TextEncoder<"u";function G(e){if(N)e=(v||(v=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var X={},k=null;function T(e){var t;void 0===t&&(t=0),w(),t=X[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function Y(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=k[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}w();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function w(){if(!k){k={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));X[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===k[o]&&(k[o]=i)}}}}var D,x="function"==typeof Uint8Array;function M(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}M.prototype.toJSON=function(){if(null==this.g)var e="";else e=this.g,e=this.g=null==e||"string"==typeof e?e:x&&e instanceof Uint8Array?T(e):null;return e};var H="function"==typeof Uint8Array.prototype.slice;function K(e,t,n){return t===n?D||(D=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var L=0;function z(e,t){t=void 0!==(t=void 0===t?{}:t).u&&t.u,this.h=null,this.g=this.i=this.l=0,this.j=!1,this.u=t,e&&O(this,e)}function O(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return Y(e);if(e.constructor===M){if(null==e.g)var t=D||(D=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||x&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?Y(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.l=0,e.i=e.h.length,e.g=e.l}function j(e){e.g>e.i&&(e.j=!0,V(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}function P(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,j(e),r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,j(e),r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,j(e),r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,j(e),r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,j(e),r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]?(e.j=!0,W(),r):(j(e),r))))))}z.prototype.reset=function(){this.g=this.l};var _=[];function q(){this.g=new Uint8Array(64),this.h=0}function $(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ee(e,t){for(;127<t;)$(e,127&t|128),t>>>=7;$(e,t)}function te(e){var t={},n=void 0!==t.N&&t.N;this.m={u:void 0!==t.u&&t.u},this.N=n,t=this.m,_.length?(n=_.pop(),t&&(n.u=t.u),e&&O(n,e),e=n):e=new z(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ne(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).j||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=P(e.g);return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,C(n,e.l),!1)}function re(e){switch(e.h){case 0:if(0!=e.h)re(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(!(128&e.h[t])){e.g=t+1,j(e);break e}t++}e.j=!0,W()}break;case 1:(e=e.g).g+=8,j(e);break;case 2:2!=e.h?re(e):(t=P(e.g),(e=e.g).g+=t,j(e));break;case 5:(e=e.g).g+=4,j(e);break;case 3:for(t=e.i;;){if(!ne(e)){e.j=!0,V(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,V(Error("Unmatched end-group tag")));break}re(e)}break;default:e.j=!0,C(e.h,e.l)}}function ie(e,t,n){e.N||(e=K(e.g.h,n,e.g.g),(n=t.m)?n.push(e):t.m=[e])}q.prototype.length=function(){return this.h},q.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,K(e,0,t)},te.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var oe=[];function ae(){this.h=[],this.i=0,this.g=new q}function le(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function ce(e,t,n){ee(e.g,8*t+2),ee(e.g,n.length),le(e,e.g.end()),le(e,n)}var se,de="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ue(e,t){Object.isFrozen(e)||(de?e[de]|=t:void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function Ae(e){var t;return e?null!=(t=de?e[de]:e.g)?t:0:0}function he(e){return Array.isArray(e)&&ue(e,1),e}function ge(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ue(e,2)}function Qe(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Fe(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":return x&&null!=e&&e instanceof Uint8Array?T(e):e;default:return e}}function pe(e,t){if(null!=e)return Array.isArray(e)||Qe(e)?Ue(e,t):t(e)}function Ue(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=pe(e[r],t);return 1&Ae(e)&&he(n),n}for(r in n={},e)n[r]=pe(e[r],t);return n}function me(e,t,n){var r=se;if(se=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=(r?0:-1)-(this.constructor.aa||0),this.i=null,this.g=e,e=(r=this.g.length)-1,r&&Qe(r=this.g[e])?(this.l=e-this.j,this.h=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.g[e])?he(r):this.g[e]=Ze):(fe(this),(r=this.h[e])?he(r):this.h[e]=Ze)}var be,Be,Ze=Object.freeze(he([]));function fe(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function Re(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function Ie(e,t,n){n=void 0===n||n;var r=void 0!==r&&r,i=Re(e,t,r);return null==i&&(i=Ze),i===Ze?Ve(e,t,i=he([]),r):n&&Array.isArray(i)&&2&Ae(i)&&Ve(e,t,i=i.slice(),r),i}function ye(e,t,n){var r;return null!=(r=e=null==(e=Re(e,t))?e:+e)?r:void 0===n?0:n}function Ve(e,t,n,r){void 0!==r&&r||t>=e.l?(fe(e),e.h[t]=n):e.g[t+e.j]=n}function Ce(e,t,n){e.i||(e.i={});var r=e.i[n];if(!r){var i=Ie(e,n,!1);r=[];for(var o=!!Array.isArray(i)&&!!(2&Ae(i)),a=0;a<i.length;a++)r[a]=new t(i[a]),o&&ge(r[a].g);o&&(ge(r),Object.freeze(r)),e.i[n]=r}return r}function We(e,t,n,r,i){var o=Ce(e,r,t);n=n||new r,e=Ie(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,Ee(n))):(o.push(n),e.push(Ee(n)))}function Ee(e){if(e.i)for(var t in e.i){var n=e.i[t];if(Array.isArray(n))for(var r=0;r<n.length;r++)n[r]&&Ee(n[r]);else n&&Ee(n)}return e.g}function Se(e,t){var n;return null!=(n=e=Re(e,t))?n:0}function ve(e,t){var n;return null!=(n=e=Re(e,t))?n:""}function Je(e,t){if(e=e.m){le(t,t.g.end());for(var n=0;n<e.length;n++)le(t,e[n])}}function Ne(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=e[2];return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],a=e[2],l=e[3];return function(e,n,r){return t(e,n,r,o,a,l)};default:throw Error("unsupported number of parameters, expected [2-4], got "+e.length)}}function Ge(e,t,n){for(;ne(t)&&4!=t.h;){var r=t.i,i=n[r];if(i){if(Array.isArray(i)&&(i=n[r]=Ne(i)),!i(t,e,r)){i=e;var o=(r=t).l;re(r),ie(r,i,o)}}else i=e,o=(r=t).l,re(r),ie(r,i,o)}return e}function Xe(e,t){var n=new ae;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var a=r[o];0!==a.length&&(e.set(a,t),t+=a.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function ke(e,t,n){if(oe.length){var r=oe.pop();e&&(O(r.g,e),r.i=-1,r.h=-1),e=r}else e=new te(e);try{return n(new t,e)}finally{(t=e.g).h=null,t.l=0,t.i=0,t.g=0,t.j=!1,t.u=!1,e.i=-1,e.h=-1,e.j=!1,100>oe.length&&oe.push(e)}}function Te(e,t,n){if(null!=(t=Re(t,n))){ee(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?L=0:(0,L=2147483648):isNaN(r)?(0,L=2147483647):34028234663852886e22<r?(0,L=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,L=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,L=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=L)>>>0&255),$(e,n>>>8&255),$(e,n>>>16&255),$(e,n>>>24&255)}}function Ye(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,j(e),e=2*((i=(r<<0|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,Ve(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}function we(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,a=e=0;4>a&&128<=i;a++)o|=(127&(i=r.h[r.g++]))<<7*a;if(128<=i&&(o|=(127&(i=r.h[r.g++]))<<28,e|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)e|=(127&(i=r.h[r.g++]))<<7*a+3;return 128>i?(r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),e=e?-r:r):(r.j=!0,W(),e=void 0),Ve(t,n,e),!0}function De(e,t,n){return 0===e.h&&(Ve(t,n,P(e.g)),!0)}function xe(e,t,n){if(2!==e.h)return!1;var r,i=P(e.g),o=(e=e.g).g;if(e.g+=i,j(e),e=e.h,J)(r=S)||(r=S=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?s.push(65533):(l=e[o++],194>a||128!=(192&l)?(o--,s.push(65533)):s.push((31&a)<<6|63&l)):240>a?o>=i-1?s.push(65533):128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,s.push(65533)):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?s.push(65533):128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,s.push(65533)):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):s.push(65533),8192<=s.length&&(d=E(d,s),s.length=0);r=E(d,s)}return Ve(t,n,r),!0}function Me(e,t,n,r,i){if(2!==e.h)return!1;var o=new r,a=e.g.i,l=P(e.g),c=e.g.g+l;if(e.g.i=c,i(o,e),0!==(i=c-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+l+" bytes, instead read "+(l-i)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=c,e.g.i=a,We(t,n,o,r,void 0),!0}function He(e){me.call(this,e)}function Ke(e,t){var n=Re(e,1);if(null!=n&&null!=n){ee(t.g,8);var r=t.g;if(0<=n)ee(r,n);else{for(var i=0;9>i;i++)$(r,127&n|128),n>>=7;$(r,1)}}Te(t,e,2),null!=(r=Re(e,3))&&ce(t,3,G(r)),null!=(r=Re(e,4))&&ce(t,4,G(r)),Je(e,t)}function Le(e,t){return Ge(e,t,be||(be={1:De,2:Ye,3:xe,4:xe}))}function ze(e){me.call(this,e,-1,_e)}function Oe(e,t){return Ge(e,t,Be||(Be={1:[Me,He,Le]}))}me.prototype.toJSON=function(){return Ue(Ee(this),Fe)},me.prototype.toString=function(){return Ee(this).toString()},g(He,me),g(ze,me),ze.prototype.addClassification=function(e,t){return We(this,1,e,He,t),this};var je,Pe,_e=[1];function qe(e){me.call(this,e)}function $e(e,t){Te(t,e,1),Te(t,e,2),Te(t,e,3),Te(t,e,4),Te(t,e,5),Je(e,t)}function et(e,t){return Ge(e,t,je||(je={1:Ye,2:Ye,3:Ye,4:Ye,5:Ye}))}function tt(e){me.call(this,e,-1,it)}function nt(e,t){return Ge(e,t,Pe||(Pe={1:[Me,qe,et]}))}g(qe,me),g(tt,me);var rt,it=[1];function ot(e){me.call(this,e)}function at(e,t){Te(t,e,1),Te(t,e,2),Te(t,e,3),Te(t,e,4),Te(t,e,5);var n=Re(e,6);if(null!=n&&null!=n){ee(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=L=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}Je(e,t)}function lt(e,t){return Ge(e,t,rt||(rt={1:Ye,2:Ye,3:Ye,4:Ye,5:Ye,6:we}))}function ct(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function st(e){return Ce(e,He,1).map((function(e){return{index:Se(e,1),X:ye(e,2),label:null!=Re(e,3)?ve(e,3):void 0,displayName:null!=Re(e,4)?ve(e,4):void 0}}))}function dt(e){return{x:ye(e,1),y:ye(e,2),z:ye(e,3),visibility:null!=Re(e,4)?ye(e,4):void 0}}function ut(e){return Ce(ke(e,tt,nt),qe,1).map(dt)}function At(e,t){this.h=e,this.g=t,this.l=0}function ht(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=ct(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=ct(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function gt(e){this.g=e}g(ot,me);var Qt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Ft(e,t){return t+e}function pt(e,t){window[e]=t}function Ut(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||Ft,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function mt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.R?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(Qt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return pt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),pt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=bt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.S)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,bt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.D=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,g.g=0}}))}function bt(e,t){var n,r;return f((function(i){return t in e.F?i.return(e.F[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.F[t]=r,i.return(r))}))}function Bt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new At(e.h,e.D),e.s[t]=r),i.return(ht(r,n,e.G))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=ke(b.get(I),ot,lt);y={T:{Y:ye(y,1),Z:ye(y,2),height:ye(y,3),width:ye(y,4),rotation:ye(y,5,0),W:Se(y,6)},O:ut(B.get(I)),M:st(ke(Z.get(I),ze,Oe))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.s[u])||(g=new At(e.h,e.D),e.s[u]=g),U(m,ht(g,h,e.G),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Zt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=Bt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function ft(e){switch(void 0===e&&(e=0),e){case 1:return"pose_landmark_full.tflite";case 2:return"pose_landmark_heavy.tflite";default:return"pose_landmark_lite.tflite"}}function Rt(e){var t=this;e=e||{},this.g=new Ut({locateFile:e.locateFile,files:function(e){return[{url:"pose_solution_packed_assets_loader.js"},{simd:!1,url:"pose_solution_wasm_bin.js"},{simd:!0,url:"pose_solution_simd_wasm_bin.js"},{data:!0,url:ft(e.modelComplexity)}]},graph:{url:"pose_web.binarypb"},listeners:[{wants:["pose_landmarks","world_landmarks","segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:ut},poseWorldLandmarks:{type:"proto",stream:"world_landmarks",transform:ut},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i;return f((function(o){return 1==o.g?(n=ft(e),r="third_party/mediapipe/modules/pose_landmark/"+n,U(o,bt(t.g,n),2)):(i=o.h,t.g.overrideFile(r,i),o.return(!0))}))}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}}}})}(t=Ut.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,mt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.P===e.g.graph.url?d.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.P=e.g.graph.url,U(d,bt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.B)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.B[i]);if(e.B={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Zt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.v){c.g=2;break}t=l(e.v),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.v=void 0;case 2:if(e.A){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.A=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.C,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.m[c.stream];if(Q||(Q=new At(A.h,A.D),A.m[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.m[c.stream])||(Q=new gt(A.h),A.m[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.T,f=new ot;if(Ve(f,1,Z.Y),Ve(f,2,Z.Z),Ve(f,3,Z.height),Ve(f,4,Z.width),Ve(f,5,Z.rotation),Ve(f,6,Z.W),Z=Xe(f,at),b.call(m,B,Z),F.O)for(m=0;m<F.O.length;++m){var R=!!(f=F.O[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ve(R=new qe,1,f.x),Ve(R,2,f.y),Ve(R,3,f.z),f.visibility&&Ve(R,4,f.visibility),f=Xe(R,$e),B.call(b,Z,f)}if(F.M)for(m=0;m<F.M.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.M[m],Ve(R=new He,2,f.X),f.index&&Ve(R,1,f.index),f.label&&Ve(R,3,f.label),f.displayName&&Ve(R,4,f.displayName),f=Xe(R,Ke),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.C,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Ut),y("OptionType",{BOOL:0,NUMBER:1,$:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Rt.prototype).reset=function(){this.g.reset()},t.close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.send=function(e,t){var n=this;return f((function(r){return U(r,n.g.send(e,t),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Pose",Rt),y("POSE_CONNECTIONS",[[0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]]),y("POSE_LANDMARKS",{NOSE:0,LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,LEFT_EAR:7,RIGHT_EAR:8,LEFT_RIGHT:9,RIGHT_LEFT:10,LEFT_SHOULDER:11,RIGHT_SHOULDER:12,LEFT_ELBOW:13,RIGHT_ELBOW:14,LEFT_WRIST:15,RIGHT_WRIST:16,LEFT_PINKY:17,RIGHT_PINKY:18,LEFT_INDEX:19,RIGHT_INDEX:20,LEFT_THUMB:21,RIGHT_THUMB:22,LEFT_HIP:23,RIGHT_HIP:24,LEFT_KNEE:25,RIGHT_KNEE:26,LEFT_ANKLE:27,RIGHT_ANKLE:28,LEFT_HEEL:29,RIGHT_HEEL:30,LEFT_FOOT_INDEX:31,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_LEFT",{LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,LEFT_EAR:7,LEFT_RIGHT:9,LEFT_SHOULDER:11,LEFT_ELBOW:13,LEFT_WRIST:15,LEFT_PINKY:17,LEFT_INDEX:19,LEFT_THUMB:21,LEFT_HIP:23,LEFT_KNEE:25,LEFT_ANKLE:27,LEFT_HEEL:29,LEFT_FOOT_INDEX:31}),y("POSE_LANDMARKS_RIGHT",{RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,RIGHT_EAR:8,RIGHT_LEFT:10,RIGHT_SHOULDER:12,RIGHT_ELBOW:14,RIGHT_WRIST:16,RIGHT_PINKY:18,RIGHT_INDEX:20,RIGHT_THUMB:22,RIGHT_HIP:24,RIGHT_KNEE:26,RIGHT_ANKLE:28,RIGHT_HEEL:30,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_NEUTRAL",{NOSE:0}),y("VERSION","0.5.1635988162")}).call(xe);const Me=function(){function t(){this.mediapipeMap_=new Map}var n=t.prototype;return n.getVersion=function(e){switch(e){case"face_detection":return Ye.VERSION;case"face_mesh":return we.VERSION;case"hands":return ke.VERSION;case"holistic":return Te.VERSION;case"objectron":return De.VERSION;case"selfie_segmentation":return Xe.VERSION;case"pose":return xe.VERSION;default:return""}},n.initialize=function(n){var r=this;return new e(function(){var e=(0,c.default)(o.default.mark((function e(i,a){var l,c,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!=n.mediaPipeModelConfigArray.length){e.next=3;break}return a("no model was selected"),e.abrupt("return");case 3:l=0;case 4:if(!(l<n.mediaPipeModelConfigArray.length)){e.next=45;break}if(c=n.mediaPipeModelConfigArray[l],!r.mediapipeMap_.has(c.modelType)){e.next=9;break}return a("setting same type is not supported"),e.abrupt("return");case 9:if("function"==typeof c.listener){e.next=12;break}return a(`[${c.modelType}] ResultsListener must be provided`),e.abrupt("return");case 12:e.t0=c.modelType,e.next="face_mesh"===e.t0?15:"face_detection"===e.t0?17:"hands"===e.t0?19:"holistic"===e.t0?21:"objectron"===e.t0?23:"selfie_segmentation"===e.t0?25:"pose"===e.t0?27:29;break;case 15:return s=new we.FaceMesh({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"face_mesh/"+r.getVersion("face_mesh"))+"/"+e}),e.abrupt("break",31);case 17:return s=new Ye.FaceDetection({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"face_detection/"+r.getVersion("face_detection"))+"/"+e}),e.abrupt("break",31);case 19:return s=new ke.Hands({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"hands/"+r.getVersion("hands"))+"/"+e}),e.abrupt("break",31);case 21:return s=new Te.Holistic({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"holistic/"+r.getVersion("holistic"))+"/"+e}),e.abrupt("break",31);case 23:return s=new De.Objectron({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"objectron/"+r.getVersion("objectron"))+"/"+e}),e.abrupt("break",31);case 25:return s=new Xe.SelfieSegmentation({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"selfie_segmentation/"+r.getVersion("selfie_segmentation"))+"/"+e}),e.abrupt("break",31);case 27:return s=new xe.Pose({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"pose/"+r.getVersion("pose"))+"/"+e}),e.abrupt("break",31);case 29:return a("unknown model type"),e.abrupt("return");case 31:return s.onResults(c.listener),c.options&&s.setOptions(c.options),e.prev=32,e.next=35,s.initialize();case 35:r.mediapipeMap_.set(c.modelType,s),e.next=42;break;case 38:return e.prev=38,e.t1=e.catch(32),a(e.t1),e.abrupt("return");case 42:l++,e.next=4;break;case 45:i();case 46:case"end":return e.stop()}}),e,null,[[32,38]])})));return function(t,n){return e.apply(this,arguments)}}())},n.close=function(t){return new e((n,r)=>{let i=[];if(t){let e=this.mediapipeMap_.get(t);if(!e)return void r("model not exit");this.mediapipeMap_.delete(t),i.push(e.close())}else{for(var o,a=A(this.mediapipeMap_.entries());!(o=a()).done;){const e=o.value,t=(e[0],e[1]);i.push(t.close())}this.mediapipeMap_.clear()}e.all(i).then(()=>{n()}).catch(e=>{r(e)})})},n.send=function(t,n){return new e((r,i)=>{let o=[];if(n){let e=this.mediapipeMap_.get(n);if(!e)return void i("model not exit");o.push(e.send({image:t}))}else for(var a,l=A(this.mediapipeMap_.entries());!(a=l()).done;){const e=a.value,n=(e[0],e[1]);o.push(n.send({image:t}))}e.all(o).then(()=>{r()}).catch(e=>{i(e)})})},n.reset=function(e){if(e){let t=this.mediapipeMap_.get(e);t&&"function"==typeof t.reset&&t.reset()}else for(var t,n=A(this.mediapipeMap_.entries());!(t=n()).done;){const e=t.value,n=(e[0],e[1]);n&&"function"==typeof n.reset&&n.reset()}},t}();Me.defaultAssetsBaseUrl="https://d3opqjmqzxf057.cloudfront.net/ml/mediapipe/";let He=Me;t.MediapipeHelper=He;const Ke=new WeakMap,Le=new WeakMap,ze=new WeakMap,Oe=Symbol("anyProducer"),je=e.resolve(),Pe=Symbol("listenerAdded"),_e=Symbol("listenerRemoved");let qe=!1,$e=!1;function et(e){if("string"!=typeof e&&"symbol"!=typeof e&&"number"!=typeof e)throw new TypeError("`eventName` must be a string, symbol, or number")}function tt(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function nt(e,t){const n=Le.get(e);if(n.has(t))return n.get(t)}function rt(e,t){const n="string"==typeof t||"symbol"==typeof t||"number"==typeof t?t:Oe,r=ze.get(e);if(r.has(n))return r.get(n)}function it(t,n,r){const i=ze.get(t);if(i.has(n))for(var o,a=A(i.get(n));!(o=a()).done;){o.value.enqueue(r)}if(i.has(Oe)){const t=e.all([n,r]);for(var l,c=A(i.get(Oe));!(l=c()).done;){l.value.enqueue(t)}}}function ot(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},a=[];const l={enqueue(e){a.push(e),i()},finish(){r=!0,i()}};for(var s,d=A(n);!(s=d()).done;){const e=s.value;let n=rt(t,e);n||(n=new Set,ze.get(t).set(e,n)),n.add(l)}return{next(){var t=this;return(0,c.default)(o.default.mark((function n(){return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!a){n.next=20;break}if(0!==a.length){n.next=12;break}if(!r){n.next=6;break}n.t2=(a=void 0,t.next()),n.next=9;break;case 6:return n.next=8,new e(e=>{i=e});case 8:n.t2=t.next();case 9:n.t1=n.t2,n.next=17;break;case 12:return n.t3=!1,n.next=15,a.shift();case 15:n.t4=n.sent,n.t1={done:n.t3,value:n.t4};case 17:n.t0=n.t1,n.next=21;break;case 20:n.t0={done:!0};case 21:return n.abrupt("return",n.t0);case 22:case"end":return n.stop()}}),n)})))()},return(e){var r=arguments;return(0,c.default)(o.default.mark((function c(){var s,d,u,h;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:for(a=void 0,s=A(n);!(d=s()).done;)u=d.value,(h=rt(t,u))&&(h.delete(l),0===h.size&&ze.get(t).delete(u));if(i(),!(r.length>0)){o.next=11;break}return o.t1=!0,o.next=7,e;case 7:o.t2=o.sent,o.t0={done:o.t1,value:o.t2},o.next=12;break;case 11:o.t0={done:!0};case 12:return o.abrupt("return",o.t0);case 13:case"end":return o.stop()}}),c)})))()},[Symbol.asyncIterator](){return this}}}function at(e){if(void 0===e)return dt;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(var t,n=A(e);!(t=n()).done;){const e=t.value;if(!dt.includes(e))throw"string"!=typeof e?new TypeError("`methodNames` element must be a string"):new Error(e+" is not Emittery method")}return e}const lt=e=>e===Pe||e===_e;function ct(e,t,n){if(lt(t))try{qe=!0,e.emit(t,n)}finally{qe=!1}}let st=function(){function t(e){var t;void 0===e&&(e={}),Ke.set(this,new Set),Le.set(this,new Map),ze.set(this,new Map),ze.get(this).set(Oe,new Set),this.debug=null!=(t=e.debug)?t:{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{try{r=JSON.stringify(r)}catch(e){r="Object with the following keys failed to stringify: "+Object.keys(r).join(",")}("symbol"==typeof n||"number"==typeof n)&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}t.mixin=function(e,n){return n=at(n),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(var i,o=A(n);!(i=o()).done;){const e=i.value;if(void 0!==r.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``)}Object.defineProperty(r.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new t}),this[e]}});const a=t=>function(){return this[e][t](...arguments)};for(var l,c=A(n);!(l=c()).done;){const e=l.value;Object.defineProperty(r.prototype,e,{enumerable:!1,value:a(e)})}return r}};var n=t.prototype;return n.logIfDebugEnabled=function(e,n,r){(t.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,n,r)},n.on=function(e,t){tt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;et(e);let r=nt(this,e);r||(r=new Set,Le.get(this).set(e,r)),r.add(t),this.logIfDebugEnabled("subscribe",e,void 0),lt(e)||ct(this,Pe,{eventName:e,listener:t})}return this.off.bind(this,e,t)},n.off=function(e,t){tt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;et(e);const r=nt(this,e);r&&(r.delete(t),0===r.size&&Le.get(this).delete(e)),this.logIfDebugEnabled("unsubscribe",e,void 0),lt(e)||ct(this,_e,{eventName:e,listener:t})}},n.once=function(t){let n;const r=new e(e=>{n=this.on(t,t=>{n(),e(t)})});return r.off=n,r},n.events=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){et(t.value)}return ot(this,e)},n.emit=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i,a,l,s,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(et(n),!lt(n)||qe){t.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emit",n,r),it(this,n,r),a=null!=(i=nt(this,n))?i:new Set,l=Ke.get(this),s=[...a],d=lt(n)?[]:[...l],t.next=6,je;case 6:return t.next=8,e.all([...s.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.has(t)){e.next=2;break}return e.abrupt("return",t(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),...d.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l.has(t)){e.next=2;break}return e.abrupt("return",t(n,r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.emitSerial=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d,u,A,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(et(t),!lt(t)||qe){e.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emitSerial",t,n),i=null!=(r=nt(this,t))?r:new Set,a=Ke.get(this),l=[...i],c=[...a],e.next=6,je;case 6:s=0,d=l;case 7:if(!(s<d.length)){e.next=16;break}if(u=d[s],e.t0=i.has(u),!e.t0){e.next=13;break}return e.next=13,u(n);case 13:s++,e.next=7;break;case 16:A=0,h=c;case 17:if(!(A<h.length)){e.next=26;break}if(u=h[A],e.t1=a.has(u),!e.t1){e.next=23;break}return e.next=23,u(t,n);case 23:A++,e.next=17;break;case 26:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),n.onAny=function(e){return tt(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),Ke.get(this).add(e),ct(this,Pe,{listener:e}),this.offAny.bind(this,e)},n.anyEvent=function(){return ot(this)},n.offAny=function(e){tt(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),ct(this,_e,{listener:e}),Ke.get(this).delete(e)},n.clearListeners=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){const e=t.value;if(this.logIfDebugEnabled("clear",e,void 0),"string"==typeof e||"symbol"==typeof e||"number"==typeof e){const t=nt(this,e);t&&t.clear();const n=rt(this,e);if(n){for(var r,i=A(n);!(r=i()).done;){r.value.finish()}n.clear()}}else{Ke.get(this).clear();for(var o,a=A(Le.get(this).entries());!(o=a()).done;){const e=o.value,t=e[0];e[1].clear(),Le.get(this).delete(t)}for(var l,c=A(ze.get(this).entries());!(l=c()).done;){const e=l.value,t=e[0],n=e[1];for(var s,d=A(n);!(s=d()).done;){s.value.finish()}n.clear(),ze.get(this).delete(t)}}}},n.listenerCount=function(e){var t,n,r;let i=0;for(var o,a=A(e=Array.isArray(e)?e:[e]);!(o=a()).done;){const e=o.value;if("string"!=typeof e){typeof e<"u"&&et(e),i+=Ke.get(this).size;for(var l,c=A(Le.get(this).values());!(l=c()).done;){i+=l.value.size}for(var s,d=A(ze.get(this).values());!(s=d()).done;){i+=s.value.size}}else{var u,h,g;i+=Ke.get(this).size+(null!=(u=null==(t=nt(this,e))?void 0:t.size)?u:0)+(null!=(h=null==(n=rt(this,e))?void 0:n.size)?h:0)+(null!=(g=null==(r=rt(this))?void 0:r.size)?g:0)}}return i},n.bindMethods=function(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");for(var n,r=A(t=at(t));!(n=r()).done;){const t=n.value;if(void 0!==e[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(e,t,{enumerable:!1,value:this[t].bind(this)})}},(0,l.default)(t,null,[{key:"isDebugEnabled",get:function(){var e,t;if("object"!=typeof(null==(t=s.process)?void 0:t.env))return $e;const n=(null!=(e=s.process)?e:{env:{}}).env;return"emittery"===n.DEBUG||"*"===n.DEBUG||$e},set:function(e){$e=e}}]),t}();const dt=Object.getOwnPropertyNames(st.prototype).filter(e=>"constructor"!==e);function ut(e,t){s.vonage||(s.vonage={}),s.vonage.workerizer||(s.vonage.workerizer={});let n=s.vonage.workerizer;return n[e]||(n[e]=t),n[e]}Object.defineProperty(st,"listenerAdded",{value:Pe,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(st,"listenerRemoved",{value:_e,writable:!1,enumerable:!0,configurable:!1});const At=ut("globals",{});var ht=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e.EVENT="EVENT",e))(ht||{});function gt(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let Qt=0;function Ft(t,n,r,i,o){const a=Qt++;return t.postMessage({id:a,type:n,functionName:r,args:i},i.filter(e=>gt(e))),new e(e=>{null==o||o.set(a,e)})}function pt(e,t){const n=e.id,r=e.type,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>gt(e)))}const Ut=ut("workerized",{});function mt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function bt(){return Bt.apply(this,arguments)}function Bt(){return(Bt=(0,c.default)(o.default.mark((function t(){var n,r,i,a,l;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!mt()){t.next=4;break}pt({type:ht.GLOBALS_SYNC},At),t.next=8;break;case 4:for(r in n=[],Ut)i=Ut[r].workerContext,a=i.worker,l=i.resolvers,a&&n.push(Ft(a,ht.GLOBALS_SYNC,"",[At],l));return t.next=8,e.all(n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zt(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],Zt(e[n],t[n])):"object"==typeof e[n]?(t[n]={},Zt(e[n],t[n])):t[n]=e[n]}function ft(e,t,n,r){return Rt.apply(this,arguments)}function Rt(){return(Rt=(0,c.default)(o.default.mark((function e(t,n,r,i){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a=new n).addEventListener("message",function(){var e=(0,c.default)(o.default.mark((function e(t){var n,a,l,c,s,d,u,A,h,g;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.data,e.t0=n.type,e.next=e.t0===ht.GLOBALS_SYNC?4:e.t0===ht.EVENT?12:17;break;case 4:if(!n.id){e.next=8;break}null==(l=r.get(null!=(a=n.id)?a:-1))||l(n.result),r.delete(null!=(c=n.id)?c:-1),e.next=11;break;case 8:return Zt(null!=(s=n.result)?s:{},At),e.next=11,bt();case 11:return e.abrupt("break",18);case 12:if(h=n.result,null!=(null==(g=h)?void 0:g.name)){e.next=15;break}throw"Missing event name";case 15:return i(g.name,g.data),e.abrupt("break",18);case 17:null==(u=r.get(null!=(d=n.id)?d:-1))||u(n.result),r.delete(null!=(A=n.id)?A:-1);case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=4,Ft(a,ht.INIT,"",[t.workerId,At],r);case 4:if(e.sent){e.next=6;break}throw"Failed to instantiate workerized class";case 6:return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const It=new WeakMap,yt=new WeakMap,Vt=new WeakMap,Ct=Symbol("anyProducer"),Wt=e.resolve(),Et=Symbol("listenerAdded"),St=Symbol("listenerRemoved");let vt=!1,Jt=!1;function Nt(e){if("string"!=typeof e&&"symbol"!=typeof e&&"number"!=typeof e)throw new TypeError("`eventName` must be a string, symbol, or number")}function Gt(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function Xt(e,t){const n=yt.get(e);if(n.has(t))return n.get(t)}function kt(e,t){const n="string"==typeof t||"symbol"==typeof t||"number"==typeof t?t:Ct,r=Vt.get(e);if(r.has(n))return r.get(n)}function Tt(t,n,r){const i=Vt.get(t);if(i.has(n))for(var o,a=A(i.get(n));!(o=a()).done;){o.value.enqueue(r)}if(i.has(Ct)){const t=e.all([n,r]);for(var l,c=A(i.get(Ct));!(l=c()).done;){l.value.enqueue(t)}}}function Yt(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},a=[];const l={enqueue(e){a.push(e),i()},finish(){r=!0,i()}};for(var s,d=A(n);!(s=d()).done;){const e=s.value;let n=kt(t,e);n||(n=new Set,Vt.get(t).set(e,n)),n.add(l)}return{next(){var t=this;return(0,c.default)(o.default.mark((function n(){return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!a){n.next=20;break}if(0!==a.length){n.next=12;break}if(!r){n.next=6;break}n.t2=(a=void 0,t.next()),n.next=9;break;case 6:return n.next=8,new e(e=>{i=e});case 8:n.t2=t.next();case 9:n.t1=n.t2,n.next=17;break;case 12:return n.t3=!1,n.next=15,a.shift();case 15:n.t4=n.sent,n.t1={done:n.t3,value:n.t4};case 17:n.t0=n.t1,n.next=21;break;case 20:n.t0={done:!0};case 21:return n.abrupt("return",n.t0);case 22:case"end":return n.stop()}}),n)})))()},return(e){var r=arguments;return(0,c.default)(o.default.mark((function c(){var s,d,u,h;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:for(a=void 0,s=A(n);!(d=s()).done;)u=d.value,(h=kt(t,u))&&(h.delete(l),0===h.size&&Vt.get(t).delete(u));if(i(),!(r.length>0)){o.next=11;break}return o.t1=!0,o.next=7,e;case 7:o.t2=o.sent,o.t0={done:o.t1,value:o.t2},o.next=12;break;case 11:o.t0={done:!0};case 12:return o.abrupt("return",o.t0);case 13:case"end":return o.stop()}}),c)})))()},[Symbol.asyncIterator](){return this}}}function wt(e){if(void 0===e)return Ht;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(var t,n=A(e);!(t=n()).done;){const e=t.value;if(!Ht.includes(e))throw"string"!=typeof e?new TypeError("`methodNames` element must be a string"):new Error(e+" is not Emittery method")}return e}const Dt=e=>e===Et||e===St;function xt(e,t,n){if(Dt(t))try{vt=!0,e.emit(t,n)}finally{vt=!1}}let Mt=function(){function t(e){var t;void 0===e&&(e={}),It.set(this,new Set),yt.set(this,new Map),Vt.set(this,new Map),Vt.get(this).set(Ct,new Set),this.debug=null!=(t=e.debug)?t:{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{try{r=JSON.stringify(r)}catch(e){r="Object with the following keys failed to stringify: "+Object.keys(r).join(",")}("symbol"==typeof n||"number"==typeof n)&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}t.mixin=function(e,n){return n=wt(n),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(var i,o=A(n);!(i=o()).done;){const e=i.value;if(void 0!==r.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``)}Object.defineProperty(r.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new t}),this[e]}});const a=t=>function(){return this[e][t](...arguments)};for(var l,c=A(n);!(l=c()).done;){const e=l.value;Object.defineProperty(r.prototype,e,{enumerable:!1,value:a(e)})}return r}};var n=t.prototype;return n.logIfDebugEnabled=function(e,n,r){(t.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,n,r)},n.on=function(e,t){Gt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;Nt(e);let r=Xt(this,e);r||(r=new Set,yt.get(this).set(e,r)),r.add(t),this.logIfDebugEnabled("subscribe",e,void 0),Dt(e)||xt(this,Et,{eventName:e,listener:t})}return this.off.bind(this,e,t)},n.off=function(e,t){Gt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;Nt(e);const r=Xt(this,e);r&&(r.delete(t),0===r.size&&yt.get(this).delete(e)),this.logIfDebugEnabled("unsubscribe",e,void 0),Dt(e)||xt(this,St,{eventName:e,listener:t})}},n.once=function(t){let n;const r=new e(e=>{n=this.on(t,t=>{n(),e(t)})});return r.off=n,r},n.events=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){Nt(t.value)}return Yt(this,e)},n.emit=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i,a,l,s,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Nt(n),!Dt(n)||vt){t.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emit",n,r),Tt(this,n,r),a=null!=(i=Xt(this,n))?i:new Set,l=It.get(this),s=[...a],d=Dt(n)?[]:[...l],t.next=6,Wt;case 6:return t.next=8,e.all([...s.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.has(t)){e.next=2;break}return e.abrupt("return",t(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),...d.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l.has(t)){e.next=2;break}return e.abrupt("return",t(n,r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.emitSerial=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d,u,A,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Nt(t),!Dt(t)||vt){e.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emitSerial",t,n),i=null!=(r=Xt(this,t))?r:new Set,a=It.get(this),l=[...i],c=[...a],e.next=6,Wt;case 6:s=0,d=l;case 7:if(!(s<d.length)){e.next=16;break}if(u=d[s],e.t0=i.has(u),!e.t0){e.next=13;break}return e.next=13,u(n);case 13:s++,e.next=7;break;case 16:A=0,h=c;case 17:if(!(A<h.length)){e.next=26;break}if(u=h[A],e.t1=a.has(u),!e.t1){e.next=23;break}return e.next=23,u(t,n);case 23:A++,e.next=17;break;case 26:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),n.onAny=function(e){return Gt(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),It.get(this).add(e),xt(this,Et,{listener:e}),this.offAny.bind(this,e)},n.anyEvent=function(){return Yt(this)},n.offAny=function(e){Gt(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),xt(this,St,{listener:e}),It.get(this).delete(e)},n.clearListeners=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){const e=t.value;if(this.logIfDebugEnabled("clear",e,void 0),"string"==typeof e||"symbol"==typeof e||"number"==typeof e){const t=Xt(this,e);t&&t.clear();const n=kt(this,e);if(n){for(var r,i=A(n);!(r=i()).done;){r.value.finish()}n.clear()}}else{It.get(this).clear();for(var o,a=A(yt.get(this).entries());!(o=a()).done;){const e=o.value,t=e[0];e[1].clear(),yt.get(this).delete(t)}for(var l,c=A(Vt.get(this).entries());!(l=c()).done;){const e=l.value,t=e[0],n=e[1];for(var s,d=A(n);!(s=d()).done;){s.value.finish()}n.clear(),Vt.get(this).delete(t)}}}},n.listenerCount=function(e){var t,n,r,i,o,a;let l=0;for(var c,s=A(e=Array.isArray(e)?e:[e]);!(c=s()).done;){const e=c.value;if("string"!=typeof e){typeof e<"u"&&Nt(e),l+=It.get(this).size;for(var d,u=A(yt.get(this).values());!(d=u()).done;){l+=d.value.size}for(var h,g=A(Vt.get(this).values());!(h=g()).done;){l+=h.value.size}}else l+=It.get(this).size+(null!=(n=null==(t=Xt(this,e))?void 0:t.size)?n:0)+(null!=(i=null==(r=kt(this,e))?void 0:r.size)?i:0)+(null!=(a=null==(o=kt(this))?void 0:o.size)?a:0)}return l},n.bindMethods=function(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");for(var n,r=A(t=wt(t));!(n=r()).done;){const t=n.value;if(void 0!==e[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(e,t,{enumerable:!1,value:this[t].bind(this)})}},(0,l.default)(t,null,[{key:"isDebugEnabled",get:function(){var e,t;if("object"!=typeof(null==(e=s.process)?void 0:e.env))return Jt;const n=(null!=(t=s.process)?t:{env:{}}).env;return"emittery"===n.DEBUG||"*"===n.DEBUG||Jt},set:function(e){Jt=e}}]),t}();const Ht=Object.getOwnPropertyNames(Mt.prototype).filter(e=>"constructor"!==e);function Kt(e){return e.prototype.onAny&&e.prototype.emit}Object.defineProperty(Mt,"listenerAdded",{value:Et,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Mt,"listenerRemoved",{value:St,writable:!1,enumerable:!0,configurable:!1});let Lt=0;function zt(e,t,n){return Ot.apply(this,arguments)}function Ot(){return(Ot=(0,c.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Kt(t)?new Mt:{},a=Lt++,e.abrupt("return",(Object.getOwnPropertyNames(t.prototype).forEach(e=>{i[e]=function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return Ft(n,ht.FORWARD,e,i,r)}}),i.terminate=(0,c.default)(o.default.mark((function e(){var t,l,c,s,d=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=d.length,l=new Array(t),c=0;c<t;c++)l[c]=d[c];return e.next=3,Ft(n,ht.TERMINATE,"",l,r);case 3:return s=e.sent,e.abrupt("return",(delete Ut[a],n.terminate(),i.workerContext.worker=void 0,s));case 5:case"end":return e.stop()}}),e)}))),i.workerContext={id:a,worker:n,resolvers:r},Ut[a]=i,i));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(e,t){return Pt.apply(this,arguments)}function Pt(){return(Pt=(0,c.default)(o.default.mark((function e(t,n){var r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Map,e.next=3,ft(t,n,r,(e,t)=>{null!=i&&i.emit&&(null==i||i.emit(e,t))});case 3:return a=e.sent,e.next=6,zt(t,a,r);case 6:return i=e.sent,e.abrupt("return",i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _t(e,t){return qt.apply(this,arguments)}function qt(){return(qt=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.functionName,i=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(r){e.next=5;break}throw"missing function name to call";case 5:if(n.instance[r]){e.next=7;break}throw`undefined function [${r}] in class ${n.instance.constructor.workerId}`;case 7:return e.t0=pt,e.t1=t,e.next=11,n.instance[r](...null!=i?i:[]);case 11:e.t2=e.sent,(0,e.t0)(e.t1,e.t2);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const $t=ut("registeredWorkers",{});function en(e,t){if(!e.args)throw"Missing className while initializing worker";const n=e.args,r=n[0],i=n[1],o=$t[r];if(!o)throw"unknown worker class "+r;t.instance=new o(e.args.slice(1)),Zt(i,At),function(e){return e.onAny&&e.emit}(t.instance)&&t.instance.onAny((e,t)=>{pt({type:ht.EVENT},{name:e,data:t})}),pt(e,void 0!==typeof t.instance)}function tn(e,t){return nn.apply(this,arguments)}function nn(){return(nn=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(e.t0=n.instance.terminate,!e.t0){e.next=8;break}return e.next=7,n.instance.terminate(...null!=r?r:[]);case 7:i=e.sent;case 8:pt(t,i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rn(e){if(!e.args)throw"Missing globals while syncing";Zt(e.args[0],At),pt(e,{})}mt()&&function(){const e={};onmessage=function(){var t=(0,c.default)(o.default.mark((function t(n){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,t.t0=r.type,t.next=t.t0===ht.INIT?4:t.t0===ht.FORWARD?6:t.t0===ht.TERMINATE?8:t.t0===ht.GLOBALS_SYNC?10:12;break;case 4:return en(r,e),t.abrupt("break",12);case 6:return _t(r,e),t.abrupt("break",12);case 8:return tn(r,e),t.abrupt("break",12);case 10:return rn(r),t.abrupt("break",12);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}();let on=function(){function t(){}return t.createVideoReadable=function(){var t=(0,c.default)(o.default.mark((function t(n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new e((e,t)=>{const r=document.createElement("video");let i=new AbortController,o=new AbortController;r.addEventListener("canplay",()=>{i.abort(),r.muted=!0,r.loop=!0,r.play().then(()=>{try{const t=r.captureStream(),n=new MediaStreamTrackProcessor(t.getVideoTracks()[0]);e(n.readable)}catch(e){t(e)}})},{once:!0,signal:o.signal}),r.addEventListener("error",e=>{o.abort(),t("loading error:"+e)},{once:!0,signal:i.signal}),r.crossOrigin="anonymous",r.src=n}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.createImageCanvas=function(){var e=(0,c.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return e.next=4,e.sent.blob();case 4:return n=e.sent,e.next=7,createImageBitmap(n);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t}();var an=Object.defineProperty,ln=(e,t,n)=>(((e,t,n)=>{t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,t+"",n),n);let cn;const sn=new Uint8Array(16);function dn(){if(!cn&&(cn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cn(sn)}const un=[];for(let e=0;e<256;++e)un.push((e+256).toString(16).slice(1));const An={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hn(e,t,n){if(An.randomUUID&&!t&&!e)return An.randomUUID();const r=(e=e||{}).random||(e.rng||dn)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t){return void 0===t&&(t=0),(un[e[t+0]]+un[e[t+1]]+un[e[t+2]]+un[e[t+3]]+"-"+un[e[t+4]]+un[e[t+5]]+"-"+un[e[t+6]]+un[e[t+7]]+"-"+un[e[t+8]]+un[e[t+9]]+"-"+un[e[t+10]]+un[e[t+11]]+un[e[t+12]]+un[e[t+13]]+un[e[t+14]]+un[e[t+15]]).toLowerCase()}(r)}function gn(e,t){s.vonage||(s.vonage={}),s.vonage.workerizer||(s.vonage.workerizer={});let n=s.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const Qn=gn("globals",{});var Fn=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(Fn||{});function pn(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let Un=0;function mn(t,n,r,i,o){const a=Un++;return t.postMessage({id:a,type:n,functionName:r,args:i},i.filter(e=>pn(e))),new e(e=>{null==o||o.set(a,e)})}function bn(e,t){const n=e.id,r=e.type,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>pn(e)))}const Bn=gn("workerized",{});function Zn(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function fn(){return Rn.apply(this,arguments)}function Rn(){return(Rn=(0,c.default)(o.default.mark((function t(){var n,r,i,a,l;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Zn()){t.next=4;break}bn({type:Fn.GLOBALS_SYNC},Qn),t.next=8;break;case 4:for(r in n=[],Bn)i=Bn[r].workerContext,a=i.worker,l=i.resolvers,a&&n.push(mn(a,Fn.GLOBALS_SYNC,"",[Qn],l));return t.next=8,e.all(n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function In(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],In(e[n],t[n])):"object"==typeof e[n]?(t[n]={},In(e[n],t[n])):t[n]=e[n]}function yn(e,t){return Vn.apply(this,arguments)}function Vn(){return(Vn=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.functionName,i=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(r){e.next=5;break}throw"missing function name to call";case 5:if(n.instance[r]){e.next=7;break}throw`undefined function [${r}] in class ${n.instance.constructor.workerId}`;case 7:return e.t0=bn,e.t1=t,e.next=11,n.instance[r](...null!=i?i:[]);case 11:e.t2=e.sent,(0,e.t0)(e.t1,e.t2);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const Cn=gn("registeredWorkers",{});function Wn(e,t){if(!e.args)throw"Missing className while initializing worker";const n=e.args,r=n[0],i=n[1],o=Cn[r];if(!o)throw"unknown worker class "+r;t.instance=new o(e.args.slice(1)),In(i,Qn),bn(e,void 0!==typeof t.instance)}function En(e,t){return Sn.apply(this,arguments)}function Sn(){return(Sn=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(e.t0=n.instance.terminate,!e.t0){e.next=8;break}return e.next=7,n.instance.terminate(...null!=r?r:[]);case 7:i=e.sent;case 8:bn(t,i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vn(e){if(!e.args)throw"Missing globals while syncing";In(e.args[0],Qn),bn(e,{})}Zn()&&function(){const e={};onmessage=function(){var t=(0,c.default)(o.default.mark((function t(n){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,t.t0=r.type,t.next=t.t0===Fn.INIT?4:t.t0===Fn.FORWARD?6:t.t0===Fn.TERMINATE?8:t.t0===Fn.GLOBALS_SYNC?10:12;break;case 4:return Wn(r,e),t.abrupt("break",12);case 6:return yn(r,e),t.abrupt("break",12);case 8:return En(r,e),t.abrupt("break",12);case 10:return vn(r),t.abrupt("break",12);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}();const Jn=function(e,t){return function(e,t){return Qn[e]||(Qn[e]=t),[()=>Qn[e],function(){var t=(0,c.default)(o.default.mark((function t(n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Qn[e]=n,t.next=3,fn();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()]}(e,t)}("metadata"),Nn=Jn[0];Jn[1];function Gn(){return Nn()}let Xn=function(){function e(e){ln(this,"uuid",hn()),this.config=e}var t=e.prototype;return t.send=function(){var e=(0,c.default)(o.default.mark((function e(t){var n,r,i,a,l,c,s,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null!=(n=Gn())?n:{},l=a.appId,c=a.sourceType,l&&c){e.next=3;break}return e.abrupt("return","metadata missing");case 3:return s=new AbortController,d=setTimeout(()=>s.abort(),1e4),e.next=6,(null!=(i=null==(r=this.config)?void 0:r.fetch)?i:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(t)),signal:s.signal});case 6:return clearTimeout(d),e.abrupt("return","success");case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getUrl=function(){var e;let t=null!=(e=Gn().proxyUrl)?e:"https://";return t+=("/"===t.at(-1)?"":"/")+"hlg.tokbox.com/prod/logging/vcp_webrtc",t},t.getHeaders=function(){return{"Content-Type":"application/json"}},t.buildReport=function(e){const t=Gn();return Object.assign({guid:this.uuid},e,{applicationId:t.appId,timestamp:Date.now(),proxyUrl:t.proxyUrl,source:t.sourceType})},e}();let kn=function(){function e(){const e=new OffscreenCanvas(0,0),t=e.getContext("2d",{willReadFrequently:!0});if(!t)throw"Fail to retrieve 2d context";this.canvas=e,this.context=t}var t=e.prototype;return t.setFlickeringOptions=function(e){},t.enablePostProcessing=function(){},t.disablePostProcessing=function(){},t.profileWebgl=function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",[]);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.render=function(){var e=(0,c.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.canvas);case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.resizeCanvas=function(e){const t=e.width,n=e.height;this.canvas.width=t,this.canvas.height=n},t.renderSilhouette=function(e,t,n){void 0===n&&(n="none");const r=e.width,i=e.height;this.context.save(),this.context.drawImage(t,0,0,t.width,t.height,0,0,r,i),this.context.filter="blur(5px)",this.context.globalCompositeOperation="source-in",this.context.drawImage(t,0,0,t.width,t.height,0,0,r,i),this.context.globalCompositeOperation="source-in",this.context.filter=n,this.context.drawImage(e,0,0,r,i,0,0,this.canvas.width,this.canvas.height),this.context.restore()},t.destroy=function(){},e}(),Tn=function(e){function t(t){var n;return(n=e.call(this)||this).radius=t,n}return(0,a.default)(t,e),t.prototype.render=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.prototype.resizeCanvas.call(this,n),t.next=3,createImageBitmap(r);case 3:return i=t.sent,t.abrupt("return",(this.renderSilhouette(n,i),this.context.save(),this.context.filter=`blur(${this.radius}px)`,this.context.globalCompositeOperation="destination-over",this.context.drawImage(n,0,0,n.width,n.height),this.context.restore(),e.prototype.render.call(this,n,r)));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t}(kn),Yn=function(e){function t(t){var n;return(n=e.call(this)||this).radius=t,n}return(0,a.default)(t,e),t.prototype.render=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.prototype.resizeCanvas.call(this,n),t.next=3,createImageBitmap(r);case 3:return i=t.sent,t.abrupt("return",(this.renderSilhouette(n,i,`blur(${this.radius}px)`),this.context.save(),this.context.filter="none",this.context.globalCompositeOperation="destination-over",this.context.drawImage(n,0,0,n.width,n.height),this.context.restore(),e.prototype.render.call(this,n,r)));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t}(kn),wn=function(e){function t(){return e.apply(this,arguments)||this}(0,a.default)(t,e);var n=t.prototype;return n.setBackgroundImage=function(e){this.backgroundImage=e},n.render=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.prototype.resizeCanvas.call(this,n),t.next=3,createImageBitmap(r);case 3:return i=t.sent,t.abrupt("return",(this.renderSilhouette(n,i),this.backgroundImage&&(this.context.save(),this.context.filter="none",this.context.globalCompositeOperation="destination-over",this.context.drawImage(this.backgroundImage,0,0,this.backgroundImage.width,this.backgroundImage.height,0,0,n.width,n.height),this.context.restore()),e.prototype.render.call(this,n,r)));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t}(kn);
|
|
23
|
+
*/function i(e,t){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}function o(e){return(void 0!==typeof window?window:global).Buffer&&"function"==typeof(void 0!==typeof window?window:global).Buffer.isBuffer?(void 0!==typeof window?window:global).Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var a=n(619),l=Object.prototype.hasOwnProperty,c=Array.prototype.slice,s="foo"===function(){}.name;function d(e){return Object.prototype.toString.call(e)}function u(e){return!o(e)&&("function"==typeof(void 0!==typeof window?window:global).ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var A=e.exports=U,h=/\s*function\s+([^\(\s]*)\s*/;function g(e){if(a.isFunction(e)){if(s)return e.name;var t=e.toString().match(h);return t&&t[1]}}function Q(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function F(e){if(s||!a.isFunction(e))return a.inspect(e);var t=g(e);return"[Function"+(t?": "+t:"")+"]"}function p(e,t,n,r,i){throw new A.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function U(e,t){e||p(e,!0,t,"==",A.ok)}function m(e,t,n,r){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(a.isDate(e)&&a.isDate(t))return e.getTime()===t.getTime();if(a.isRegExp(e)&&a.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(u(e)&&u(t)&&d(e)===d(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var l=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==l&&l===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(a.isPrimitive(e)||a.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=b(e),o=b(t);if(i&&!o||!i&&o)return!1;if(i)return e=c.call(e),t=c.call(t),m(e,t,n);var l,s,d=f(e),u=f(t);if(d.length!==u.length)return!1;for(d.sort(),u.sort(),s=d.length-1;s>=0;s--)if(d[s]!==u[s])return!1;for(s=d.length-1;s>=0;s--)if(l=d[s],!m(e[l],t[l],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function B(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function Z(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&p(i,n,"Missing expected exception"+r);var o="string"==typeof r,l=!e&&i&&!n;if((!e&&a.isError(i)&&o&&B(i,n)||l)&&p(i,n,"Got unwanted exception"+r),e&&i&&n&&!B(i,n)||!e&&i)throw i}A.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return Q(F(e.actual),128)+" "+e.operator+" "+Q(F(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||p;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=g(t),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(A.AssertionError,Error),A.fail=p,A.ok=U,A.equal=function(e,t,n){e!=t&&p(e,t,n,"==",A.equal)},A.notEqual=function(e,t,n){e==t&&p(e,t,n,"!=",A.notEqual)},A.deepEqual=function(e,t,n){m(e,t,!1)||p(e,t,n,"deepEqual",A.deepEqual)},A.deepStrictEqual=function(e,t,n){m(e,t,!0)||p(e,t,n,"deepStrictEqual",A.deepStrictEqual)},A.notDeepEqual=function(e,t,n){m(e,t,!1)&&p(e,t,n,"notDeepEqual",A.notDeepEqual)},A.notDeepStrictEqual=function e(t,n,r){m(t,n,!0)&&p(t,n,r,"notDeepStrictEqual",e)},A.strictEqual=function(e,t,n){e!==t&&p(e,t,n,"===",A.strictEqual)},A.notStrictEqual=function(e,t,n){e===t&&p(e,t,n,"!==",A.notStrictEqual)},A.throws=function(e,t,n){Z(!0,e,t,n)},A.doesNotThrow=function(e,t,n){Z(!1,e,t,n)},A.ifError=function(e){if(e)throw e},A.strict=r((function e(t,n){t||p(t,!0,n,"==",e)}),A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict;var f=Object.keys||function(e){var t=[];for(var n in e)l.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(3)),o=r(n(626)),a=r(n(290));t.default=e=>i.default.isElectron?"screen"===e||(0,a.default)(e):o.default.indexOf(e)>-1},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){this.id=e.id,this.type=e.type,this.active=(0,a.default)(e.active),this.orientation=e.orientation||l.ROTATED_NORMAL,e.frameRate&&(this.frameRate=parseFloat(e.frameRate));e.preferredFrameRate&&(this.preferredFrameRate=parseFloat(e.preferredFrameRate));e.preferredWidth&&(this.preferredWidth=parseInt(e.preferredWidth,10));e.preferredHeight&&(this.preferredHeight=parseInt(e.preferredHeight,10));this.width=parseInt(e.width,10),this.height=parseInt(e.height,10),this.source=e.source||"camera",this.fitMode=e.fitMode||"cover",(0,i.default)(this),this.update=function(e){const t={},n={};for(const r in e){if(!e.hasOwnProperty(r))continue;const i=this[r];switch(r){case"active":this.active=(0,a.default)(e[r]);break;case"disableWarning":this.disableWarning=(0,a.default)(e[r]);break;case"frameRate":this.frameRate=parseFloat(e[r],10);break;case"width":case"height":this[r]=parseInt(e[r],10),t[r]=this[r],n[r]=i;break;case"orientation":this[r]=e[r],t[r]=this[r],n[r]=i;break;case"fitMode":case"source":this[r]=e[r];break;case"sourceStreamId":break;default:return c.debug(`Tried to update unknown key ${r} on ${this.type} channel ${this.id}`),!1}this.trigger("update",this,r,i,this[r])}return Object.keys(t).length&&this.trigger("update",this,"videoDimensions",n,t),!0}};var i=r(n(7)),o=r(n(2)),a=r(n(293));const l=(0,r(n(155)).default)(),c=(0,o.default)("StreamChannel")},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e,t,n,r){if(!e.trigger)throw new Error("OT.StylableComponent is dependent on the eventing mixin. Ensure that this is included in the object before StylableComponent.");r=r||function(){};let i=!1;!1===n&&(t={buttonDisplayMode:"off",nameDisplayMode:"off",audioLevelDisplayMode:"off",videoDisabledDisplayMode:"off",audioBlockedDisplayMode:"off"},i=!0,r({showControls:!1}));const s=new a.default(t,(function(t,n,r){r?e.trigger("styleValueChanged",t,n,r):e.trigger("styleValueChanged",t,n)}));e.getStyle=function(e){return s.get(e)},e.setStyle=function(e,t,n){if(i)return c.warn("Calling setStyle() has no effect because theshowControls option was set to false"),this;let a;return"string"!=typeof e?a=e:(a={},a[e]=t),a.backgroundImageURI&&(a.backgroundImageURI=(0,o.default)(a.backgroundImageURI)),s.setAll(a,n),r((0,l.default)(a)),this}};var i=r(n(2)),o=r(n(634)),a=r(n(635)),l=r(n(294));const c=(0,i.default)("StylableComponent")},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(53)),o=r(n(2)),a=r(n(31)),l=r(n(54)),c=r(n(638)),s=r(n(639)),d=r(n(74)),u=r(n(159)),A=r(n(8)),h=r(n(640)),g=r(n(641)),Q=r(n(642));t.default=function(e){void 0===e&&(e={});const t=e.env||A.default.env,n=e.Modal||s.default,r=(e.createLogger||o.default)("systemRequirements"),F=l.default.once,p=new a.default,U=(0,i.default)(()=>{p.logEvent({action:"checkSystemRequirements",variation:"notHasRequirements",partnerId:d.default.value,payload:{userAgent:t.userAgent}})}),m=(0,i.default)(()=>{(0,h.default)()});let b=!1;const B=t.name,Z=t.version,f=t.isMobileDevice,R=(0,Q.default)(B,Z),I=R.isSupportedButOld,y=R.isBrowserAndVersionSupported;return{check(){r.debug("OT.checkSystemRequirements()");const e=Number(c.default&&F());return m(),e||U(),e},upgrade(e){let t=void 0===e?{}:e,i=t.isSupportedButOld,o=void 0===i?I():i,a=t.isBrowserAndVersionSupported,l=void 0===a?y():a;u.default.onLoad(()=>{if(r.warn("OT.upgradeSystemRequirements is deprecated."),b)return;const e=new n(g.default);b=!0,e.on("close",()=>{b=!1}),e.open();let t=f?"mobile-":"";t+=l?"supported-install":o?"upgrade-install":"unsupported-install",e.el("#section-"+t).style.display="block"})}}}},function(e,t,n){"use strict";(function(t){var r=n(0),i=r(n(24)),o=r(n(166));const a=n(646);let l=function(e){function t(t){var n;return(n=e.call(this,t)||this).name="TimeoutError",n}return(0,i.default)(t,e),t}((0,o.default)(Error));e.exports=(e,n,r)=>new t((t,i)=>{if("number"!=typeof n||n<0)throw new TypeError("Expected `ms` to be a positive number");const o=setTimeout(()=>{if("function"==typeof r){try{t(r())}catch(o){i(o)}return}const o=r instanceof Error?r:new l("string"==typeof r?r:`Promise timed out after ${n} milliseconds`);"function"==typeof e.cancel&&e.cancel(),i(o)},n);a(e.then(t,i),()=>{clearTimeout(o)})}),e.exports.TimeoutError=l}).call(this,n(1))},function(e,t,n){var r=n(643),i=n(296),o=n(644),a=n(645);function l(t){var n="function"==typeof Map?new Map:void 0;return e.exports=l=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},l(t)}e.exports=l},function(e,t,n){var r=n(12),i=n(647),o=n(251),a=Math.max,l=Math.min;e.exports=function(e,t,n){var c,s,d,u,A,h,g=0,Q=!1,F=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function U(t){var n=c,r=s;return c=s=void 0,g=t,u=e.apply(r,n)}function m(e){return g=e,A=setTimeout(B,t),Q?U(e):u}function b(e){var n=e-h;return void 0===h||n>=t||n<0||F&&e-g>=d}function B(){var e=i();if(b(e))return Z(e);A=setTimeout(B,function(e){var n=t-(e-h);return F?l(n,d-(e-g)):n}(e))}function Z(e){return A=void 0,p&&c?U(e):(c=s=void 0,u)}function f(){var e=i(),n=b(e);if(c=arguments,s=this,h=e,n){if(void 0===A)return m(h);if(F)return clearTimeout(A),A=setTimeout(B,t),U(h)}return void 0===A&&(A=setTimeout(B,t)),u}return t=o(t)||0,r(n)&&(Q=!!n.leading,d=(F="maxWait"in n)?a(o(n.maxWait)||0,t):d,p="trailing"in n?!!n.trailing:p),f.cancel=function(){void 0!==A&&clearTimeout(A),g=0,c=h=s=A=void 0},f.flush=function(){return void 0===A?u:Z(i())},f}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=function(){let e=[];return{add(t){e.push(t)},remove(t){const n=e.indexOf(t);n>=0&&e.splice(n,1)},releaseAll(){const t=[];for(;e.length>0;){const n=e.shift();try{n()}catch(e){t.push(e)}}const n=t.length;if(n>0)throw new Error(`Failed to complete ${n} cleanup job${1===n?"":"s"}: ${t.map(e=>`<${e}>`).join(", ")}`)},empty(){e=[]}}};t.default=r},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;const i=(0,r(n(2)).default)("applySdpTransform");t.default=(e,t,n,r,o)=>{const a=e[t][n],l=`${t} ${n}`,c=`sdpTransforms (${"local offer"===l||"remote answer"===l?"publisher":"subscriber"}): ${t} ${n}`,s="local"===t?"created":"received";i.debug(`${c}: ${s}:\n${o}`);const d=a(r,o);return d.local===o?i.debug(c+": not modified"):i.debug(`${c}: modified to:\n${d.local}`),d}},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(61));var o="function"==typeof(0,i.default)(void 0!==typeof window?window:global,"navigator.getDisplayMedia",(0,i.default)(void 0!==typeof window?window:global,"navigator.mediaDevices.getDisplayMedia"));t.default=o},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(){return function(e,t,n){const r=t.slice(),o=(0,i.default)(n);return function(t){let n=e,i=null;function a(e,r){t({message:e,newState:r,currentState:n,previousState:i})}function l(e){return t=e,-1===r.indexOf(t)?(a(`'${e}' is not a valid state`,e),!1):(l=e,!(!o[i=n]||-1===o[i].indexOf(l))||(a(`'${n}' cannot transition to '${e}'`,e),!1));var t,i,l}this.current=n,this.set=function(e){l(e)&&(i=n,this.current=e,n=e)}}}};var i=r(n(41))},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});const n=t.chromeExtensionHelper||(0,l.default)(),r=t.electronExtensionHelper||(0,c.default)(),A=t.Errors||a.default,h=t.firefoxExtensionHelper||s.default,g=t.getDisplayMediaExtensionHelper||d.default,Q=t.otError||(0,o.default)(),F=t.OTHelpers||u.default,p={extensionByKind:{},extensionClasses:{}};p.registerExtensionHelper=(e,t)=>{p.extensionClasses[e]=t,t.autoRegisters&&t.isSupportedInThisBrowser&&p.registerExtension(e)},p.registerExtension=function(e){if(null==p.extensionClasses[e])throw new Error("Unsupported kind passed to OT.registerScreenSharingExtension");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=p.extensionClasses[e].register(...n);p.extensionByKind[e]=i};const U=()=>{const e=(0,i.default)(Object.keys(p.extensionClasses).sort(e=>"electron"===e?-1:1),e=>p.extensionClasses[e].isSupportedInThisBrowser);return void 0===e?{}:{name:e,proto:p.extensionClasses[e],instance:p.extensionByKind[e]}};p.pickHelper=()=>U(),p.checkCapability=e=>{const t={supported:!1,extensionRequired:void 0,extensionRegistered:void 0,extensionInstalled:void 0,supportedSources:{}},n=U();if(void 0!==n.name){if(t.supported=!0,t.extensionRequired=n.proto.extensionRequired?n.name:void 0,t.supportedSources={screen:n.proto.sources.screen,application:n.proto.sources.application,window:n.proto.sources.window,browser:n.proto.sources.browser},!n.instance)return t.extensionRegistered=!1,t.extensionRequired&&(t.extensionInstalled=!1),void setTimeout(e.bind(null,t));t.extensionRegistered=!!t.extensionRequired||void 0,n.instance.isInstalled(n=>{t.extensionInstalled=t.extensionRequired||"Firefox"===F.env.name?n:void 0,e(t)})}else setTimeout(e.bind(null,t))},p.registerExtensionHelper("electron",r),p.registerExtensionHelper("getDisplayMedia",g),p.registerExtensionHelper("chrome",n),p.registerExtensionHelper("firefox",h);const m=()=>{};return p.getConstraints=t=>{const n=t.onAccessDialogOpened,r=void 0===n?m:n,i=t.onAccessDialogClosed,o=void 0===i?m:i,a=t.videoSource,l=t.constraints;return new e((e,t)=>{p.checkCapability(n=>{if(n.supported)if(!1===n.extensionRegistered)t(Q(A.SCREEN_SHARING_EXTENSION_NOT_REGISTERED,new Error("Screen Sharing support in this browser requires an extension, but one has not been registered.")));else if(n.extensionRequired&&!1===n.extensionInstalled)t(Q(A.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Screen Sharing support in this browser requires an extension, but the extension is not installed.")));else{const n=p.pickHelper();n.proto.getConstraintsShowsPermissionUI&&r(),n.instance.getConstraints(a,l,(r,i)=>{n.proto.getConstraintsShowsPermissionUI&&o(),r?t(r):e(i)})}else{let e="Screen Sharing is not supported in this browser";F.env.isElectron?e="Set the webPreferences.contextIsolation option of the Electron BrowserWindow to false or use a preload script to access the desktop capturer. For more information, see https://tokbox.com/developer/guides/screen-sharing/js/.":("Chrome"===F.env.name&&F.env.version>73||"Samsung"===F.env.name&&F.env.version>=14)&&"https:"!==(void 0!==typeof window?window:global).location.protocol&&(e="https:// is required for screen sharing"),t(Q(A.SCREEN_SHARING_NOT_SUPPORTED,new Error(e)))}})})},p};var i=r(n(77)),o=r(n(14)),a=r(n(6)),l=r(n(309)),c=r(n(687)),s=r(n(689)),d=r(n(316)),u=r(n(8))}).call(this,n(1))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.Errors||a.default,n=e.ExceptionCodes||i.default,r=e.otError||(0,o.default)(),l={ICEWorkflow:t.ICE_WORKFLOW_FAILED,NewPeerConnection:t.CREATE_PEER_CONNECTION_FAILED,SetRemoteDescription:t.SET_REMOTE_DESCRIPTION_FAILED,Subscribe:{404:t.STREAM_NOT_FOUND,[n.STREAM_LIMIT_EXCEEDED]:t.STREAM_LIMIT_EXCEEDED}};return function(e,i,o,a,c){const s=`${(o?o+": ":"")+c} PeerConnection with connection ${a} failed: ${i}`,d=l[o]||{},u="string"==typeof d?d:d[e],A="Publisher"===c?n.UNABLE_TO_PUBLISH:n.UNABLE_TO_SUBSCRIBE;if(!u){const e=new Error(s);return e.code=A,e}const h="ICEWorkflow"===o?"Publisher"===c?n.PUBLISHER_ICE_WORKFLOW_FAILED:n.SUBSCRIBER_ICE_WORKFLOW_FAILED:u===t.STREAM_LIMIT_EXCEEDED?n.STREAM_LIMIT_EXCEEDED:A;return r(u,new Error(s),h)}};var i=r(n(9)),o=r(n(14)),a=r(n(6))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=function(e){void 0===e&&(e={});const t=e.OTHelpers||i.default,n=(e.global||(void 0!==typeof window?window:global)).RTCPeerConnection;return function(e,r){"Firefox"===t.env.name&&n&&n.generateCertificate?n.generateCertificate({name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])}).catch(e=>{r(e)}).then(t=>{e.certificates=[t],r(void 0,e)}):setTimeout(()=>{r(void 0,e)})}};var i=r(n(8))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={bandwidthCriticalThreshold:7e4,bandwidthFairThreshold:0,packetLossCriticalThreshold:.15,packetLossCriticalThresholdMediumBw:.2,criticalCongestionPeriod:16e3};t.default=r},function(e,t,n){"use strict";t.__esModule=!0,t.parseStats=t.getVideoResolution=t.getVideoPacketStats=t.getVideoPacketLoss=t.getSelectedCandidatePairId=t.getBandwidth=t.getAudioPacketStats=t.getAudioPacketLoss=void 0;const r=(e,t)=>{const n=e.filter(e=>{let n=e.type,r=e.kind;return"outbound-rtp"===n&&r===t}),r=e.filter(e=>{let n=e.type,r=e.kind;return"remote-inbound-rtp"===n&&r===t}),i=r[0].timestamp,o=r[0].fractionLost,a=n.reduce((e,t)=>e+t.packetsSent,0),l=r.reduce((e,t)=>e+t.packetsLost,0);return{[t+"ReportTimestamp"]:i,[t+"PacketsSent"]:a,[t+"PacketsLost"]:l,[t+"FractionLost"]:o}},i=e=>e.filter(e=>{let t=e.type,n=e.kind;return"outbound-rtp"===t&&"video"===n}).filter(e=>void 0!==e.frameHeight&&void 0!==e.frameWidth).reduce((e,t)=>({width:Math.max(e.width,t.frameWidth),height:Math.max(e.height,t.frameHeight)}),{width:0,height:0});t.getVideoResolution=i;const o=e=>r(e,"audio");t.getAudioPacketStats=o;const a=e=>r(e,"video");t.getVideoPacketStats=a;const l=e=>{const t=e.find(e=>"transport"===e.type);return null==t?void 0:t.selectedCandidatePairId};t.getSelectedCandidatePairId=l;const c=e=>{const t=((e,t)=>{if(t){const n=e.find(e=>{let n=e.id,r=e.type;return n===t&&"candidate-pair"===r});return null==n?void 0:n.availableOutgoingBitrate}})(e,l(e));if(void 0!==t)return t;const n=e.find(e=>{let t=e.type,n=e.availableOutgoingBitrate;return"candidate-pair"===t&&void 0!==n});return null==n?void 0:n.availableOutgoingBitrate};t.getBandwidth=c;t.parseStats=e=>{const t=o(e),n=t.audioPacketsSent,r=t.audioPacketsLost,l=t.audioReportTimestamp,s=t.audioFractionLost,d=a(e),u=d.videoPacketsSent,A=d.videoPacketsLost,h=d.videoReportTimestamp;return{bandwidth:c(e),audioFractionLost:s,audioReportTimestamp:l,audioPacketsSent:n,audioPacketsLost:r,videoReportTimestamp:h,videoPacketsSent:u,videoPacketsLost:A,videoResolution:i(e)}};const s=(e,t,n)=>{const r=t[e+"PacketsSent"]-n[e+"PacketsSent"],i=t[e+"PacketsLost"]-n[e+"PacketsLost"];return o=i,0===(a=r)?0:o/a;var o,a};t.getAudioPacketLoss=(e,t)=>s("audio",e,t);t.getVideoPacketLoss=(e,t)=>s("video",e,t)},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(51)),o=r(n(708)),a=r(n(12)),l=r(n(58)),c=r(n(305)),s=n(176);function d(e,t){if(!t)return{};const n=t.filter(t=>t.id===e.mediaTrackId);return n.length?n[0]:{}}function u(e,t){return"packetsLost"in t?e+t.packetsLost:e}const A=["packetsSent","packetsLost","bytesSent"],h=e=>(0,i.default)(e,A),g=["packetsReceived","packetsLost","bytesReceived"],Q=e=>(0,i.default)(e,g),F=A.concat(["framerateMean","googFrameRateSent","googFrameRateReceived","googFrameRateInput","googFrameRateOutput","framesEncoded","framesDecoded"]);function p(e,t,n,r){const i=(n-r)/1e3,o=e-t;return i>0?Math.round(8*o/i):0}var U=()=>{const e={};function t(t,n){let r=function(e){return Number(e.framesPerSecond||e.framerateMean||e.googFrameRateSent||e.googFrameRateReceived||e.googFrameRateInput||e.googFrameRateOutput||0)}(t);if(r)return r;const i=function(e){return Number(e.framesEncoded||e.framesDecoded)}(t);if(!i)return;const o=e[t.id]?e[t.id].frames:0,a=e[t.id]?e[t.id].timestamp:n;return r=(0,c.default)({currentStatFrames:i,currentTimestamp:t.timestamp,prevStatFrames:o,prevTimestamp:a}),e[t.id]={frames:i,timestamp:t.timestamp},r}function n(n,r,i){const o=i?"bytesSent":"bytesReceived",a=i?"headerBytesSent":"headerBytesReceived",l=e[n.id]||{timestamp:r,bytes:0,headerBytes:0},c=l.timestamp,s=l.bytes,d=l.headerBytes,u=l.frameRate,A=l.bitrate,h=l.totalBitrate;if(c===n.timestamp)return{frameRate:u,bitrate:A,totalBitrate:h};const g=t(n,r),Q=p(n[o],s,n.timestamp,c),F=p(n[o]+n[a],s+d,n.timestamp,c);return e[n.id]=Object.assign({},e[n.id],{bytes:n[o],headerBytes:n[a],timestamp:n.timestamp,frameRate:g,bitrate:Q,totalBitrate:F}),{frameRate:g,bitrate:Q,totalBitrate:F}}const r={isVideoStat:(e,t)=>"video"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"video"===e.mediaType||"googFrameWidthReceived"in e||"googFrameWidthInput"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Video")||"inboundrtp"===e.type&&0!==d(e,t).frameWidth,isAudioStat:(e,t)=>"audio"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"audio"===e.mediaType||"audioInputLevel"in e||"audioOutputLevel"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Audio")||"inboundrtp"===e.type&&0===d(e,t).frameWidth,isInboundStat:e=>"bytesReceived"in e||"packetsReceived"in e,isOutboundStat:e=>"bytesSent"in e||"packetsSent"in e,isVideoTrackStat:e=>"track"===e.type&&(e.frameHeight>0||e.frameWidth>0||e.framesCorrupted>0||e.framesDecoded>0||e.framesPerSecond>0||e.framesSent>0||e.framesReceived>0),isVideoRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"video"===e.kind,isAudioRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"audio"===e.kind,isVideoInboundRtpStat:e=>"inbound-rtp"===e.type&&"video"===e.kind,parseStatCategory(e,t,i){void 0===t&&(t=r.isVideoStat(e));const o={packetsLost:0,packetsReceived:0,bytesReceived:0};if("packetsReceived"in e&&(o.packetsReceived=parseInt(e.packetsReceived,10)),"packetsLost"in e&&(o.packetsLost=parseInt(e.packetsLost,10)),"bytesReceived"in e&&(o.bytesReceived=parseInt(e.bytesReceived,10)),t){if(o.width=e.frameWidth,o.height=e.frameHeight,i){var a;const t=null==(a=i.filter(e=>"codec"===e.type&&e.mimeType.includes("video")).find(t=>t.id===e.codecId))?void 0:a.mimeType.split("/")[1];t&&(o.codec=t)}void 0!==e.pauseCount&&(o.pauseCount=e.pauseCount),void 0!==e.freezeCount&&(o.freezeCount=e.freezeCount),void 0!==e.totalPausesDuration&&(o.totalPausesDuration=1e3*e.totalPausesDuration),void 0!==e.totalFreezesDuration&&(o.totalFreezesDuration=1e3*e.totalFreezesDuration);const t=n(e,Date.now(),!1);t&&(o.frameRate=t.frameRate,o.decodedFrameRate=t.frameRate,o.bitrate=t.bitrate,o.totalBitrate=t.totalBitrate)}return o},getVideoPacketsLost:e=>e.filter(t=>r.isVideoRemoteInboundRtpStat(t,e)).reduce(u,0),getAudioPacketsLost:e=>e.filter(t=>r.isAudioRemoteInboundRtpStat(t,e)).reduce(u,0),normalizeTimestamp:(e,t)=>(void 0===t&&(t=Date.now()),(0,a.default)(e)&&"getTime"in e?e.getTime():Math.abs(e/(1e3*t)-1)<.05?e/1e3:e),normalizeStats:(0,l.default)((function(i,a,l){void 0===a&&(a=!0);const c=i.filter(e=>r.isVideoStat(e,i)&&r.isInboundStat(e)===a),d=i.find(e=>r.isAudioStat(e,i)&&r.isInboundStat(e)===a),u=c[0];if(!d&&!u)throw new Error("could not find stats for either audio or video");const A=r.normalizeTimestamp(u?u.timestamp:d.timestamp),g={timestamp:A};u&&!a&&void 0===u.packetsLost&&(u.packetsLost=r.getVideoPacketsLost(i)),d&&!a&&void 0===d.packetsLost&&(d.packetsLost=r.getAudioPacketsLost(i));const p=a?Q:h;if(c&&c.length>0){const d=((e,t,n)=>{const r={timestamp:t,id:n};return F.forEach(t=>{r[t]=e.reduce((e,n)=>e+Number(n[t]||0),0)}),r})(c,A,"acc"+u.id);if(g.video=Object.assign({frameRate:t(d,l)},(0,o.default)(p(d),Number)),!a){const t=i.filter(e=>"codec"===e.type&&e.mimeType.includes("video"));g.video.layers=c.filter(e=>!r.isVideoRemoteInboundRtpStat(e)).map(e=>{var r;const i=n(e,l,!0),o=i.frameRate,a=i.bitrate,c=i.totalBitrate,s={width:e.frameWidth,height:e.frameHeight,codec:null==(r=t.find(t=>t.id===e.codecId))?void 0:r.mimeType.split("/")[1],encodedFrameRate:o,bitrate:a,totalBitrate:c,scalabilityMode:e.scalabilityMode};return e.qualityLimitationReason&&"none"!==e.qualityLimitationReason&&(s.qualityLimitationReason=e.qualityLimitationReason),s}).sort((e,t)=>{const n=(e.width||0)*(e.height||0);return(t.width||0)*(t.height||0)-n}),e["acc"+u.id]=Object.assign({},e["acc"+u.id],{layers:g.video.layers.length}),g.transportStats={connectionEstimatedBandwidth:(0,s.getBandwidth)(i)}}}return d&&(g.audio=(0,o.default)(p(d),Number)),g}))};return r};t.default=U},function(e,t,n){"use strict";(function(e){t.__esModule=!0,t.default=function(t){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return new e((e,n)=>{t(...r,(function(t){if(t)n(t);else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];1!==i.length?e(i):e(i[0])}}))})}}}).call(this,n(1))},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5)),a=r(n(26)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=I(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(115)),c=r(n(7)),s=r(n(2)),d=r(n(60)),u=r(n(3)),A=r(n(718)),h=r(n(719)),g=r(n(8)),Q=r(n(110)),F=r(n(720)),p=r(n(721)),U=r(n(722)),m=r(n(723)),b=r(n(725)),B=r(n(180)),Z=n(333),f=r(n(181)),R=r(n(275));function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(I=function(e){return e?n:t})(e)}const y=f.default.VIDEO_BUFFER_TIMEOUT,V=f.default.VIDEO_LOADING_TIMEOUT,C=(0,s.default)("WidgetView");(0,Q.default)();var W=function(e){let t=void 0===e?{}:e,n=t.logging,r=void 0===n?C:n,s=t.OTHelpers,f=void 0===s?g.default:s,I=t.waitForVideoToBePlaying,W=void 0===I?m.default:I,E=t.VideoElementFacade,S=void 0===E?(0,Q.default)():E,v=t.env,J=void 0===v?u.default:v;const N=(0,h.default)({window:void 0!==typeof window?window:global}),G=e=>{if(e.isCanceled())throw r.debug("bindVideo bailing due to cancellation"),new l.CancellationError("CANCEL")};return function(){function e(e,t){let n=void 0===t?{}:t,i=n.insertDefaultUI,o=void 0===i||i,a=n.width,l=void 0===a?264:a,s=n.height,u=void 0===s?198:s,h=n.fitMode,g=void 0===h?"cover":h,Q=n.mirror,F=void 0!==Q&&Q,m=n.insertMode,b=n.classNames,B=n.style,Z=n.widgetType,R=n.initials;this._videoElementFacade=void 0,this._container=void 0,this._posterContainer=document.createElement("div"),this._widgetContainer=document.createElement("div"),this._loading=!0,this._audioOnly=!1,this._showPoster=void 0,this._poster=void 0,this._cancelBind=void 0,(0,c.default)(this),!1===/^(contain|cover)$/.test(g)&&r.warn(`Invalid fit value "${g}" passed. Only "contain" and "cover" can be used.`),this._widgetType=Z,this._fitMode=g,this._insertDefaultUI=o;const I=(0,d.default)(this._widgetContainer);if(I.on("click",this.userGesture.bind(this)),I.on("touchstart",this.userGesture.bind(this),!!N&&{passive:!0}),this.once("destroy",()=>I.removeAll()),this._widgetContainer.classList.add("OT_widget-container"),this._widgetContainer.style.width="100%",this._widgetContainer.style.height="100%",!1!==o){this._container=(0,p.default)(e,m),J.isSafari&&J.isiOS&&J.iOSVersion&&J.iOSVersion<11.2&&this._container.classList.add("OT_ForceContain"),this._container.style.width=(0,A.default)(l),this._container.style.height=(0,A.default)(u),this._container.style.overflow="hidden",(0,U.default)(this._container),F&&f.addClass(this._container,"OT_mirrored"),b&&b.trim().split(/\s+/).forEach(e=>this._container.classList.add(e)),this._container.classList.add("OT_loading"),this._container.classList.add("OT_fit-mode-"+g),this._container.appendChild(this._widgetContainer);const t=f(this._container).observeSize(()=>(0,U.default)(this._container))[0],n=f.observeNodeOrChildNodeRemoval(this._container,e=>{if(!this._videoElementFacade)return;e.some(e=>e===this._widgetContainer||e===this._videoElementFacade.domElement())&&this.destroyVideo()});this.once("destroy",()=>{r.debug("disconnecting observers"),t.disconnect(),n.disconnect()})}this._posterContainer.classList.add("OT_video-poster"),this._widgetContainer.appendChild(this._posterContainer);const y=document.createElement("div");y.classList.add("OT_video-loading");const V=document.createElement("div");V.classList.add("OT_video-loading-spinner"),y.appendChild(V),this._widgetContainer.appendChild(y);B&&B.backgroundImageURI?this.setBackgroundImageURI(B.backgroundImageURI):R&&this.setInitials(R)}var t=e.prototype;return t.addError=function(e,t,n){var r;if(this._container&&(this._container.innerHTML=`<p>${e}${t?` <span class="ot-help-message">${t}</span>`:""}</p>`,f.addClass(this._container,n||"OT_subscriber_error"),(null==(r=this._container.querySelector("p"))?void 0:r.offsetHeight)>this._container.offsetHeight)){const e=this._container.querySelector("span");e&&(e.style.display="none")}},t.destroy=function(){this.emit("destroy"),this.destroyVideo(),this._container&&(f.removeElement(this._container),this._container=null)},t.setBackgroundImageURI=function(e){e?(f.css(this._posterContainer,"backgroundImage",`url(${e})`),f.css(this._posterContainer,"backgroundSize","contain"),f.css(this._posterContainer,"opacity","1.0")):this._lastInitials?this.setInitials(this._lastInitials):(f.css(this._posterContainer,"backgroundImage",null),f.css(this._posterContainer,"backgroundSize",null),f.css(this._posterContainer,"opacity",null))},t.setInitials=function(e){const t=(0,F.default)(e),n=(new XMLSerializer).serializeToString(t);f.css(this._posterContainer,"backgroundImage",`url('data:image/svg+xml,${n}')`),f.css(this._posterContainer,"backgroundSize","auto 55%"),f.css(this._posterContainer,"opacity","1.0"),this._lastInitials=e},t.isAudioBlocked=function(){return Boolean(this._videoElementFacade&&this._videoElementFacade.isAudioBlocked())},t.unblockAudio=function(){return this._videoElementFacade.unblockAudio()},t.userGesture=function(){this.isAudioBlocked()&&(0,B.default)().then(()=>r.debug("Successfully unblocked audio"),e=>r.error("Error retrying audio on user interaction:",e))},t.setAudioBlockedUi=function(e){this._container&&(e?this._container.classList.add("OT_container-audio-blocked"):this._container.classList.remove("OT_container-audio-blocked"))},t.rebindSrcObject=function(){this._videoElementFacade&&this._videoElementFacade._rebindSrcObject()},t.pauseAndPlayVideoElement=function(){this._videoElementFacade&&this._videoElementFacade._pauseAndPlay()},t._loadVideoBuffer=function(){var e=(0,o.default)(i.default.mark((function e(t,n,r,o){var a,l,c,s,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===o&&(o={}),l=null!=(a=o.createElement)?a:R.default,c=!1,(s=l()).srcObject=t,e.prev=5,J.isChromium&&(t.getVideoTracks()[0].enabled=!0),d=s.play(),e.next=10,W({defaultVideoElementFacade:s,maxWaitTime:n,isBufferedStream:r});case 10:return c=e.sent,e.next=13,d;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),J.isChromium&&t.getVideoTracks().length&&(t.getVideoTracks()[0].enabled=!1);case 18:return s.srcObject=null,s.remove(),e.abrupt("return",c);case 21:case"end":return e.stop()}}),e,null,[[5,15]])})));return function(t,n,r,i){return e.apply(this,arguments)}}(),t._emitBindEvent=function(e,t,n){this.emit("bindEvent",e,t,n)},t._createVideoElementFacade=function(e){let t=e._inject,n=e.audioVolume,i=e.fallbackText,o=e.muted;this._videoElementFacade=new S({defaultAudioVolume:parseFloat(n),fallbackText:i,fitMode:this._fitMode,_inject:t,muted:o,widgetType:this._widgetType});const a=(0,d.default)(this._videoElementFacade);if(this._videoFacadeEvents=a,a.on("error",()=>{this.trigger("error")}),a.on("videoDimensionsChanged",(e,t)=>{this.trigger("videoDimensionsChanged",e,t)}),a.on("mediaStopped",e=>{this.trigger("mediaStopped",e)}),a.on("audioBlocked",()=>this.trigger("audioBlocked")),a.on("audioUnblocked",()=>this.trigger("audioUnblocked")),this._videoElementFacade.audioChannelType("telephony"),r.debug("Appending the video facade"),this._videoElementFacade.appendTo(this._widgetContainer),void 0!==n)try{this._videoElementFacade.setAudioVolume(n)}catch(e){r.warn("bindVideo "+e)}},t._bindToStream=function(){var e=(0,o.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._videoElementFacade.bindToStream(t);case 3:e.next=14;break;case 5:if(e.prev=5,e.t0=e.catch(0),!n.isCanceled()){e.next=12;break}throw r.debug("Refusing to destroyVideo as bindVideo was cancelled"),new l.CancellationError("CANCEL");case 12:throw this.destroyVideo(),e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),t._getNewBindCancellation=function(){this._cancelBind&&(r.debug("Cancelling last bindVideo request"),this._cancelBind.cancel());const e=new l.default;return this._cancelBind=e,this.once("destroy",()=>e.cancel()),e},t._triggerVideoElementCreated=function(){const e=e=>{this.trigger("videoElementCreated",e),this._insertDefaultUI&&f.addClass(e,"OT_video-element")};this._videoElementFacade.domElement()?e(this._videoElementFacade.domElement()):this._videoFacadeEvents.on("videoElementCreated",t=>{e(t)})},t._waitForVideoResolution=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.audioOnly()||!(t.getVideoTracks().length>0)){e.next=5;break}return r.debug("Waiting for correct resolution"),e.next=4,(0,b.default)(this._videoElementFacade,5e3);case 4:r.debug(`Resolution: ${this._videoElementFacade.videoWidth()}x${this._videoElementFacade.videoHeight()}`);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t._tryToLoadVideoBuffer=function(){var e=(0,o.default)(i.default.mark((function e(t,n,r,o){var a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:G(n),this._emitBindEvent("loadVideoBuffer","Attempt"),a=n.onCancel(()=>this._emitBindEvent("loadVideoBuffer","Cancel")),l=Math.ceil(V/y),c=!1;case 5:if(c||!l){e.next=13;break}return e.next=8,this._loadVideoBuffer(t,y,o);case 8:c=e.sent,G(n),l--,e.next=5;break;case 13:if(a(),c){e.next=20;break}if(this._emitBindEvent("loadVideoBuffer","Failure"),!r){e.next=19;break}throw(0,Z.createAmrVideoBufferError)();case 19:return e.abrupt("return");case 20:this._emitBindEvent("loadVideoBuffer","Success"),this._videoFacadeEvents.on("bindEvent",(e,t,n)=>{this._emitBindEvent(e,t,n)});case 22:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),t.bindVideo=function(){var e=(0,o.default)(i.default.mark((function e(t,n,o){var a,l,c,s,d,u,A,h,g;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.audioVolume,l=n.muted,c=n.fallbackText,s=n.hasVideo,d=n.isSubscribingToVideo,u=n._inject,void 0===o&&(o=!1),r.debug("bindVideo ",{webRTCStream:t}),A=!!this._videoElementFacade,h=this._getNewBindCancellation(),A||this._createVideoElementFacade({_inject:u,audioVolume:a,fallbackText:c,muted:l}),!(t instanceof MediaStream&&s&&d)){e.next=9;break}return e.next=9,this._tryToLoadVideoBuffer(t,h,o,s&&d);case 9:return e.next=11,this._bindToStream(t,h);case 11:return A||this._triggerVideoElementCreated(),G(h),g=W({defaultVideoElementFacade:this._videoElementFacade,maxWaitTime:5e3}),e.next=16,this._waitForVideoResolution(t);case 16:return r.debug("Waiting for video to be playing"),e.next=19,g;case 19:r.debug("Video is playing"),G(h);case 21:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.bindAudioTrackOnly=function(){this._videoElementFacade&&this._videoElementFacade.bindAudioTrackOnly()},t.destroyVideo=function(){this._videoElementFacade&&(this._videoElementFacade.destroy(),this._videoElementFacade=null)},t.video=function(){return this._videoElementFacade},t.showPoster=function(e){return void 0===e?!f.isDisplayNone(this._posterContainer):(this._showPoster=e,f[e?"show":"hide"](this._posterContainer),this.showPoster())},t.poster=function(e){return void 0===e?f.css(this._posterContainer,"backgroundImage"):(this._poster=e,f.css(this._posterContainer,"backgroundImage",`url(${e})`),this.poster())},t.prepareForStreamTransition=function(){var e;null==(e=this._videoElementFacade)||e.prepareForStreamTransition()},t.loading=function(e){return void 0===e?this._loading:(this._loading=Boolean(e),this._container&&this._container.classList[e?"add":"remove"]("OT_loading"),this.loading())},t.audioOnly=function(e){return void 0===e?this._audioOnly:(this._audioOnly=e,this._container&&this._container.classList[e?"add":"remove"]("OT_audio-only"),this.audioOnly())},t.domId=function(){return this._container&&this._container.getAttribute("id")},t.setSinkId=function(e){if(this._videoElementFacade)return this._videoElementFacade.setSinkId(e)},(0,a.default)(e,[{key:"domElement",get:function(){return this._container}},{key:"videoElement",get:function(){return this._videoElementFacade&&this._videoElementFacade.domElement()||void 0}},{key:"width",get:function(){return this.videoElement&&this.videoElement.offsetWidth}},{key:"height",get:function(){return this.videoElement&&this.videoElement.offsetHeight}}]),e}()};t.default=W},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(27));t.default=()=>e.all(i.default.subscribers.where().map(e=>{if(e.isAudioBlocked())return e._.unblockAudio()}))}).call(this,n(1))},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r={KEEP_SENDING_MEDIA_AFTER_TRANSITIONED:5e3,VIDEO_LOADING_TIMEOUT:5e3,TRANSITION_TIMEOUT:6e3,KEEP_SENDING_MEDIA_TO_KEEP_ALIVE:3e3,KEEP_SENDING_RTCP_DELAY:3e4,VIDEO_BUFFER_TIMEOUT:2e3};t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,i=n(731),o=(r=i)&&r.__esModule?r:{default:r};function a(e){return"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return a(e)?(0,o.default)(e):e},t.isAsync=a,t.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},t.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default=e=>"P2P"===e?"RELAYED":"ROUTED"},function(e,t,n){"use strict";var r=n(0);t.__esModule=!0,t.default=void 0;var i=r(n(4)),o=r(n(5));const a=(0,r(n(2)).default)("MediaProcessorConnector");let l=function(e){var t=this;this.setTrack=function(){var e=(0,o.default)(i.default.mark((function e(n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,t.connector.setTrack(n);case 4:r=e.sent,t.originalTrack=n,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),a.error("Error setting track: "+e.t0);case 11:return e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this.destroy=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.connector.destroy();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),a.warn("Error destroying connector: "+e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))),this.stopOriginalTrack=()=>{this.originalTrack&&(this.originalTrack.stop(),this.originalTrack=null)},this.connector=e};l.isValidConnector=e=>"function"==typeof(null==e?void 0:e.setTrack)&&"function"==typeof(null==e?void 0:e.destroy);var c=l;t.default=c},function(e,t,n){"use strict";(function(e){var r=n(0);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});let n=t,r=(0,l.default)({},((0,a.default)(n),n));["processPubOptions"].forEach(e=>{(0,p.default)(r[e],e+" dependency must be injected into Publisher")});const z=r.AnalyticsHelper||k.default,Xe=r.createAudioFallbackCoordinator||R.default,De=r.calculateCapableSimulcastStreams||ee.default,xe=r.createChromeMixin||(0,te.default)(),Me=r.deviceHelpers||(0,W.default)(),He=r.EnvironmentLoader||ne.default,Ke=r.Errors||M.default,Le=r.Events||(0,re.default)(),ze=r.ExceptionCodes||v.default,Oe=r.interpretPeerConnectionError||(0,ie.default)(),je=r.IntervalRunner||S.default,Pe=r.logging||(0,y.default)("Publisher"),_e=r.Microphone||(0,oe.default)(),qe=r.otError||(0,D.default)(),$e=r.OTErrorClass||J.default,et=r.OTHelpers||ae.default,tt=r.parseIceServers||le.parseIceServers,nt=r.PUBLISH_MAX_DELAY||ce.default,rt=r.PublisherPeerConnection||(0,se.default)(),it=r.PublishingState||(0,ue.default)(),ot=r.StreamChannel||Ae.default,at=r.systemRequirementsFactory||he.default,lt=r.VideoOrientation||(0,G.default)(),ct=r.WidgetView||ke,st=r.global||(void 0!==typeof window?window:global),dt=r.createSendMethod||ge.default,ut=r.MediaProcessor||Qe.default,At=Fe.default,ht=r.createVonageNoiseSuppression||B.createVonageNoiseSuppression,gt=r.setScalabilityMode||Ce.default,Qt=r.addAudioInputDevicesChangeListenerFactory||me.default,Ft=r.shouldLogMediaProcessorEvents||pe.default,pt=r.processPubOptions,Ut=r.publisherSenderStats||Ue.default,mt=Object.assign({},Re.default,r.AMRStateDurations),bt=mt.KEEP_SENDING_MEDIA_AFTER_TRANSITIONED,Bt=mt.KEEP_SENDING_MEDIA_TO_KEEP_ALIVE,Zt=mt.KEEP_SENDING_RTCP_DELAY;return function(t){var n=this;void 0===t&&(t={});let r=(0,I.default)({});const a=new m.default,l=(0,Ze.default)(),p=e=>a.get(e);(0,I.default)(this);const B=(0,K.default)(),R=(0,K.default)();let y=new z;const W=at();let S,v,J,G,k,D,M,ee,te,ne,re,ie;W.check()||W.upgrade();let oe,ae,le,ce,se,ue=!1;const Ae={},he={};let ge;let Qe,Fe,pe,Ue,me,Re,Ce,ke,mt,ft,Rt,It,yt=!1;const Vt=!0===t.publishSenderStats,Ct=()=>this.session||It||{isConnected:()=>!1},Wt=()=>this.streamId||"",Et=[],St=new ut,vt=new be.default;function Jt(){var e,t,n;return{connectionId:null!=(e=Ct())&&e.isConnected()?null==(t=Ct())||null==(n=t.connection)?void 0:n.connectionId:null,streamId:Wt(),widgetType:"Publisher"}}this.once("publishComplete",e=>{var t,n;e||(ue=!0,oe=oe||null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.p2pEnabled?"P2P":"MANTIS")}),this.on("sourceStreamIdChanged",e=>{oe=e,l.completeTransitionTo(oe)}),this.on("audioAcquisitionProblem",e=>{let t=e.method;nn("publisher:audioAcquisitionProblem","Event",{didPublishComplete:ue,method:t})});const Nt=e=>{const t=Object.keys(Ke).map(e=>Ke[e]),n=qe(t.indexOf(e.name)>-1?e.name:Ke.MEDIA_ERR_ABORTED,e,ze.UNABLE_TO_PUBLISH);Pe.error(`onStreamAvailableError ${n.name}: ${n.message}`),k.set("Failed"),S&&(S.destroy(),S=null);const r={failureReason:"GetUserMedia",failureCode:ze.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to access camera/mic: "+n.message};on("Failure",{},r),$e.handleJsException({error:n,errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:y}),this.trigger("publishComplete",n)},Gt=e=>{const t=(0,d.default)(e);t.code=ze.UNABLE_TO_PUBLISH,Pe.error("OT.Publisher.onScreenSharingError "+t.message),k.set("Failed"),t.message="Screensharing: "+t.message,this.trigger("publishComplete",t),on("Failure",{},{failureReason:"ScreenSharing",failureMessage:t.message}),S&&(S.destroy(),S=null)},Xt=e=>{const t=(0,d.default)(e);let n;try{n=window.self!==window.top}catch(e){}"https:"!==et.env.protocol&&(zt?t.message+=" Note: https:// is required for screen sharing.":(0,w.default)()&&"localhost"!==et.env.hostName&&(t.message+=` Note: ${et.env.name} requires HTTPS for camera and microphone access.`)),n&&!zt&&(t.message+=" Note: Check that the iframe has the allow attribute for camera and microphone"),Pe.error(t.message),k.set("Failed"),t.message="OT.Publisher Access Denied: Permission Denied: "+t.message,t.code=ze.UNABLE_TO_PUBLISH,S&&(S.destroy(),S=null),on("Cancel",{reason:"AccessDenied"}),this.trigger("publishComplete",t),this.dispatchEvent((0,Je.default)("device","while initializing"))},kt=e=>{e instanceof Error||/^\[object .*Error\]$/.test(Object.prototype.toString.call(e))||(e=new Error("Unknown error has occurred. Stream is not available."));throw e.name===Ke.USER_MEDIA_ACCESS_DENIED||e.name===Ke.NOT_SUPPORTED&&e.originalMessage.match(/Only secure origins/)?Xt(e):pt.isScreenSharing?Gt(e):Nt(e),e},Tt=()=>{nn("accessDialog","Opened"),this.dispatchEvent(new H.default(X.default.ACCESS_DIALOG_OPENED,!0))},Yt=()=>{nn("accessDialog","Closed"),this.dispatchEvent(new H.default(X.default.ACCESS_DIALOG_CLOSED,!1))},wt=(0,U.default)(),Dt={};let xt=!1,Mt={},Ht=!1,Kt=pt(t,"OT.Publisher",()=>k&&k.isDestroyed());Kt.on({accessDialogOpened:Tt,accessDialogClosed:Yt});const Lt=Kt,zt=Lt.isScreenSharing,Ot=Lt.isCustomAudioTrack,jt=Lt.isCustomVideoTrack,Pt=Lt.shouldAllowAudio,_t=Lt.properties,qt=Lt.getUserMedia;function $t(e){e.forEach(e=>e())}Object.defineProperty(this,"loudness",{writable:!1,value:void 0,configurable:!0});const en=(e,t,n)=>e.addEventListener?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{};(function(){const e=[];r.on("streamDestroy",()=>$t(e)),r.on("streamChange",()=>{$t(e);const t=v.getAudioTracks().map(e=>en(e,"ended",()=>{Ht=!0,this.trigger("audioAcquisitionProblem",{method:"trackEndedEvent"})}));e.splice(0,e.length,...t)})}).call(this),function(){const e=[];r.on("streamDestroy",()=>$t(e)),r.on("streamChange",()=>{$t(e),tn()||v.getTracks().forEach(t=>{t.addEventListener&&(e.push(en(t,"mute",()=>{Hn()})),e.push(en(t,"unmute",e=>{var t;C.default.isIosWebView&&"video"===e.target.kind&&(null==(t=S)||t.rebindSrcObject());Hn()})))})})}();const tn=()=>{if(zt)return!0;const e=["text","detail"].includes(_t.videoContentHint);return jt&&e},nn=t.logAnalyticsEvent||((e,t,n,r,i)=>{let o=(0,s.default)({action:e,variation:t,payload:n},Jt(),r);"Failure"===t&&(o=(0,s.default)(Mt,o)),Mt=(0,h.default)(o,"sessionId","connectionId","partnerId"),y.logEvent(o,i)}),rn=()=>{if(!Ft(this.session))return void St.disableLogging();const e=this.session.apiKey;St.enableLogging(e)},on=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"Non-fatal"!==n.failureReason)if("Attempt"===e&&(M=(new Date).getTime(),Rt&&(Rt.stop(),Pe.error("_connectivityAttemptPinger should have been cleaned up")),Rt=new je(()=>{nn("Publish","Attempting",t,Object.assign({},Jt(),n))},.2,6)),"Failure"===e||"Success"===e||"Cancel"===e)Rt?(Rt.stop(),Rt=void 0):Pe.warn(`Received connectivity event: "${e}" without "Attempt"`),nn("Publish",e,Object.assign({videoInputDevices:te,audioInputDevices:ee,videoInputDeviceCount:te?te.length:void 0,audioInputDeviceCount:ee?ee.length:void 0,selectedVideoInputDeviceId:ne,selectedAudioInputDeviceId:re},t),Object.assign({attemptDuration:(new Date).getTime()-M},n));else if("Attempt"===e){let r="default";_t.preferredVideoCodecs&&(r="automatic"===_t.preferredVideoCodecs?"automatic":_t.preferredVideoCodecs.join(",").toUpperCase()),nn("Publish",e,t,Object.assign({},n,{preferredVideoCodecs:r}))}else nn("Publish",e,t,n)},an=(e,t)=>{nn("ICERestart",e,t)},ln=(e,t,n)=>{"Attempt"===t?(Ae[e]=(new Date).getTime(),nn(e,t,n)):"Failure"!==t&&"Success"!==t||nn(e,t,n,{attemptDuration:(new Date).getTime()-Ae[e]})},cn=function(e,t){void 0===t&&(t={}),ln("RoutedToRelayedTransition",e,t)},sn=function(e,t){void 0===t&&(t={}),ln("RelayedToRoutedTransition",e,t)},dn=(0,g.default)(()=>{nn("GetStats","Called")}),un=(0,g.default)(()=>{nn("GetRtcStatsReport","Called")}),An=e=>{var n,r,i,o;let a=e.parsedStats,l=e.simulcastEnabled,c=e.remoteConnectionId,d=e.peerId,u=e.sourceStreamId;const h={peerId:d,widgetType:"Publisher",connectionId:null!=(n=this.session)&&n.isConnected()?null==(r=this.session)||null==(i=r.connection)?void 0:i.connectionId:null,streamId:this.streamId,width:S.width,height:S.height,audioTrack:v&&v.getAudioTracks().length>0,hasAudio:Mn(),publishAudio:_t.publishAudio,videoTrack:v&&v.getVideoTracks().length>0,hasVideo:xn(),publishVideo:_t.publishVideo,publishSenderStats:Vt,audioSource:Ot?"Custom":void 0,duration:J?Math.round((Date.now()-J)/1e3):0,remoteConnectionId:c,scalableVideo:l,sourceStreamId:(0,$.default)(u),publisherAudioFallbackEnabled:(null==(o=_t.audioFallback)?void 0:o.publisher)||!1,cpuPerformanceState:this.session._.getCpuPerformanceState()};let g=(zt&&jt?"Screen":zt&&t.videoSource)||jt&&"Custom"||_t.constraints.video&&"Camera"||null;(0,A.default)(g)&&(g=(0,Q.default)(g)),h.videoSource=g;const F={videoWidth:this.videoWidth(),videoHeight:this.videoHeight()},p=(0,s.default)({},h,F,a);y.logQOS(p),this.trigger("qos",p)},hn=()=>{var e,t;let n=(null==(e=_t.videoDimensions)?void 0:e.width)||Ye,r=(null==(t=_t.videoDimensions)?void 0:t.height)||we;if(_t.publishVideo){var i;const e=null==(i=S)?void 0:i.video();n=(null==e?void 0:e.videoWidth())||n,r=(null==e?void 0:e.videoHeight())||r}return{width:n,height:r}},gn=()=>{k.isDestroyed()?S&&S.destroyVideo():(Pe.debug("OT.Publisher.onLoaded; resolution:",`${this.videoWidth()}x${this.videoHeight()}`),k.set("MediaBound"),(0,j.default)().catch(Pe.error),S.loading(!!this.session&&!this.stream),xt=!0)},Qn=e=>{const t=qe(Ke.CONNECT_FAILED,e,ze.P2P_CONNECTION_FAILED);t.message="OT.Publisher PeerConnection Error: "+t.message,on("Failure",{},{failureReason:"PeerConnectionError",failureCode:t.code,failureMessage:t.message}),k.set("Failed"),this.trigger("publishComplete",t),$e.handleJsException({error:t,target:this,analytics:y})},Fn=()=>{v&&(r.emit("streamDestroy"),st.MediaStreamTrack&&st.MediaStreamTrack.prototype.stop?v.getTracks().forEach(e=>e.stop()):v.stop())},pn=()=>{const e=C.default.isiOS&&C.default.iOSVersion>=15&&C.default.iOSVersion<15.2,t=v.getVideoTracks()[0];if(!e||!t)return;document.addEventListener("visibilitychange",()=>{!document.hidden&&S&&S.rebindSrcObject()})},Un=()=>{const e=C.default.isiOS&&C.default.iOSVersion>=13.3,t=v.getAudioTracks()[0];e&&t&&(t.onmute=()=>Nr(t),t.onunmute=()=>Gr(t))},mn=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={muted:!0},S){e.next=3;break}throw new Error("Cannot bind video after widget view has been destroyed");case 3:return e.abrupt("return",S.bindVideo(v,t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bn=function(){var e=(0,o.default)(i.default.mark((function e(t){var o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Pe.debug("OT.Publisher.onStreamAvailable"),k.set("BindingMedia"),void 0!==_t.videoContentHint&&(0,N.setVideoContentHint)(t,_t.videoContentHint),Fn(),v=t,!_t.videoFilter){e.next=14;break}return e.prev=6,e.next=9,n.applyVideoFilter(_t.videoFilter);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),Pe.error("Error applying video filter: "+e.t0);case 14:if(!_t.audioFilter){e.next=23;break}return e.prev=15,e.next=18,n.applyAudioFilter(_t.audioFilter);case 18:e.next=23;break;case 20:e.prev=20,e.t1=e.catch(15),Pe.error("Error applying audio filter: "+e.t1);case 23:r.emit("streamChange"),Un(),pn(),ne=(o=(e,t)=>{let n;return e.forEach(e=>{if(e.deviceId)n=e.deviceId.toString();else if(e.label&&t){const r=(0,u.default)(t,t=>t.label===e.label);r&&(n=r.deviceId)}}),n})(v.getVideoTracks(),te),re=o(v.getAudioTracks(),ee),G=new _e(v,!_t.publishAudio),ur(),lr(),n.accessAllowed=!0,n.dispatchEvent(new H.default(X.default.ACCESS_ALLOWED,!1));case 34:case"end":return e.stop()}}),e,null,[[6,11],[15,20]])})));return function(t){return e.apply(this,arguments)}}(),Bn=e=>{let t,n;Pe.error("OT.Publisher.onPublishingTimeout"),Ht?(t=Ke.CHROME_MICROPHONE_ACQUISITION_ERROR,n="Unable to publish because your browser failed to get access to your microphone. You may need to fully quit and restart your browser to get it to work. See https://bugs.chromium.org/p/webrtc/issues/detail?id=4799 for more details."):(t=Ke.TIMEOUT,n="Could not publish in a reasonable amount of time");const r={failureReason:"ICEWorkflow",failureCode:ze.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to publish in a reasonable amount of time (timeout)"};on("Failure",{},r),$e.handleJsException({errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:y}),e.isConnected()&&this.streamId&&e._.streamDestroy(this.streamId),this.disconnect(),k.isDestroyed()||k.set("MediaBound"),this.trigger("publishComplete",qe(t,new Error(n),ze.UNABLE_TO_PUBLISH))},Zn=e=>{const t=qe(Ke.MEDIA_ERR_DECODE,e,ze.UNABLE_TO_PUBLISH);t.message="OT.Publisher while playing stream: "+t.message,Pe.error("OT.Publisher.onVideoError:",t),nn("stream",null,{reason:t.message});const n=k.isAttemptingToPublish();k.set("Failed"),n?this.trigger("publishComplete",t):this.trigger("error",t.message),$e.handleJsException({error:t,target:this,analytics:y})};this._setWebRTCStream=e=>{v=e},this._setCurrentVideoFilter=e=>{Fr=e},this._getCurrentVideoFilter=()=>Fr,this._setCurrentAudioFilter=e=>{pr=e},this._getMediaProcessor=()=>St,this._removePeerConnection=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return r=p(t),o=r.peerConnectionId,delete Dt[o],e.next=6,Kn.removePeerConnection(t);case 6:t.destroy(),null==(n=Zr)||n.onPeerConnectionDisconnected();case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._removeSubscriber=e=>{var t,n;null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.isAdaptiveEnabled&&"P2P"===oe&&this._.startRelayedToRoutedTransition(),Gn(e).then(e=>{e.forEach(e=>this._removePeerConnection(e))})};const fn=e=>{const t=p(e),n=t.remoteSubscriberId,r=t.peerConnectionId;Pe.debug("Subscriber has been disconnected from the Publisher's PeerConnection"),nn("disconnect","PeerConnection",{subscriberConnection:r}),this._removeSubscriber(n)},Rn=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,a,l,c,s,d,u,A,h,g,Q;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=r.reason,"ICEWorkflow"!==(c=r.prefix)||null==(o=n.session)||null==(a=o.sessionInfo)||!a.reconnection||!xt){e.next=4;break}return Pe.debug("Ignoring peer connection failure due to possibility of reconnection."),e.abrupt("return");case 4:return s=p(t)||{},d=s.remoteConnectionId,u=void 0===d?"(not found)":d,A=s.peerConnectionId,h=Oe(void 0,l,c,u,"Publisher"),g={hasRelayCandidates:t&&t.hasRelayCandidates()},Q={failureReason:c||"PeerConnectionError",failureCode:h.code,failureMessage:h.message},k.isPublishing()?Q.reason="Non-fatal":n.trigger("publishComplete",h),on("Failure",g,Q),$e.handleJsException({errorMsg:"OT.Publisher PeerConnection Error: "+l,code:h.code,target:n,analytics:y}),e.next=13,Dt[A];case 13:e.sent.destroy(),delete Dt[A];case 16:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),In=e=>{var t,n;return(null==(t=this.session)||null==(n=t.sessionInfo)?void 0:n.isAdaptiveEnabled)&&"P2P"===e.getSourceStreamId()},yn=(e,t)=>{setTimeout(()=>{if("disconnected"===he[t]&&It._.isSocketConnected()){const t=p(e).remoteConnectionId;an("Attempt",{remoteConnectionId:t}),e.iceRestart()}},2e3)},Vn=function(){var e=(0,o.default)(i.default.mark((function e(){var t,r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(ge),null==(t=n.session)||null==(r=t.sessionInfo)||!r.isAdaptiveEnabled){e.next=21;break}return e.next=4,Tn();case 4:if(e.t0=o=e.sent,null!=e.t0){e.next=9;break}e.t1=void 0,e.next=10;break;case 9:e.t1=o.iceConnectionStateIsConnected();case 10:return l=e.t1,e.next=13,Yn();case 13:if(e.t2=a=e.sent,null!=e.t2){e.next=18;break}e.t3=void 0,e.next=19;break;case 18:e.t3=a.iceConnectionStateIsConnected();case 19:c=e.t3,l&&c&&On();case 21:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Cn=e=>{var t,n;return It._.isSocketConnected()&&e===oe&&!(null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.p2pEnabled)},Wn=e=>{var t,n;Cn(e)&&(null!=(t=this.session)&&null!=(n=t.sessionInfo)&&n.isAdaptiveEnabled&&"P2P"===e?this._.startRelayedToRoutedTransition():ge=setTimeout(()=>{this.session._.streamDestroy(this.streamId,e)},5e3))},En=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getSourceStreamId(),he[r]=t,"connected"!==t){e.next=7;break}return e.next=5,Vn();case 5:e.next=8;break;case 7:"disconnected"===t?yn(n,r):"failed"===t&&Wn(r);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Sn=()=>{var e;return(null==(e=Zr)?void 0:e.getState())===Z.default.SUSPENDED_VIDEO},vn=e=>{var t;e._setP2PDefaultMaxBitrate(),Sn()||Lr(e),e.startEncryption(this.session.connection.id),In(e)&&cn("Success");const n=p(e).remoteSubscriberId;null==(t=ft)||t.addSubscriber(n,e),_t.publishVideo&&e.enableVideoQualityWatcher()},Jn=n=>{var r;let i=n.peerConnectionId,o=n.send,a=n.log,l=n.logQoS,c=n.sourceStreamId;if(!k.isMigrating()&&Xn(i))return e.reject(new Error("PeerConnection already exists"));const d=De({isChromiumEdge:et.env.isChromiumEdge,browserName:et.env.name,isScreenSharing:zt,isCustomVideoTrack:jt,sessionInfo:null==(r=this.session)?void 0:r.sessionInfo,constraints:_t.constraints,videoDimensions:hn(),capableSimulcastScreenshare:_t.capableSimulcastScreenshare,scalableVideo:_t.scalableVideo});return Dt[i]=e.all([this.session._.getIceConfig(),this.session._.getVideoCodecsCompatible(v)]).then(n=>{var r,i,u,A,h,g;let Q=n[0],F=n[1],U=v;if(!F){U=v.clone();const e=U.getVideoTracks()[0];e&&(e.stop(),U.removeTrack(e))}const m={enableDtx:_t.enableDtx};null!=(r=this.session)&&null!=(i=r.sessionInfo)&&i.p2pEnabled||(m.audioBitrate=_t.audioBitrate);const b=new rt({iceConfig:Q,sendMessage:o,webRTCStream:U,channels:_t.channels,capableSimulcastStreams:d,overrideSimulcastEnabled:t._enableSimulcast,logAnalyticsEvent:a,offerOverrides:{enableStereo:_t.enableStereo,audioBitrate:_t.audioBitrate,codecFlags:_t._codecFlags||this.session._.getCodecFlags()},answerOverrides:m,sourceStreamId:c,isP2pEnabled:null==(u=this.session)||null==(A=u.sessionInfo)?void 0:A.p2pEnabled,sessionId:this.session.id,keyStore:this.session.keyStore,sFrameClientStore:this.session.sFrameClientStore,isE2ee:this.session._.isE2ee(),audioFallbackEnabled:_t.publisherAudioFallbackEnabled,resolution:{width:this.videoWidth(),height:this.videoHeight()},preferredVideoCodecs:_t.preferredVideoCodecs?_t.preferredVideoCodecs:[_t._priorityVideoCodec||(null==(h=this.session)||null==(g=h.sessionInfo)?void 0:g.priorityVideoCodec)]});return b.on({disconnected:()=>fn(b),destroyed:()=>(e=>{var t;const n=p(e).remoteSubscriberId;null==(t=ft)||t.removeSubscriber(n)})(b),error:e=>{let t=e.reason,n=e.prefix;return Rn(b,{reason:t,prefix:n})},qos:l,iceRestartSuccess:()=>(e=>{const t=p(e).remoteConnectionId;an("Success",{remoteConnectionId:t})})(b),iceRestartFailure:()=>(e=>{const t=p(e).remoteConnectionId;an("Failure",{reason:"ICEWorkflow",message:"OT.Publisher PeerConnection Error: The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",remoteConnectionId:t})})(b),iceConnectionStateChange:e=>En(e,b),audioAcquisitionProblem:()=>{Ht=!0,this.trigger("audioAcquisitionProblem",{method:"getStats"})},audioAcquisitionProblemResolved:()=>{Ht=!1,this.trigger("audioAcquisitionProblemResolved",{method:"getStats"})},audioFallbackStateChange:e=>Zr.onPeerConnectionStateChange(Object.assign({},e,{peerConnection:b,publishVideo:_t.publishVideo,stream:this.stream,peerId:p(b).peerId})),videoQualityChanged:e=>{const t=p(b),n=t.remoteConnectionId,r=t.remoteSubscriberId,i=(0,s.default)(n.match(/^symphony\./)?{}:{subscriberId:r,connectionId:n},{stats:e.stats});this.trigger("videoQualityChanged",{reason:e.reason,statsContainer:i})}}),b.once("connected",()=>vn(b)),new e((e,t)=>{const n=e=>{t(e)};b.once("error",n),b.init(D,r=>{if(r)return t(r);b.off("error",n),e(b)})})}),Xn(i)},Nn=()=>e.all(Object.keys(Dt).map(Xn)),Gn=e=>Nn().then(t=>t.filter(t=>p(t).remoteSubscriberId===e)),Xn=e=>Dt[e],kn=e=>{const t=Object.keys(Dt).find(t=>t.endsWith("~"+e));return Dt[t]},Tn=()=>kn("MANTIS"),Yn=()=>kn("P2P");let wn=xe(this,{name:_t.name,publishAudio:_t.publishAudio,publishVideo:_t.publishVideo,audioSource:_t.audioSource,showControls:_t.showControls,shouldAllowAudio:Pt,logAnalyticsEvent:nn});const Dn=()=>{var e;this.off("publishComplete",Hn),wn&&wn.reset(),B.releaseAll(),R.empty(),this.disconnect(),G=null,Fn(),v=null,S&&(S.destroy(),S=null),this.session&&this._.unpublishFromSession(this.session,"reset"),St.getVideoFilter()&&Ar(),vt.destroy(),null==(e=ft)||e.destroy(),ft=null,this.id=null,this.stream=null,xt=!1,this.session=null,this.streamId=null,k.isDestroyed()||k.set("NotPublishing")},xn=()=>{if(!v||0===v.getVideoTracks().length)return!1;const e=["text","detail"].includes(_t.videoContentHint),t=jt&&e,n=et.env.isChromium&&(zt||t);return v.getVideoTracks().reduce((e,t)=>e&&(!t.muted||!!n)&&t.enabled&&"ended"!==t.readyState,_t.publishVideo)},Mn=()=>!(!v||0===v.getAudioTracks().length)&&(v.getAudioTracks().length>0&&v.getAudioTracks().reduce((e,t)=>e&&!t.muted&&t.enabled&&"ended"!==t.readyState,_t.publishAudio)),Hn=e=>{const t=Mn(),n=xn();if(S&&(S.audioOnly(!n),S.showPoster(!n)),wn&&wn.setAudioOnly(!n&&t),this.stream){let r;yt&&n&&(r=f.CongestionLevels.LOW,yt=!1),this.stream.setChannelActiveState({channelType:"audio",activeState:t,activeReason:e}),this.stream.setChannelActiveState({channelType:"video",activeState:n,activeReason:e,congestionLevel:r}),t||(this.stream.hasAudio=t),n||(this.stream.hasVideo=n)}else this.off("publishComplete",Hn),this.once("publishComplete",Hn)},Kn=(0,fe.default)({isPublisher:!0}),Ln=function(){var t=(0,o.default)(i.default.mark((function t(r,o,a){var l,c,d,u,A,h,g,Q,F;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(l="rtcStatsReport"===o)||Y.default){t.next=5;break}return c=ze.GET_RTC_STATS_REPORT_NOT_SUPPORTED,a(qe(Ke.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error($e.getTitleByCode(c)),c)),t.abrupt("return");case 5:return t.prev=5,t.next=8,Nn();case 8:if(0!==(A=t.sent).length){t.next=12;break}throw c=ze.PEER_CONNECTION_NOT_CONNECTED,qe(Ke.PEER_CONNECTION_NOT_CONNECTED,new Error($e.getTitleByCode(c)),c);case 12:if(null!=(d=n.session)&&null!=(u=d.sessionInfo)&&u.p2pEnabled){t.next=24;break}if(!l){t.next=17;break}null!=(h=n.session)&&null!=(g=h.sessionInfo)&&g.isAdaptiveEnabled&&(A=A.filter(e=>e.getSourceStreamId()===oe)),t.next=24;break;case 17:return t.t0=a,t.next=20,Kn.getStats(A.map(e=>({pc:e,metadata:p(e)})),oe);case 20:return t.t1=t.sent,t.t2=[t.t1],(0,t.t0)(null,t.t2),t.abrupt("return");case 24:return t.next=26,e.all(A.map(e=>(l?(0,T.default)(e.getRtcStatsReport.bind(e)):(0,T.default)(e.getStats.bind(e)))(r).then(t=>({pc:e,stats:t}))));case 26:Q=t.sent,F=Q.map(e=>{let t=e.pc,n=e.stats;const r=p(t),i=r.remoteConnectionId,o=r.remoteSubscriberId;return(0,s.default)(i.match(/^symphony\./)?{}:{subscriberId:o,connectionId:i},l?{rtcStatsReport:n}:{stats:t.processStats(n)})}),a(null,F),t.next=34;break;case 31:t.prev=31,t.t3=t.catch(5),a(t.t3);case 34:case"end":return t.stop()}}),t,null,[[5,31]])})));return function(e,n,r){return t.apply(this,arguments)}}(),zn=(e,t)=>{const n={name:_t.name||"",streamId:this.streamId,subscriberAudioFallbackEnabled:_t.subscriberAudioFallbackEnabled,channels:Et,minBitrate:_t.minVideoBitrate,sourceStreamId:e,e2ee:this.session._.isE2ee(),publisherAudioFallbackEnabled:_t.publisherAudioFallbackEnabled,customProperties:{initials:_t.initials}};this.session._.streamCreate(n,t)},On=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le=!1,e.next=3,Tn();case 3:if(!(t=e.sent)){e.next=19;break}return n.trigger("sourceStreamIdChanged","P2P"),_t.publisherAudioFallbackEnabled&&t.disableCongestionLevelEstimation(),t.disableVideoQualityWatcher(),e.next=10,(0,V.default)(bt);case 10:if(!le){e.next=13;break}return Pe.debug("Cancelling stop sending RTP to MANTIS."),e.abrupt("return");case 13:return vt.muteAudioInPeerConnection(v,t),e.next=16,t.changeMediaDirectionToInactive();case 16:if(!(et.env.isFirefox&&et.env.version<96)){e.next=19;break}return e.next=19,Pn();case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),jn=function(){var e=(0,o.default)(i.default.mark((function e(){var t,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le=!0,e.next=3,Tn();case 3:if(!(t=e.sent)){e.next=16;break}return vt.unmuteAudioInPeerConnection(v,t),e.next=8,t.changeMediaDirectionToRecvOnly();case 8:if(t.enableVideoQualityWatcher(),ae&&clearTimeout(ae),n.trigger("sourceStreamIdChanged","MANTIS"),!_t.publisherAudioFallbackEnabled){e.next=16;break}return e.next=14,Yn();case 14:r=e.sent,t.enableCongestionLevelEstimation(null==r?void 0:r.getAudioFallbackState());case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pn=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Tn();case 2:(t=e.sent)&&(ae=setTimeout((0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("P2P"!==oe){e.next=9;break}return e.next=3,t.changeMediaDirectionToRecvOnly();case 3:return e.next=5,(0,V.default)(Bt);case 5:return e.next=7,t.changeMediaDirectionToInactive();case 7:return e.next=9,Pn();case 9:case"end":return e.stop()}}),e)}))),Zt));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_n=()=>{cn("Attempt");const e=e=>{const t=(0,q.default)(e);this.trigger("streamCreateForP2PComplete",t),cn("Failure",{reason:t.message})};if(!this.session)return void cn("Failure",{reason:"Not connected to the session."});const t=setTimeout(()=>{cn("Failure",{reason:"Timeout"})},nt);this.once("streamCreateForP2PComplete",()=>{clearTimeout(t)}),Pe.debug("streamCreateWithSource: send a message to RUMOR for creating the stream with the sourceStreaId P2P and stream "+this.streamId),zn("P2P",t=>{t?e(t):this.trigger("streamCreateForP2PComplete")})},qn=function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("P2P"===oe){e.next=2;break}return e.abrupt("return");case 2:if(sn("Attempt"),n.session){e.next=6;break}return sn("Failure",{reason:"Not connected to the session."}),e.abrupt("return");case 6:if(n.streamId){e.next=9;break}return sn("Failure",{reason:"No streamId available"}),e.abrupt("return");case 9:return e.next=11,jn();case 11:return n.session._.streamDestroy(n.streamId,"P2P"),e.t0=n,e.next=15,Yn();case 15:e.t1=e.sent,e.t0._removePeerConnection.call(e.t0,e.t1),sn("Success"),n.trigger("streamDestroyForP2PComplete");case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$n=(e,t)=>{var n,r;return(null==(n=this.session)||null==(r=n.sessionInfo)?void 0:r.isAdaptiveEnabled)&&"P2P"===t&&"generateoffer"===e&&k.isMigrating()},er=(e,t)=>{var n,r;return(null==(n=this.session)||null==(r=n.sessionInfo)?void 0:r.isAdaptiveEnabled)&&"MANTIS"===t&&"answer"===e&&"P2P"===oe},tr=e=>{const t=dt({socket:this.session._.getSocket(),uri:mt,content:{peerId:ke,sourceStreamId:e}});return(e,n)=>{"offer"===e&&this.trigger("connected"),t({type:e,content:n})}},nr=()=>{Fe=setTimeout(()=>{nn("Migrate","Failed"),this.destroy()},this.session.MIGRATION_TIMEOUT)};this.publish=e=>(Pe.debug("OT.Publisher: publish"),(k.isAttemptingToPublish()||k.isPublishing())&&Dn(),k.set("GetUserMedia"),_t.style&&this.setStyle(_t.style,null,!0),_t.classNames="OT_root OT_publisher",He.onLoad(()=>{Pe.debug("OT.Publisher: publish: environment loaded"),S=new ct(e,Object.assign({},_t,{widgetType:"publisher"})),Pt&&(0,O.default)({publisher:this,widgetView:S}),S.on("error",Zn),this.id=S.domId(),this.element=S.domElement,this.element&&wn&&wn.init(S),S.on("videoDimensionsChanged",(e,t)=>{_t.publishVideo&&(this.stream&&this.stream.setVideoDimensions(t.width,t.height),this.dispatchEvent(new Le.VideoDimensionsChangedEvent(this,e,t)))}),S.on("mediaStopped",e=>{const t=new Le.MediaStoppedEvent(this,e);if("ended"===(null==e?void 0:e.readyState)&&!(null==e||!e.writable)||this.dispatchEvent(t),!t.isDefaultPrevented()){if(e){const t=String(e.kind).toLowerCase();return"audio"===t?lr():"video"===t?ur():Pe.warn("Track with invalid kind has ended: "+e.kind),void nn("mediaStopped","Event",{kind:t})}this.session?this._.unpublishFromSession(this.session,"mediaStopped"):this.destroy("mediaStopped")}}),S.on("videoElementCreated",e=>{this.dispatchEvent(new Le.MediaStreamAvailableEvent(v));const t=new Le.VideoElementCreatedEvent(e);this.dispatchEvent(t)}),qt().catch(kt).then(function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ee=Kt.audioDevices,te=Kt.videoDevices,a=!!_t.videoFilter,_t.disableAudioInputDeviceManagement||(l=Qt(),Qe=l(n)),c=(null==(r=ee)?void 0:r.length)>0||(null==(o=te)?void 0:o.length)>0,e.next=7,(0,ve.default)(c).then(e=>{e.on("accessDenied",e=>{n.accessAllowed=!1,n.dispatchEvent((0,Je.default)(e,"during the call"))})});case 7:return a&&(Qr=(0,_.default)(t,te)),e.next=10,bn(t);case 10:return _t.publishVideo||n._toggleVideo(_t.publishVideo,hn()),zt||jt||a||(Qr=(0,_.default)(t,te),_t.publishVideo&&Wr(Qr)),e.abrupt("return",mn().catch(e=>{if(!(e instanceof b.CancellationError))throw e}).then(()=>{gn(),k.isDestroyed()||(n.trigger("initSuccess"),n.trigger("loaded",n))},e=>{Pe.error("OT.Publisher.publish failed to bind video: "+e),Qn(e)}));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),this),this._getVideoSenders=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Nn().then(e=>e[0].getSenders().filter(e=>"video"===e.track.kind)));case 1:case"end":return e.stop()}}),e)}))),this._setScalableValues=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,a,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._getVideoSenders();case 2:return o=e.sent,a=o[0],(l=a.getParameters()).encodings.forEach((e,n)=>{e[t]=r[n]}),e.next=8,a.setParameters(l);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this._setScalabilityMode=function(){var e=(0,o.default)(i.default.mark((function e(t,r){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",gt(n,t,r));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this._getNumEncodings=()=>(0,We.default)(this),this._setScalableFramerates=function(){var e=(0,o.default)(i.default.mark((function e(t){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=or(t))||!rr(r)){e.next=4;break}return e.next=4,n._setScalableValues("maxFramerate",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._setScalableVideoLayers=function(){var e=(0,o.default)(i.default.mark((function e(t){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=or(t))||!ir(r)){e.next=4;break}return e.next=4,n._setScalableValues("scaleResolutionDownBy",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();const rr=e=>{let t=0;return e.every(e=>!(15!==e&&30!==e||e<t)&&(t=e,!0))},ir=e=>{let t=17;return e.every(e=>!(e<1||e>=t)&&(t=e,!0))},or=e=>{let t;if("string"!=typeof e)return t;const n=e.split(":");return 0===n.length||n.length>3?t:n.every(e=>!isNaN(e))?(t=n.map(e=>parseInt(e,10)).reverse(),t):t},ar=e=>v&&v[`get${(0,F.default)(e)}Tracks`]().length>0&&v[`get${(0,F.default)(e)}Tracks`]().every(e=>"ended"!==e.readyState),lr=e=>{const t=ar("audio")&&_t.publishAudio;wn&&wn.setMuted(!t),G&&G.muted(!t),se&&se.originalTrack&&(se.originalTrack.enabled=t),Hn(e)};this.publishAudio=e=>{nn("publishAudio","Attempt",{publishAudio:e}),_t.publishAudio=e;try{lr(),nn("publishAudio","Success",{publishAudio:e})}catch(e){nn("publishAudio","Failure",{message:e.message})}return this};const cr=e=>{try{r.dispatchEvent(new Le.PublisherCaptionsEnabled(e)),this.stream.setChannelActiveState({id:"caption1",activeState:e}),nn("publishCaptions","Success",{publishCaptions:e})}catch(t){nn("publishCaptions","Failure",{message:t.message,publishCaptions:e})}};let sr;this.publishCaptions=e=>{nn("publishCaptions","Attempt",{publishCaptions:e}),this.stream?cr(e):R.add(()=>cr(e))};let dr=!1;const ur=()=>{const e=ar("video")&&_t.publishVideo;if((0,o.default)(i.default.mark((function t(){var n,r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Nn();case 2:return n=t.sent,e&&Ue?n.forEach(e=>{Lr(e)}):"Chrome"===C.default.name&&C.default.version>=69&&(sr&&sr.cancel(),sr=new b.default,sr.isCanceled()||n.forEach(t=>{t.setVideoActiveState(e)})),t.next=7,kn(oe);case 7:r=t.sent,e?r.enableVideoQualityWatcher():r.disableVideoQualityWatcher();case 9:case"end":return t.stop()}}),t)})))(),jt&&St){const t=St.getOriginalVideoTrack();t&&(t.enabled=e)}if(jt&&ce){const t=ce.originalTrack;t&&(t.enabled=e)}v&&v.getVideoTracks().forEach(t=>{t.enabled=e,t.isCreatedCanvas&&(t.enabled=!1)}),Hn()},Ar=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=St.getOriginalVideoTrack(),e.prev=1,e.next=4,St.destroy();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),Pe.warn("Error cleaning up mediaProcessor: "+e.t0);case 9:t.stop();case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),hr=e=>!Fr&&!ce&&e===Cr(),gr=(e,t)=>!(!Fr&&!ce)||(e?Qr!==t:void 0!==t);let Qr,Fr,pr;this._toggleVideo=(0,E.default)(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var o,a,l,c,s,d,u,A;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(zt||jt||dr)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Er();case 4:if(a=e.sent,l=Vr()){e.next=8;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher._toggleVideo cannot toggleVideo when you have no video source."));case 8:if(c=null==(o=a.find(e=>e.label===l.label))?void 0:o.deviceId,gr(t,c)){e.next=11;break}return e.abrupt("return");case 11:if("ended"!==l.readyState){e.next=14;break}return dr=!0,e.abrupt("return");case 14:if(t&&et.env.isAndroid&&(et.env.isChrome||et.env.isSamsung)&&l&&l.stop&&l.stop(),t){e.next=31;break}e.prev=16,s=(0,P.default)(n),e.next=23;break;case 20:return e.prev=20,e.t0=e.catch(16),e.abrupt("return");case 23:if(c&&(Qr=c),Wr(s.label),!(d=St.getVideoFilter())){e.next=30;break}return Fr=d,e.next=30,Ar();case 30:ce&&(ce.destroy(),ce.stopOriginalTrack());case 31:if(!Qr||-1!==a.findIndex(e=>e.deviceId===Qr)){e.next=33;break}throw qe(Ke.NO_DEVICES_FOUND,new Error("Previous device no longer available - deviceId not found"));case 33:if(r.emit("streamDestroy"),!t){e.next=64;break}if(!hr(Qr)){e.next=37;break}return e.abrupt("return");case 37:return e.prev=37,e.next=40,yr(Qr);case 40:s=e.sent,e.next=47;break;case 43:throw e.prev=43,e.t1=e.catch(37),Pe.error(`Error getting new track for current device(${Qr}): ${e.t1}`),e.t1;case 47:if(s){e.next=50;break}return Pe.error("Failed to enable video. It was not possible to get a new track from the camera"),e.abrupt("return");case 50:if(!Fr){e.next=59;break}return u=St.getOriginalVideoTrack(),e.next=54,St.setVideoFilter(Fr);case 54:return e.next=56,St.setMediaStream(v);case 56:return e.next=58,St.setVideoTrack(s);case 58:s=e.sent;case 59:if(!ce){e.next=64;break}return u=ce.originalTrack,e.next=63,ce.setTrack(s);case 63:s=e.sent;case 64:return e.prev=64,e.next=67,Ir(l,s);case 67:null==(A=u)||A.stop(),e.next=73;break;case 70:throw e.prev=70,e.t2=e.catch(64),e.t2;case 73:case"end":return e.stop()}}),e,null,[[16,20],[37,43],[64,70]])})));return function(t,n){return e.apply(this,arguments)}}());const Ur=(0,Be.callWithCancellation)(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nn();case 2:r=e.sent,n.isCanceled()||r.forEach(e=>{t?e.enableCongestionLevelEstimation():e.disableCongestionLevelEstimation()});case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),mr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==(r=wn)||r.videoDisabledIndicator.disableVideo(!1),null==(o=wn)||o.videoDisabledIndicator.setWarning(!1),Lr(),t===Z.default.SUSPENDED_VIDEO?n.trigger("videoEnabled",{reason:"quality"}):n.trigger("videoDisableWarningLifted");case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),br=()=>{var e;_t.publishVideo&&(null==(e=wn)||e.videoDisabledIndicator.setWarning(!0));this.trigger("videoDisableWarning")},Br=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_t.publishVideo&&(null==(t=wn)||t.videoDisabledIndicator.disableVideo(!0)),n.trigger("videoDisabled",{reason:"quality"});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();let Zr;if(_t.publisherAudioFallbackEnabled){Zr=Xe({getAllPeerConnections:Nn});const e={[Z.default.ACTIVE_VIDEO]:mr,[Z.default.ACTIVE_VIDEO_WITH_WARNING]:br,[Z.default.SUSPENDED_VIDEO]:Br};Zr.on("stateChange",t=>{let n=t.previousState,r=t.state;try{e[r](n)}catch(e){throw Pe.error("Audio fallback error: "+e),e}})}this.publishVideo=(e,t)=>{if(_t.publishVideo===e)return t&&setTimeout(()=>{t()}),this;const n=(0,Se.default)(t),r=n.onResolve,i=n.onReject;return nn("publishVideo","Attempt",{publishVideo:e}),this._publishVideo(e).then(()=>{nn("publishVideo","Success",{publishVideo:e}),r()},e=>{nn("publishVideo","Failure",{message:e.message}),i(e)}),this},this._publishVideo=function(){var t=(0,o.default)(i.default.mark((function t(r){var o;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=hn(),_t.publishVideo=r,_t.publisherAudioFallbackEnabled&&(Ur(r),!1===r&&Zr.getState()!==Z.default.ACTIVE_VIDEO&&(yt=!0,i=void 0,a=void 0,Zr.reset(),null==(i=wn)||i.videoDisabledIndicator.disableVideo(!1),null==(a=wn)||a.videoDisabledIndicator.setWarning(!1))),t.next=5,e.all([n._toggleVideo(_t.publishVideo,o),ur()]);case 5:case"end":return t.stop()}var i,a}),t)})));return function(e){return t.apply(this,arguments)}}(),this.setVideoContentHint=e=>{zt&&_t._setDefaultScalabilityMode&&this._setScalabilityMode((0,Ve.default)(e)),(0,N.setVideoContentHint)(v,e)},this.getVideoContentHint=()=>(0,N.getVideoContentHint)(v),this.destroy=function(e,t){return k.isAttemptingToPublish()&&this.session&&on("Cancel",{reason:"destroy"}),k.isDestroyed()||(k.set("Destroyed"),Dn(),Kt&&(Kt.off(),Kt=null),wn&&(wn.destroy(),wn=null),r&&(r.off(),r=null),!0!==t&&this.dispatchEvent(new Le.DestroyedEvent(X.default.PUBLISHER_DESTROYED,this,e)),this.off(),ce&&(ce.destroy(),ce.stopOriginalTrack()),se&&(se.destroy(),se.stopOriginalTrack()),void 0!==Qe&&Qe()),this},this.disconnect=()=>{Object.keys(Dt).forEach(e=>{const t=Xn(e);delete Dt[e],t.then(e=>this._removePeerConnection(e))}),Et.length=0},this.processMessage=(e,t,n)=>{const r=(0,c.default)(n,"params.subscriber",t).replace(/^INVALID-STREAM$/,t),i=(0,c.default)(n,"content.peerId"),o=(0,c.default)(n,"content.sourceStreamId","MANTIS"),l=`${r}~${i}~${o}`;Pe.debug(`OT.Publisher.processMessage: Received ${e} from ${t} for ${l}`),Pe.debug(n);const s=Xn(l),d=()=>{ke=i,mt=n.uri;const c=tr(o);Jn({peerConnectionId:l,send:c,log:function(e,t,n,r,a){void 0===r&&(r={});const l=Object.assign({peerId:i,sourceStreamId:(0,$.default)(o)},r);return nn(e,t,n,l,a)},logQoS:e=>{o===oe&&An(Object.assign({},e,{peerId:i,remoteConnectionId:t,sourceStreamId:o}))},sourceStreamId:o}).then(c=>(((e,t)=>{a.set(e,t)})(c,{remoteConnectionId:t,remoteSubscriberId:r,peerId:i,sourceStreamId:o,peerConnectionId:l}),c.processMessage(e,n),null)).catch(e=>{Pe.error("OT.Publisher failed to create a peerConnection",e)})};switch(e){case"unsubscribe":this._removeSubscriber(r);break;default:if(s)s.then(t=>{t.processMessage(e,n),($n(e,o)||er(e,o))&&On()});else{var u,A;if(!k.isMigrating()&&null!=(u=this.session)&&null!=(A=u.sessionInfo)&&A.isAdaptiveEnabled&&Yn())return;d()}}},this.getImgData=function(){if(!xt)return Pe.error("OT.Publisher.getImgData: Cannot getImgData before the Publisher is publishing."),null;const e=S&&S.video();return e?e.imgData():null};const fr=e=>{e.getSenders().forEach(e=>"audio"===e.track.kind&&v.getAudioTracks().length?e.replaceTrack(v.getAudioTracks()[0]):"video"===e.track.kind&&v.getVideoTracks().length?e.replaceTrack(v.getVideoTracks()[0]):void 0)},Rr=function(t){return void 0===t&&(t=fr),Nn().then(n=>(n.map(t),e.all([])))};{let e=0;const t=function(){var t=(0,o.default)(i.default.mark((function t(){var n,o,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!et.env.isLegacyEdge&&st.RTCRtpSender&&"function"==typeof st.RTCRtpSender.prototype.replaceTrack){t.next=2;break}throw qe(Ke.UNSUPPORTED_BROWSER,new Error("Publisher#cycleVideo is not supported in your browser."),ze.UNABLE_TO_PUBLISH);case 2:if(!jt&&!zt){t.next=4;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher#cycleVideo: The publisher is not using a camera video source"));case 4:if(Vr()){t.next=7;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher#cycleVideo cannot cycleVideo when you have no video source."));case 7:return e+=1,t.next=10,Er();case 10:if(n=t.sent,n.filter(e=>e.deviceId!==Qr).length>0){t.next=14;break}return t.abrupt("return",Qr);case 14:for(;n[e%n.length].deviceId===Qr;)e+=1;return r.emit("streamDestroy"),o=n[e%n.length],a=o.deviceId,t.next=20,Dr(a);case 20:return t.abrupt("return",Qr);case 21:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();this.cycleVideo=(0,E.default)((0,o.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:n=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),Pe.error("Publisher#cycleVideo: could not cycle video: "+e.t0),e.t0;case 10:return e.abrupt("return",{deviceId:n});case 11:case"end":return e.stop()}}),e,null,[[0,6]])}))))}const Ir=function(){var t=(0,o.default)(i.default.mark((function t(a,l){var c,s,d;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Nn();case 2:return c=t.sent,t.next=5,e.all(c.map(function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.findAndReplaceTrack(a,l);case 2:t._setP2PDefaultMaxBitrate();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 5:if(v.removeTrack(a),v.addTrack(l),a&&a.stop){try{s=l instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(l).toString().includes("MediaStreamTrackGenerator")}catch(e){s=!1}s||a.stop()}"Firefox"!==et.env.name&&"Safari"!==et.env.name||(n.videoElement().srcObject=null,n.videoElement().srcObject=v),(d=S&&S.video())&&d.refreshTracks(),r.emit("streamChange"),ur();case 13:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),yr=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o,a,l,c,s,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Cr(),Wr(n),(a=(0,d.default)(t)).audioSource=null,a.videoSource=n,Kt=pt(a,"OT.Publisher.getTrackFromDeviceId",()=>k&&k.isDestroyed()),Kt.on({accessDialogOpened:Tt,accessDialogClosed:Yt}),l=Kt.getUserMedia,e.prev=8,e.next=11,l();case 11:c=e.sent,e.next=18;break;case 14:throw e.prev=14,e.t0=e.catch(8),Pe.error(e.t0),e.t0;case 18:return s=null==(r=c)?void 0:r.getVideoTracks(),(u=s[0])||Wr(o),e.abrupt("return",u);case 21:case"end":return e.stop()}}),e,null,[[8,14]])})));return function(t){return e.apply(this,arguments)}}(),Vr=()=>v.getVideoTracks()[0],Cr=()=>ie,Wr=e=>{ie=e},Er=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Me.shouldAskForDevices();case 2:if(t=e.sent,n=t.videoDevices,t.video&&n&&n.length){e.next=6;break}throw qe(Ke.NO_DEVICES_FOUND,new Error("No video devices available"),ze.UNABLE_TO_PUBLISH);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Sr=function(){var t=(0,o.default)(i.default.mark((function t(r,o){var a,l,c,s;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.session){t.next=2;break}return t.abrupt("return");case 2:if(null==(a=n.session.sessionInfo)||!a.isAdaptiveEnabled||"P2P"!==oe){t.next=15;break}return t.next=5,Yn();case 5:return l=t.sent,t.next=8,null==l?void 0:l.findAndReplaceTrack(r,o);case 8:return t.next=10,Tn();case 10:return c=t.sent,t.next=13,vt.replaceTrackInMutedAudioTracks(c,r,o);case 13:t.next=20;break;case 15:return t.next=17,Nn();case 17:return s=t.sent,t.next=20,e.all(s.map(e=>e.findAndReplaceTrack(r,o)));case 20:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),vr=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==n){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Sr(t,n);case 4:n&&v.addTrack(n),t&&v.removeTrack(t),(o=S&&S.video())&&o.refreshTracks(),wn&&(n&&!t&&wn.addAudioTrack(),t&&!n&&wn.removeAudioTrack());try{a=n instanceof MediaStreamTrackGenerator||Object.getPrototypeOf(n).toString().includes("MediaStreamTrackGenerator")}catch(e){a=!1}t&&t.stop&&!a&&t.stop(),n&&(lr(),G=new _e(v,!_t.publishAudio)),r.emit("streamChange"),Hn();case 14:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Jr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getSettings().deviceId,e.prev=1,e.next=4,n.setAudioSource(r);case 4:(o=v.getAudioTracks()[0])&&(o.onmute=()=>Nr(o),o.onunmute=()=>Gr(o)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),Pe.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),Nr=e=>{let t=!1;_t.publishVideo&&document.hidden&&(t=!0,this.publishVideo(!1));const r=function(){var a=(0,o.default)(i.default.mark((function o(){return i.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(document.hidden){i.next=5;break}return i.next=3,Jr(e);case 3:t&&n.publishVideo(!0),document.removeEventListener("visibilitychange",r);case 5:case"end":return i.stop()}}),o)})));return function(){return a.apply(this,arguments)}}();document.addEventListener("visibilitychange",r)},Gr=e=>{var t;Mn()&&(xn()?this.videoElement().pause():Jr(e)),null==this||null==(t=this.session)||t.trigger("gsmCallEnded")},Xr=!(et.env.isLegacyEdge||!st.RTCRtpSender||"function"!=typeof st.RTCRtpSender.prototype.replaceTrack),kr=()=>qe(Ke.CANCEL,new Error("Operation did not succeed due to a new request."));let Tr;const Yr=function(){var e=(0,o.default)(i.default.mark((function e(r){var a,l,c,s,u,A,h,g,Q,F,p;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Xr){e.next=2;break}throw qe(Ke.UNSUPPORTED_BROWSER,new Error("Publisher#setAudioSource is not supported in your browser."));case 2:if(Tr&&Tr.cancel(),Tr=new b.default,a=Tr,l=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.isCanceled()){e.next=3;break}throw t.getTracks(e=>e.stop()),kr();case 3:return e.abrupt("return",Yr(t.getAudioTracks()[0]));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=n._getAudioSource()){e.next=7;break}throw qe(Ke.NOT_SUPPORTED,new Error("Publisher#setAudioSource cannot add an audio source when you started without one."));case 7:if(!((U=r)instanceof MediaStreamTrack||U&&"object"==typeof U&&Object.getPrototypeOf(U).toString().includes("MediaStreamTrack"))){e.next=26;break}if(!a.isCanceled()){e.next=10;break}throw kr();case 10:if(!se){e.next=23;break}return e.prev=11,e.next=14,se.setTrack(r);case 14:return s=e.sent,e.next=17,vr(c,s);case 17:return e.abrupt("return",e.sent);case 20:e.prev=20,e.t0=e.catch(11),Pe.error("Error setting track on audioMediaProcessorConnector: "+e.t0);case 23:return e.abrupt("return",vr(c,r));case 26:if("string"!=typeof r){e.next=73;break}return(u=(0,d.default)(t)).audioSource=r,u.videoSource=null,Kt=pt(u,"OT.Publisher.setAudioSource",()=>a.isCanceled()||k&&k.isDestroyed()),Kt.on({accessDialogOpened:Tt,accessDialogClosed:Yt}),A=c.label,h=c.getConstraints&&c.getSettings().deviceId||void 0,c&&c.stop(),g=Kt.getUserMedia,e.prev=36,e.t1=l,e.next=40,g();case 40:return e.t2=e.sent,e.next=43,(0,e.t1)(e.t2);case 43:return e.abrupt("return",e.sent);case 46:if(e.prev=46,e.t3=e.catch(36),!a.isCanceled()){e.next=50;break}throw kr();case 50:if((Q=(0,d.default)(t)).videoSource=null,Q.audioSource=h,Q.audioSource||!A){e.next=60;break}return e.next=56,Te();case 56:if(F=e.sent.find(e=>e.label===A),!a.isCanceled()){e.next=59;break}throw kr();case 59:F&&(Q.audioSource=F.deviceId);case 60:if(Q.audioSource){e.next=63;break}throw e.t3.message+=" (could not determine previous audio device)",qe(Ke.NOT_FOUND,e.t3);case 63:return Kt=pt(Q,"OT.Publisher.setAudioSource",()=>a.isCanceled()||k&&k.isDestroyed()),e.next=66,Kt.getUserMedia().catch(e=>{throw e.message+=" (could not obtain previous audio device)",e});case 66:return p=e.sent,e.next=69,l(p);case 69:throw e.t3.message+=" (reverted to previous audio device)",e.t3;case 71:e.next=74;break;case 73:throw qe(Ke.INVALID_PARAMETER,new Error("Invalid parameter passed to OT.Publisher.setAudioSource(). Expected string or MediaStreamTrack."));case 74:case"end":return e.stop()}var U}),e,null,[[11,20],[36,46]])})));return function(t){return e.apply(this,arguments)}}();this.setAudioSource=Yr,this._getAudioSource=()=>v&&v.getAudioTracks().length>0?v.getAudioTracks()[0]:null,this.getAudioSource=()=>se?se.originalTrack:this._getAudioSource();const wr=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=qe(Ke.INVALID_VIDEO_SOURCE,new Error("Invalid video source. Video source must be a valid video input deviceId"),1041),r=qe(Ke.SET_VIDEO_SOURCE_FAILURE,new Error("You cannot reset the video source on a publisher that does not currently use a camera source."),1040),!et.env.isLegacyEdge&&st.RTCRtpSender&&"function"==typeof st.RTCRtpSender.prototype.replaceTrack){e.next=4;break}throw qe(Ke.UNSUPPORTED_BROWSER,new Error("setVideoSource is not supported in your browser."),ze.UNABLE_TO_PUBLISH);case 4:if("string"==typeof t){e.next=6;break}throw n;case 6:if(o=!v||0===v.getVideoTracks().length,!(jt||zt||o)){e.next=9;break}throw r;case 9:return e.next=11,Te();case 11:if(a=e.sent,a.find(e=>"videoInput"===e.kind&&e.deviceId===t)){e.next=15;break}throw n;case 15:return e.next=17,Dr(t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoSource=wr;const Dr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c,s,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Qr,Qr=t,_t.publishVideo){e.next=4;break}return e.abrupt("return");case 4:if(!hr(t)){e.next=6;break}return e.abrupt("return");case 6:if(a=Vr(),l=et.env.isChrome||et.env.isFirefox||et.env.isSamsung,!(_t.publishVideo&&et.env.isAndroid&&l)){e.next=15;break}if(!Fr){e.next=14;break}return c=Fr,e.next=13,Ar();case 13:Fr=null;case 14:a&&a.stop&&a.stop();case 15:return e.prev=15,e.next=18,yr(t);case 18:s=e.sent,e.next=26;break;case 21:throw e.prev=21,e.t0=e.catch(15),Qr=o,Pe.error(e.t0),e.t0;case 26:if(s){e.next=29;break}return Pe.warn("Unable to aquire video track. Moving to next device."),e.abrupt("return");case 29:if(!Fr){e.next=34;break}return d=St.getOriginalVideoTrack(),e.next=33,St.setVideoTrack(s);case 33:s=e.sent;case 34:if(!ce){e.next=39;break}return d=ce.originalTrack,e.next=38,ce.setTrack(s);case 38:s=e.sent;case 39:return e.next=41,Ir(a,s);case 41:if(!c){e.next=44;break}return e.next=44,n.applyVideoFilter(c);case 44:null==(r=d)||r.stop(),_t.publishVideo&&(dr=!1);case 46:case"end":return e.stop()}}),e,null,[[15,21]])})));return function(t){return e.apply(this,arguments)}}();var xr,Mr;this.getVideoSource=()=>{const e={},t=!v||0===v.getVideoTracks().length;return e.track=v&&_t.publishVideo&&v.getVideoTracks()[0]||null,e.deviceId=zt||jt||!Qr?null:Qr,e.type=jt?"custom":zt?"screen":t?null:"camera",e},this._={privateEvents:r,setIceConfig:e=>(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Nn();case 2:t.sent.forEach(t=>t.setIceConfig(e));case 4:case"end":return t.stop()}}),t)})))(),publishToSession:(t,r)=>{if("PublishingToSession"===k.current||k.isPublishing())return Pe.warn("This publisher is already publishing to the session. If you want to\n republish, please unpublish first."),e.resolve();r&&(y=r),this.session=t,It=t,this.streamId=(0,U.default)(),Vt&&(ft=new Ut({socket:this.session._.getSocket(),streamId:this.streamId})),on("Attempt",{dataChannels:_t.channels,properties:(0,L.default)(_t)});const a=new e((e,t)=>{xt?e():(this.once("initSuccess",e),this.once("destroyed",e=>{let n=e.reason,r="";n&&(r=" Reason: "+n),t(new Error("Publisher destroyed before it finished loading."+r))}))});Pe.debug("publishToSession: waiting for publishComplete, which is triggered by stream#created from rumor");const l=function(){var e=(0,o.default)(i.default.mark((function e(){var t,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=!_t.constraints.video,e.t0){e.next=6;break}return e.next=4,n._getNumEncodings();case 4:e.t1=e.sent,e.t0=e.t1<=1;case 6:if(!e.t0){e.next=8;break}return e.abrupt("return");case 8:r=["VP9"],!zt&&!jt?t="L3T3":_t._setDefaultScalabilityMode&&zt&&(o=n.getVideoContentHint(),t=(0,Ve.default)(o)),t&&n._setScalabilityMode(t,r);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=new e((e,t)=>{this.once("publishComplete",n=>{n?t(n):(this._setScalableFramerates(_t.scalableFramerates),this._setScalableVideoLayers(_t.scalableVideoLayers),l(),this.stream&&(this.stream.setChannelActiveState({channelType:"audio",activeState:Mn()}),this.stream.setChannelActiveState({channelType:"video",activeState:xn()})),Pe.debug("publishToSession: got publishComplete"),e())})}),s=e=>{const t=(0,q.default)(e);throw on("Failure",{},{failureReason:"Publish",failureCode:t.code,failureMessage:t.message}),k.isAttemptingToPublish()&&this.trigger("publishComplete",t),$e.handleJsException({errorMsg:e.message,code:t.code,target:this,error:e,analytics:y}),t};Pe.debug("publishToSession: waiting for loaded");const d=a.then(()=>t._.getVideoCodecsCompatible(v)).then(n=>{if(Pe.debug("publishToSession: loaded"),!this.session)return;const r=setTimeout(()=>{Bn(t)},nt);this.once("publishComplete",()=>{clearTimeout(r)}),k.set("PublishingToSession");const i=n&&S&&S.video(),o=v.getVideoTracks().length>0,a=null!==_t.videoSource&&!1!==_t.videoSource;i&&o&&a&&Et.push(new ot({id:"video1",type:"video",active:_t.publishVideo,orientation:lt.ROTATED_NORMAL,frameRate:_t.frameRate,width:this.videoWidth(),height:this.videoHeight(),e2ee:t._.isE2ee(),source:zt?"screen":jt?"custom":"camera",fitMode:_t.fitMode}));const l=v.getAudioTracks().length>0;return null!==_t.audioSource&&!1!==_t.audioSource&&l&&(Et.push(new ot({id:"audio1",type:"audio",active:_t.publishAudio})),Et.push(new ot({id:"caption1",type:"data",active:_t.publishCaptions}))),Vt&&Et.push(new ot({id:"downlinkStats1",type:"data",active:!0})),this._.streamChannels=Et,Pe.debug("publishToSession: creating rumor stream id"),new e((e,t)=>{zn(null,(n,r,i)=>{n?t(s(n)):e({streamId:r,message:i})})})}).then(e=>{if(void 0===e)return;const t=e.streamId,n=e.message;if(Pe.debug("publishToSession: rumor stream id created:",t,"(this is different from stream#created, which requires media to actually be flowing for mantis sessions)"),t!==this.streamId)throw new Error("streamId response does not match request");this.streamId=t,D=tt(n)}).catch(e=>{throw this.trigger("publishComplete",e),e});return e.all([d,c])},unpublishFromSession:(e,t)=>{if(!this.session||e.id!==this.session.id){if("unpublished"===t){const t=this.session&&this.session.id||"no session";Pe.warn(`The publisher ${wt} is trying to unpublish from a session ${e.id} it is not attached to (it is attached to ${t})`)}return this}if(e.isConnected()&&(this.stream||k.isAttemptingToPublish())&&e._.streamDestroy(this.streamId),B.releaseAll(),R.empty(),this.disconnect(),k.isAttemptingToPublish()){on("Cancel",{reason:"unpublish"});const e=new Error((()=>{switch(t){case"mediaStopped":return"The video element fired the ended event, indicating there is an issue with the media";case"unpublished":return"The publisher was unpublished before it could be published";case"reset":return"The publisher was reset";default:return"The publisher was destroyed due to "+t}})());this.trigger("publishComplete",qe("mediaStopped"===t?Ke.MEDIA_ENDED:Ke.CANCEL,e))}return this.session=null,nn("unpublish","Success"),this._.streamDestroyed(t),this},unpublishStreamFromSession:(e,t,n)=>e.id!==this.streamId?(Pe.warn(`The publisher ${wt} is trying to destroy a stream ${e.id} that is not attached to it`),this):this._.unpublishFromSession(t,n),startMigration:(Mr=(0,o.default)(i.default.mark((function e(){var t,r,o,a,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k.set("Migrating"),nn("Migrate","Attempt"),nr(),e.next=5,Yn();case 5:if(null==(a=e.sent)||a.setSendMessage(tr("P2P")),null==(t=ft)||t.setSocket(n.session._.getSocket()),l=e=>{if(e)throw new Error(e)},null==(r=n.session)||null==(o=r.sessionInfo)||!o.p2pEnabled){e.next=13;break}zn("P2P",l),e.next=17;break;case 13:return e.next=15,Tn();case 15:pe=e.sent,zn("MANTIS",l);case 17:case"end":return e.stop()}}),e)}))),function(){return Mr.apply(this,arguments)}),finishMigration:()=>{var e,t;clearTimeout(Fe);const n=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=7;break}return e.next=3,Kn.removePeerConnection(t);case 3:n=p(t),r=n.peerConnectionId,delete Dt[r],t.off("iceConnectionStateChange"),t.destroy();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var r;(n(pe),pe=null,null!=(e=this.session)&&null!=(t=e.sessionInfo)&&t.isAdaptiveEnabled&&"MANTIS"===oe)&&(null==(r=Yn())||r.then(n));k.set("Publishing"),nn("Migrate","Success")},streamDestroyed:e=>{["reset"].indexOf(e)<0&&(k.isDestroyed()||k.set("MediaBound"));const t=new Le.StreamEvent("streamDestroyed",this.stream,e,!0);this.dispatchEventOnce(t,this.streamId),t.isDefaultPrevented()||this.destroy(),this.streamId=null},archivingStatus:e=>(wn&&wn.setArchivingStatus(e),e),webRtcStream:()=>v,switchTracks:()=>(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,qt().catch(kt);case 3:t=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),Pe.error("OT.Publisher.switchTracks failed to getUserMedia: "+e.t0),e.t0;case 10:n=t,Fn(),v=n,r.emit("streamChange"),G=new _e(v,!_t.publishAudio),e.prev=11,mn(),e.next=21;break;case 15:if(e.prev=15,e.t1=e.catch(11),!(e.t1 instanceof b.CancellationError)){e.next=19;break}return e.abrupt("return");case 19:throw Pe.error("Error while binding video",e.t1),e.t1;case 21:e.prev=21,Rr(),e.next=29;break;case 25:throw e.prev=25,e.t2=e.catch(21),Pe.error("Error replacing tracks",e.t2),e.t2;case 29:case"end":return e.stop()}var n}),e,null,[[0,6],[11,15],[21,25]])})))(),getDataChannel(e,t,n){const r=Xn(Object.keys(Dt)[0]);r?r.then(r=>{r.getDataChannel(e,t,n)}):n(new et.Error("Cannot create a DataChannel before there is a subscriber."))},iceRestart(e){void 0===e&&(e=!1),Nn().then(t=>{t.forEach(t=>{const n=p(t).remoteConnectionId;an("Attempt",{remoteConnectionId:n}),Pe.debug("Publisher: ice restart attempt"),t.iceRestart(),e&&t.generateOffer()})})},getState:()=>k,demoOnlyCycleVideo:this.cycleVideo,testOnlyGetFramesEncoded:()=>(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nn();case 2:if((t=e.sent).length){e.next=5;break}throw new Error("No established PeerConnections yet");case 5:return e.abrupt("return",t[0]._testOnlyGetFramesEncoded());case 6:case"end":return e.stop()}}),e)})))(),onStreamAvailable:bn,startRoutedToRelayedTransition:()=>{l.startTransitionToRelayed(),_n()},startRelayedToRoutedTransition:()=>{l.startTransitionToRouted(qn)},forceMuteAudio:function(){nn("publishAudio","Attempt",{publishAudio:!1}),_t.publishAudio=!1;try{lr("auto"),this.dispatchEvent(new Le.MuteForcedEvent),nn("publishAudio","Success",{publishAudio:!1})}catch(e){nn("publishAudio","Failure",{message:e.message})}}.bind(this),setCongestionLevel:(xr=(0,o.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Zr){e.next=15;break}if(!n){e.next=8;break}return e.next=4,Xn(n);case 4:e.t1=e.sent,e.t0=[e.t1],e.next=11;break;case 8:return e.next=10,Nn();case 10:e.t0=e.sent;case 11:e.t0.forEach(e=>{e.setCongestionLevel(t)}),e.next=16;break;case 15:Pe.warn("Audio Fallback is not enabled");case 16:case"end":return e.stop()}}),e)}))),function(e,t){return xr.apply(this,arguments)})},this.detectDevices=function(){Pe.warn("Publisher.detectDevices() is not implemented.")},this.detectMicActivity=function(){Pe.warn("Publisher.detectMicActivity() is not implemented.")},this.getEchoCancellationMode=function(){return Pe.warn("Publisher.getEchoCancellationMode() is not implemented."),"fullDuplex"},this.setMicrophoneGain=function(){Pe.warn("Publisher.setMicrophoneGain() is not implemented.")},this.getMicrophoneGain=function(){return Pe.warn("Publisher.getMicrophoneGain() is not implemented."),.5},this.setCamera=function(){Pe.warn("Publisher.setCamera() is not implemented.")},this.setMicrophone=function(){Pe.warn("Publisher.setMicrophone() is not implemented.")},this.guid=function(){return wt},this.videoElement=function(){const e=S&&S.video();return e?e.domElement():null},this.setStream=e=>{if("PublishingToSession"!==k.current&&!k.isPublishing())throw new Error("assignStream called when publisher is not successfully publishing");B.releaseAll(),this.stream=e,this.stream.on("destroyed",this.disconnect,this),B.add(()=>{this.stream&&this.stream.off("destroyed",this.disconnect,this)}),k.isMigrating()||(k.set("Publishing"),J=Date.now(),this.dispatchEvent(new Le.StreamEvent("streamCreated",e,null,!1))),S.loading(!xt),on("Success"),this.trigger("publishComplete",null,this),R.releaseAll()},this.isWebRTC=!0,this.isLoading=function(){return S&&S.loading()},this.videoWidth=()=>hn().width,this.videoHeight=()=>hn().height,this.getStats=function(e){dn(),((e,t)=>{Ln(e,null,t)})(de.default.SDK,(t,n)=>{t?e(t):e(null,n)})},this.getRtcStatsReport=()=>(un(),new e((e,t)=>{var n;n=de.default.SDK_RAW,Ln(n,"rtcStatsReport",(n,r)=>{n?t(n):e(r)})})),k=new it(e=>{Pe.error("OT.Publisher State Change Failed: ",e.message),Pe.debug(e)}),this.accessAllowed=!1,this.applyVideoFilter=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(0,x.default)(t),nn("applyVideoFilter","Attempt",{videoFilter:r}),e.prev=2,!ce){e.next=5;break}throw qe(Ke.NOT_SUPPORTED,new Error("Cannot apply video filter when videoMediaProcessorConnector is set."));case 5:if(ut.isSupported()){e.next=8;break}throw qe(Ke.NOT_SUPPORTED,new Error("Browser does not support video filters (Insertable Streams and Worker APIs are required)"));case 8:if(St.isValidVideoFilter(t)){e.next=10;break}throw qe(Ke.INVALID_PARAMETER,new Error("Video filter has invalid configuration"));case 10:if(v){e.next=15;break}return nn("applyVideoFilter","Failure",{message:o="Ignoring. No mediaStream"}),Pe.warn(o),e.abrupt("return");case 15:if(!zt){e.next=17;break}throw qe(Ke.INVALID_PARAMETER,new Error("Video filters can not be applied to screen share"));case 17:if(rn(),_t.publishVideo){e.next=22;break}return Fr=t,nn("applyVideoFilter","Success",{videoFilter:r}),e.abrupt("return");case 22:if(!St.getVideoFilter()){e.next=37;break}if(!St.canUpdateVideoFilter(t.type)){e.next=35;break}return e.prev=24,e.next=27,St.updateVideoFilter(t);case 27:return Fr=t,nn("applyVideoFilter","Success",{videoFilter:r}),e.abrupt("return");case 32:e.prev=32,e.t0=e.catch(24),Pe.warn("Error updating video filter: "+e.t0);case 35:return e.next=37,n.clearVideoFilter();case 37:if(a=v.getVideoTracks(),l=a[0]){e.next=43;break}return nn("applyVideoFilter","Failure",{message:o="Ignoring. No video"}),Pe.warn(o),e.abrupt("return");case 43:return e.next=45,St.setVideoFilter(t);case 45:return e.next=47,St.setMediaStream(v);case 47:if(!(c=e.sent)){e.next=51;break}return e.next=51,Ir(l,c);case 51:e.next=58;break;case 53:throw e.prev=53,e.t1=e.catch(2),Pe.error("Error applying video filter: "+e.t1),nn("applyVideoFilter","Failure",{message:e.t1.message}),e.t1;case 58:Fr=t,nn("applyVideoFilter","Success",{videoFilter:r});case 60:case"end":return e.stop()}}),e,null,[[2,53],[24,32]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>(nn("getVideoFilter","Attempt"),nn("getVideoFilter","Success"),Fr||null),this.applyAudioFilter=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("applyAudioFilter","Attempt",{audioFilter:t}),ut.isSupported()){e.next=4;break}throw qe(Ke.NOT_SUPPORTED,new Error("Browser does not support audio filters (Insertable Streams and Worker APIs are required)"));case 4:if((0,Ie.default)(t)){e.next=6;break}throw qe(Ke.INVALID_PARAMETER,new Error("Audio filter has invalid configuration"));case 6:if(!se){e.next=8;break}throw qe(Ke.NOT_SUPPORTED,new Error("Cannot apply audio filter when audioMediaProcessorConnector is set."));case 8:if(v){e.next=13;break}return nn("applyAudioFilter","Failure",{message:r="Ignoring. No mediaStream"}),Pe.warn(r),e.abrupt("return");case 13:if(_t.publishAudio){e.next=17;break}return pr=t,nn("applyAudioFilter","Success",{audioFilter:t}),e.abrupt("return");case 17:if(!n.getAudioFilter()){e.next=20;break}return e.next=20,n.clearAudioFilter();case 20:if(e.prev=20,"advancedNoiseSuppression"!==t.type){e.next=32;break}return o=(0,ye.default)({proxyUrl:(0,Ee.getProxyUrl)()}),a=o.assetsDirBaseUrl,l=ht(),e.next=26,l.init({assetsDirBaseUrl:a});case 26:return e.next=28,l.getConnector();case 28:return c=e.sent,e.next=31,Hr(c);case 31:pr=t;case 32:e.next=39;break;case 34:throw e.prev=34,e.t0=e.catch(20),Pe.error("Error applying audio filter: "+e.t0),nn("applyAudioFilter","Failure",{message:e.t0.message}),e.t0;case 39:nn("applyAudioFilter","Success");case 40:case"end":return e.stop()}}),e,null,[[20,34]])})));return function(t){return e.apply(this,arguments)}}(),this.clearAudioFilter=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("clearAudioFilter","Attempt"),_t.publishAudio||!n.getAudioFilter()){e.next=5;break}return pr=null,nn("clearAudioFilter","Success"),e.abrupt("return");case 5:if(ut.isSupported()){e.next=10;break}return nn("clearAudioFilter","Success",{message:t='Ignoring. "clearAudioFilter" not supported.'}),Pe.warn(t),e.abrupt("return");case 10:if(n.getAudioFilter()){e.next=15;break}return nn("clearAudioFilter","Success",{message:t="Ignoring. No audio filter applied"}),Pe.debug(t),e.abrupt("return");case 15:if(v){e.next=20;break}return nn("clearAudioFilter","Success",{message:t="Ignoring. No mediaStream"}),Pe.warn(t),e.abrupt("return");case 20:return e.prev=20,e.next=23,Hr(null);case 23:pr=null,e.next=30;break;case 26:return e.prev=26,e.t0=e.catch(20),nn("clearAudioFilter","Failure",{error:e.t0}),e.abrupt("return");case 30:nn("clearAudioFilter","Success");case 31:case"end":return e.stop()}}),e,null,[[20,26]])}))),this.getAudioFilter=()=>(nn("getAudioFilter","Attempt"),nn("getAudioFilter","Success"),pr||null),this.setVideoMediaProcessorConnector=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("setVideoMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),!n.getVideoFilter()){e.next=4;break}throw nn("setVideoMediaProcessorConnector","Failure",{message:"Tried to set video MediaProcessorConnector when video filter applied."}),qe(Ke.NOT_SUPPORTED,new Error("setVideoMediaProcessorConnector: Cannot use this method when videoFilter is set."));case 4:if(!ce){e.next=14;break}return r=v.getVideoTracks(),o=r[0],e.next=8,yr(Qr);case 8:return a=e.sent,e.next=11,Ir(o,a);case 11:ce.destroy(),ce.stopOriginalTrack(),ce=null;case 14:if(t){e.next=17;break}return nn("setVideoMediaProcessorConnector","Success",{message:"clearing the connector"}),e.abrupt("return");case 17:if(At.isValidConnector(t)){e.next=20;break}throw nn("setVideoMediaProcessorConnector","Failure",{message:"Invalid MediaProcessorConnector"}),qe(Ke.INVALID_PARAMETER,new Error("setVideoMediaProcessorConnector: Tried to set invalid MediaProcessorConnector"));case 20:if(ce=new At(t),l=v.getVideoTracks(),c=l[0]){e.next=28;break}return nn("setVideoMediaProcessorConnector","Failure",{message:s="Connector not set as no video track is present."}),Pe.warn("setVideoMediaProcessorConnector: "+s),ce=null,e.abrupt("return");case 28:return e.prev=28,e.next=31,ce.setTrack(c);case 31:return o=e.sent,e.next=34,Ir(c,o);case 34:e.next=42;break;case 36:throw e.prev=36,e.t0=e.catch(28),ce=null,Pe.error("setVideoMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),nn("setVideoMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 42:nn("setVideoMediaProcessorConnector","Success");case 43:case"end":return e.stop()}}),e,null,[[28,36]])})));return function(t){return e.apply(this,arguments)}}(),this.setAudioMediaProcessorConnector=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return nn("setAudioMediaProcessorConnector","Attempt",{message:t?"setting the connector":"clearing the connector"}),e.prev=1,e.next=4,Hr(t);case 4:nn("setAudioMediaProcessorConnector","Success",{message:t?void 0:"clearing the connector"}),e.next=11;break;case 7:throw e.prev=7,e.t0=e.catch(1),nn("setAudioMediaProcessorConnector","Failure",{message:e.t0.message}),e.t0;case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t){return e.apply(this,arguments)}}();const Hr=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,a,l,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.getAudioFilter()||!t){e.next=3;break}throw r="Tried to set audio MediaProcessorConnector when audio filter applied.",qe(Ke.NOT_SUPPORTED,new Error(r));case 3:if(!se){e.next=9;break}return o=v.getAudioTracks(),a=o[0],e.next=7,vr(a,se.originalTrack);case 7:se.destroy(),se=null;case 9:if(t){e.next=11;break}return e.abrupt("return");case 11:if(At.isValidConnector(t)){e.next=14;break}throw r="Invalid MediaProcessorConnector",qe(Ke.INVALID_PARAMETER,new Error(r));case 14:if(l=v.getAudioTracks(),c=l[0]){e.next=20;break}throw r="Connector not set as no audio track is present.",Pe.warn("setAudioMediaProcessorConnector: "+r),se=null,new Error(r);case 20:return se=new At(t),e.prev=21,e.next=24,se.setTrack(c);case 24:return a=e.sent,e.next=27,vr(n._getAudioSource(),a);case 27:e.next=34;break;case 29:throw e.prev=29,e.t0=e.catch(21),se=null,Pe.error("setAudioMediaProcessorConnector: Error getting track from MediaProcessorConnector: "+e.t0),e.t0;case 34:case"end":return e.stop()}}),e,null,[[21,29]])})));return function(t){return e.apply(this,arguments)}}();this.clearVideoFilter=(0,o.default)(i.default.mark((function e(){var t,n,r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("clearVideoFilter","Attempt"),_t.publishVideo||St.getVideoFilter()){e.next=5;break}return Fr=null,nn("clearVideoFilter","Success"),e.abrupt("return");case 5:if(St.getVideoFilter()||Fr){e.next=10;break}return nn("clearVideoFilter","Success",{message:t="Ignoring. No video filter applied"}),Pe.debug(t),e.abrupt("return");case 10:if(ut.isSupported()){e.next=15;break}return nn("clearVideoFilter","Success",{message:t='Ignoring. "clearVideoFilter" not supported.'}),Pe.warn(t),e.abrupt("return");case 15:if(v){e.next=20;break}return nn("clearVideoFilter","Success",{message:t="Ignoring. No mediaStream"}),Pe.warn(t),e.abrupt("return");case 20:return n=Fr,Fr=null,r=v.getVideoTracks(),o=r[0],e.prev=23,e.next=26,yr(Qr);case 26:a=e.sent,e.next=33;break;case 29:return e.prev=29,e.t0=e.catch(23),Pe.error(e.t0),e.abrupt("return");case 33:if(a){e.next=36;break}return Pe.warn("Failed to clear filter because there is no video track."),e.abrupt("return");case 36:return e.prev=36,e.next=39,Ir(o,a);case 39:return e.next=41,Ar();case 41:e.next=46;break;case 43:e.prev=43,e.t1=e.catch(36),Fr=n;case 46:nn("clearVideoFilter","Success");case 47:case"end":return e.stop()}}),e,null,[[23,29],[36,43]])})));const Kr=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.setMaxBitrate(Ue);case 2:if(!e.sent){e.next=8;break}if(0!==Ue){e.next=6;break}return e.abrupt("return");case 6:"string"==typeof Ue?(_t.videoBitratePreset=Ue.toLowerCase(),_t.videoMaxBitrate=0):(_t.videoMaxBitrate=Ue,_t.videoBitratePreset="custom");case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.getMaxVideoBitrate=()=>_t.videoMaxBitrate,this.getVideoBitratePreset=()=>_t.videoBitratePreset;const Lr=function(){var t=(0,o.default)(i.default.mark((function t(r){var a,l,c;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==Ue){t.next=2;break}return t.abrupt("return");case 2:if((a=isNaN(Ue)?{Preset:Ue.toLowerCase()}:0===Ue?{Preset:"default"}:{BitrateBps:Ue}).NearestResolution=(0,Ne.default)(n.videoWidth(),n.videoHeight()),nn("SetMaxVideoBitrateOnRtpSender","Attempt",{},a),l=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Kr(t);case 3:nn("SetMaxVideoBitrateOnRtpSender","Success",{},a),e.next=11;break;case 6:throw e.prev=6,e.t0=e.catch(0),a.failureReason=e.t0.message,nn("SetMaxVideoBitrateOnRtpSender","Failure",{},a),qe(Ke.UNEXPECTED_ERROR_CODE,new Error("An unexpected error was encountered"));case 11:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),!r){t.next=11;break}return t.next=9,l(r);case 9:t.next=16;break;case 11:return t.next=13,Nn();case 13:return c=t.sent,t.next=16,e.all(c.map(l));case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),zr=()=>{const e={width:{ideal:me},height:{ideal:Re},frameRate:{ideal:Ce}};return v.getVideoTracks().at(0).applyConstraints(e)};this.setPreferredResolution=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,a,l,c,s,d,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("setPreferredResolution","Attempt",{preferredResolution:t}),_t.publishVideo&&null!=(n=v)&&null!=(r=n.getVideoTracks())&&r.length){e.next=5;break}throw nn("setPreferredResolution","Failure",{preferredResolution:t,message:l="setPreferredResolution needs to be called on a video publisher"}),new Error(l);case 5:if(!(!t||!Number.isInteger(t.width)||t.width<=0||!Number.isInteger(t.height)||t.height<=0)){e.next=9;break}throw nn("setPreferredResolution","Failure",{preferredResolution:t,message:l="preferredResolution must be an object with positive integer width and height properties"}),new Error(l);case 9:if(c=(null==(o=_t.videoDimensions)?void 0:o.width)||Ye,s=(null==(a=_t.videoDimensions)?void 0:a.height)||we,d=c*s,!(t.width*t.height>d)){e.next=17;break}throw nn("setPreferredResolution","Failure",{preferredResolution:t,message:l="preferredResolution cannot be higher than the initial publishing resolution"}),new Error(l);case 17:return me=t.width,Re=t.height,e.prev=19,e.next=22,zr();case 22:return u=e.sent,nn("setPreferredResolution","Success",{preferredResolution:t}),e.abrupt("return",u);case 27:throw e.prev=27,e.t0=e.catch(19),nn("setPreferredResolution","Failure",{preferredResolution:t,message:e.t0.message}),e.t0;case 31:case"end":return e.stop()}}),e,null,[[19,27]])})));return function(t){return e.apply(this,arguments)}}(),this.setPreferredFrameRate=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(nn("setPreferredFrameRate","Attempt",{frameRate:t}),_t.publishVideo&&null!=(n=v)&&null!=(r=n.getVideoTracks())&&r.length){e.next=5;break}throw nn("setPreferredFrameRate","Failure",{frameRate:t,message:o="setPreferredFrameRate needs to be called on a video publisher"}),new Error(o);case 5:if(Number.isInteger(t)&&!(t<1)){e.next=9;break}throw nn("setPreferredFrameRate","Failure",{frameRate:t,message:o="Invalid frameRate: must be an integer ≥ 1"}),new Error(o);case 9:return Ce=t,e.prev=10,e.next=13,zr();case 13:return a=e.sent,nn("setPreferredFrameRate","Success",{frameRate:t}),e.abrupt("return",a);case 18:throw e.prev=18,e.t0=e.catch(10),nn("setPreferredFrameRate","Failure",{frameRate:t,message:e.t0.message}),e.t0;case 22:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(t){return e.apply(this,arguments)}}(),this.setMaxVideoBitrate=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("number"==typeof t){e.next=2;break}throw qe(Ke.INVALID_PARAMETER,new Error("Invalid bitrate: it must be 0 or any number between 5000 and 10000000"));case 2:if(n=parseInt(t,10),!(isNaN(n)||0!==n&&(n<5e3||n>1e7))){e.next=5;break}throw qe(Ke.INVALID_PARAMETER,new Error("Invalid bitrate: it must be 0 or any number between 5000 and 10000000"));case 5:if(Ue=0===n?Ge.default.DEFAULT:n,Sn()){e.next=11;break}return e.next=9,Lr();case 9:e.next=12;break;case 11:Pe.debug("Video is currently inactive, max bitrate will be applied once active.");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.setVideoBitratePreset=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof t){e.next=2;break}throw qe(Ke.INVALID_PARAMETER,new Error('Invalid preset. It must be either "default", "bw_saver", or "extra_bw_saver"'));case 2:if(void 0!==(n=Ge.default[t.toUpperCase()])){e.next=5;break}throw qe(Ke.INVALID_PARAMETER,new Error('Invalid preset. It must be either "default", "bw_saver", or "extra_bw_saver"'));case 5:if(Ue=n,Sn()){e.next=11;break}return e.next=9,Lr();case 9:e.next=12;break;case 11:Pe.debug("Video is currently inactive, bitrate preset will be applied once active.");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._getVideoMaxBitrateSetting=()=>Ue}};var i=r(n(4)),o=r(n(5)),a=r(n(347)),l=r(n(348)),c=r(n(61)),s=r(n(10)),d=r(n(64)),u=r(n(77)),A=r(n(307)),h=r(n(51)),g=r(n(53)),Q=r(n(749)),F=r(n(283)),p=r(n(160)),U=r(n(20)),m=r(n(213)),b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=Xe(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(115)),B=n(759),Z=r(n(79)),f=n(28),R=r(n(760)),I=r(n(7)),y=r(n(2)),V=r(n(96)),C=r(n(3)),W=r(n(22)),E=r(n(762)),S=r(n(75)),v=r(n(9)),J=r(n(23)),N=n(318),G=r(n(155)),X=r(n(30)),k=r(n(31)),T=r(n(178)),Y=r(n(342)),w=r(n(295)),D=r(n(14)),x=r(n(349)),M=r(n(6)),H=r(n(148)),K=r(n(168)),L=r(n(763)),z=r(n(179)),O=r(n(764)),j=r(n(180)),P=r(n(765)),_=r(n(766)),q=r(n(767)),$=r(n(183)),ee=r(n(278)),te=r(n(310)),ne=r(n(159)),re=r(n(17)),ie=r(n(173)),oe=r(n(320)),ae=r(n(8)),le=n(111),ce=r(n(292)),se=r(n(321)),de=r(n(39)),ue=r(n(330)),Ae=r(n(162)),he=r(n(164)),ge=r(n(345)),Qe=r(n(768)),Fe=r(n(184)),pe=r(n(774)),Ue=r(n(775)),me=r(n(776)),be=r(n(778)),Be=n(779),Ze=r(n(337)),fe=r(n(339)),Re=r(n(181)),Ie=r(n(780)),ye=r(n(781)),Ve=r(n(782)),Ce=r(n(783)),We=r(n(784)),Ee=n(73),Se=r(n(785)),ve=r(n(786)),Je=r(n(787)),Ne=r(n(328)),Ge=r(n(327));function Xe(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(Xe=function(e){return e?n:t})(e)}const ke=(0,z.default)(),Te=(0,W.default)().getInputMediaDevices,Ye=640,we=480}).call(this,n(1))},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";(function(e,r){var i=n(0);t.__esModule=!0,t.WebglSelfieSegmentationType=t.WarningType=t.VonageMediaProcessor=t.RenderingType=t.PipelineInfoData=t.MediapipeHelper=t.ErrorFunction=t.BlurRadius=t.BackgroundTransformerType=t.BackgroundTransformer=void 0,t.createVonageMediaProcessor=function(e){return xo.apply(this,arguments)},t.getSupportedBrowserFeatures=ve,t.getVonageFaceDetection=function(){return Ye},t.getVonageFaceMash=function(){return we},t.getVonageHands=function(){return ke},t.getVonageHolistic=function(){return Te},t.getVonageObjectron=function(){return De},t.getVonagePose=function(){return xe},t.getVonageSelfieSegmentation=function(){return Xe},t.isSupported=function(){return Se.apply(this,arguments)};var o=i(n(4)),a=i(n(24)),l=i(n(26)),c=i(n(5)),s=function(e){function t(){var t=this||self;return delete e.prototype.__magic__,t}return"object"==typeof globalThis?globalThis:this?t():(e.defineProperty(e.prototype,"__magic__",{configurable:!0,get:t}),__magic__)}(Object);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(){return new e((e,t)=>{typeof MediaStreamTrackProcessor>"u"||typeof MediaStreamTrackGenerator>"u"?t("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):e()})}let Q=function(){};function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Q.updates={transformer_new:"New transformer",transformer_null:"Null transformer"},Q.errors={transformer_none:"No transformers provided",transformer_start:"Cannot start transformer",transformer_transform:"Cannot transform frame",transformer_flush:"Cannot flush transformer",readable_null:"Readable is null",writable_null:"Writable is null"};const p=new WeakMap,U=new WeakMap,m=new WeakMap,b=Symbol("anyProducer"),B=e.resolve(),Z=Symbol("listenerAdded"),f=Symbol("listenerRemoved");let R=!1;function I(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function y(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function V(e,t){const n=U.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function C(e,t){const n="string"==typeof t||"symbol"==typeof t?t:b,r=m.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function W(t,n,r){const i=m.get(t);if(i.has(n))for(var o,a=A(i.get(n));!(o=a()).done;){o.value.enqueue(r)}if(i.has(b)){const t=e.all([n,r]);for(var l,c=A(i.get(b));!(l=c()).done;){l.value.enqueue(t)}}}function E(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},a=[];const l={enqueue(e){a.push(e),i()},finish(){r=!0,i()}};for(var s,d=A(n);!(s=d()).done;){const e=s.value;C(t,e).add(l)}return{next(){var t=this;return(0,c.default)(o.default.mark((function n(){return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!a){n.next=20;break}if(0!==a.length){n.next=12;break}if(!r){n.next=6;break}n.t2=(a=void 0,t.next()),n.next=9;break;case 6:return n.next=8,new e(e=>{i=e});case 8:n.t2=t.next();case 9:n.t1=n.t2,n.next=17;break;case 12:return n.t3=!1,n.next=15,a.shift();case 15:n.t4=n.sent,n.t1={done:n.t3,value:n.t4};case 17:n.t0=n.t1,n.next=21;break;case 20:n.t0={done:!0};case 21:return n.abrupt("return",n.t0);case 22:case"end":return n.stop()}}),n)})))()},return(e){var r=arguments;return(0,c.default)(o.default.mark((function c(){var s,d,u;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:for(a=void 0,s=A(n);!(d=s()).done;)u=d.value,C(t,u).delete(l);if(i(),!(r.length>0)){o.next=11;break}return o.t1=!0,o.next=7,e;case 7:o.t2=o.sent,o.t0={done:o.t1,value:o.t2},o.next=12;break;case 11:o.t0={done:!0};case 12:return o.abrupt("return",o.t0);case 13:case"end":return o.stop()}}),c)})))()},[Symbol.asyncIterator](){return this}}}function S(e){if(void 0===e)return N;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(var t,n=A(e);!(t=n()).done;){const e=t.value;if(!N.includes(e))throw"string"!=typeof e?new TypeError("`methodNames` element must be a string"):new Error(e+" is not Emittery method")}return e}const v=e=>e===Z||e===f;let J=function(){function t(e){void 0===e&&(e={}),p.set(this,new Set),U.set(this,new Map),m.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{try{r=JSON.stringify(r)}catch(e){r="Object with the following keys failed to stringify: "+Object.keys(r).join(",")}"symbol"==typeof n&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}t.mixin=function(e,n){return n=S(n),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(var i,o=A(n);!(i=o()).done;){const e=i.value;if(void 0!==r.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``)}Object.defineProperty(r.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new t}),this[e]}});const a=t=>function(){return this[e][t](...arguments)};for(var l,c=A(n);!(l=c()).done;){const e=l.value;Object.defineProperty(r.prototype,e,{enumerable:!1,value:a(e)})}return r}};var n=t.prototype;return n.logIfDebugEnabled=function(e,n,r){(t.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,n,r)},n.on=function(e,t){y(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;I(e),V(this,e).add(t),this.logIfDebugEnabled("subscribe",e,void 0),v(e)||this.emit(Z,{eventName:e,listener:t})}return this.off.bind(this,e,t)},n.off=function(e,t){y(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;I(e),V(this,e).delete(t),this.logIfDebugEnabled("unsubscribe",e,void 0),v(e)||this.emit(f,{eventName:e,listener:t})}},n.once=function(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})},n.events=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){I(t.value)}return E(this,e)},n.emit=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i,a,l,s;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return I(n),this.logIfDebugEnabled("emit",n,r),W(this,n,r),i=V(this,n),a=p.get(this),l=[...i],s=v(n)?[]:[...a],t.next=4,B;case 4:return t.next=6,e.all([...l.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.has(t)){e.next=2;break}return e.abrupt("return",t(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),...s.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.has(t)){e.next=2;break}return e.abrupt("return",t(n,r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 6:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.emitSerial=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d,u,A;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(t),this.logIfDebugEnabled("emitSerial",t,n),r=V(this,t),i=p.get(this),a=[...r],l=[...i],e.next=4,B;case 4:c=0,s=a;case 5:if(!(c<s.length)){e.next=14;break}if(d=s[c],e.t0=r.has(d),!e.t0){e.next=11;break}return e.next=11,d(n);case 11:c++,e.next=5;break;case 14:u=0,A=l;case 15:if(!(u<A.length)){e.next=24;break}if(d=A[u],e.t1=i.has(d),!e.t1){e.next=21;break}return e.next=21,d(t,n);case 21:u++,e.next=15;break;case 24:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),n.onAny=function(e){return y(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),p.get(this).add(e),this.emit(Z,{listener:e}),this.offAny.bind(this,e)},n.anyEvent=function(){return E(this)},n.offAny=function(e){y(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(f,{listener:e}),p.get(this).delete(e)},n.clearListeners=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){const e=t.value;if(this.logIfDebugEnabled("clear",e,void 0),"string"==typeof e||"symbol"==typeof e){V(this,e).clear();const t=C(this,e);for(var r,i=A(t);!(r=i()).done;){r.value.finish()}t.clear()}else{p.get(this).clear();for(var o,a=A(U.get(this).values());!(o=a()).done;){o.value.clear()}for(var l,c=A(m.get(this).values());!(l=c()).done;){const e=l.value;for(var s,d=A(e);!(s=d()).done;){s.value.finish()}e.clear()}}}},n.listenerCount=function(e){let t=0;for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;if("string"!=typeof e){typeof e<"u"&&I(e),t+=p.get(this).size;for(var i,o=A(U.get(this).values());!(i=o()).done;){t+=i.value.size}for(var a,l=A(m.get(this).values());!(a=l()).done;){t+=a.value.size}}else t+=p.get(this).size+V(this,e).size+C(this,e).size+C(this).size}return t},n.bindMethods=function(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");for(var n,r=A(t=S(t));!(n=r()).done;){const t=n.value;if(void 0!==e[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(e,t,{enumerable:!1,value:this[t].bind(this)})}},(0,l.default)(t,null,[{key:"isDebugEnabled",get:function(){if("object"!=typeof r)return R;const e=(r||{env:{}}).env;return"emittery"===e.DEBUG||"*"===e.DEBUG||R},set:function(e){R=e}}]),t}();const N=Object.getOwnPropertyNames(J.prototype).filter(e=>"constructor"!==e);Object.defineProperty(J,"listenerAdded",{value:Z,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(J,"listenerRemoved",{value:f,writable:!1,enumerable:!0,configurable:!1});const G=F(J);function X(e){return function(e){if(function(e){return"object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message}(e))return e;try{return new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}}(e).message}var k=Object.defineProperty,T=(e,t,n)=>(((e,t,n)=>{t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,t+"",n),n);let Y;const w=new Uint8Array(16);function D(){if(!Y&&(Y=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Y))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Y(w)}const x=[];for(let e=0;e<256;++e)x.push((e+256).toString(16).slice(1));const M={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function H(e,t,n){if(M.randomUUID&&!t&&!e)return M.randomUUID();const r=(e=e||{}).random||(e.rng||D)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t){return void 0===t&&(t=0),(x[e[t+0]]+x[e[t+1]]+x[e[t+2]]+x[e[t+3]]+"-"+x[e[t+4]]+x[e[t+5]]+"-"+x[e[t+6]]+x[e[t+7]]+"-"+x[e[t+8]]+x[e[t+9]]+"-"+x[e[t+10]]+x[e[t+11]]+x[e[t+12]]+x[e[t+13]]+x[e[t+14]]+x[e[t+15]]).toLowerCase()}(r)}function K(e,t){s.vonage||(s.vonage={}),s.vonage.workerizer||(s.vonage.workerizer={});let n=s.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const L=K("globals",{});var z=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(z||{});function O(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let j=0;function P(t,n,r,i,o){const a=j++;return t.postMessage({id:a,type:n,functionName:r,args:i},i.filter(e=>O(e))),new e(e=>{null==o||o.set(a,e)})}function _(e,t){const n=e.id,r=e.type,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>O(e)))}const q=K("workerized",{});function $(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ee(){return te.apply(this,arguments)}function te(){return(te=(0,c.default)(o.default.mark((function t(){var n,r,i,a,l;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!$()){t.next=4;break}_({type:z.GLOBALS_SYNC},L),t.next=8;break;case 4:for(r in n=[],q)i=q[r].workerContext,a=i.worker,l=i.resolvers,a&&n.push(P(a,z.GLOBALS_SYNC,"",[L],l));return t.next=8,e.all(n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ne(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],ne(e[n],t[n])):"object"==typeof e[n]?(t[n]={},ne(e[n],t[n])):t[n]=e[n]}function re(e,t){return ie.apply(this,arguments)}function ie(){return(ie=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.functionName,i=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(r){e.next=5;break}throw"missing function name to call";case 5:if(n.instance[r]){e.next=7;break}throw`undefined function [${r}] in class ${n.instance.constructor.workerId}`;case 7:return e.t0=_,e.t1=t,e.next=11,n.instance[r](...null!=i?i:[]);case 11:e.t2=e.sent,(0,e.t0)(e.t1,e.t2);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const oe=K("registeredWorkers",{});function ae(e,t){if(!e.args)throw"Missing className while initializing worker";const n=e.args,r=n[0],i=n[1],o=oe[r];if(!o)throw"unknown worker class "+r;t.instance=new o(e.args.slice(1)),ne(i,L),_(e,void 0!==typeof t.instance)}function le(e,t){return ce.apply(this,arguments)}function ce(){return(ce=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(e.t0=n.instance.terminate,!e.t0){e.next=8;break}return e.next=7,n.instance.terminate(...null!=r?r:[]);case 7:i=e.sent;case 8:_(t,i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function se(e){if(!e.args)throw"Missing globals while syncing";ne(e.args[0],L),_(e,{})}$()&&function(){const e={};onmessage=function(){var t=(0,c.default)(o.default.mark((function t(n){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,t.t0=r.type,t.next=t.t0===z.INIT?4:t.t0===z.FORWARD?6:t.t0===z.TERMINATE?8:t.t0===z.GLOBALS_SYNC?10:12;break;case 4:return ae(r,e),t.abrupt("break",12);case 6:return re(r,e),t.abrupt("break",12);case 8:return le(r,e),t.abrupt("break",12);case 10:return se(r),t.abrupt("break",12);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}();const de=function(e,t){return L[e]||(L[e]=t),[()=>L[e],function(){var t=(0,c.default)(o.default.mark((function t(n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L[e]=n,t.next=3,ee();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()]}("metadata",he),ue=de[0],Ae=de[1];var he;function ge(){return ue()}let Qe=function(){function e(e,t){T(this,"uuid"),this.config=e,this.uuid=null!=t?t:H()}var t=e.prototype;return t.send=function(){var e=(0,c.default)(o.default.mark((function e(t){var n,r,i,a,l,c,s,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null!=(n=ge())?n:{},l=a.appId,c=a.sourceType,l&&c){e.next=3;break}return e.abrupt("return","metadata missing");case 3:return s=new AbortController,d=setTimeout(()=>s.abort(),1e4),e.next=6,(null!=(i=null==(r=this.config)?void 0:r.fetch)?i:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(t)),signal:s.signal});case 6:return clearTimeout(d),e.abrupt("return","success");case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getUrl=function(){var e;let t=null!=(e=ge().proxyUrl)?e:"https://";return t+=("/"===t.at(-1)?"":"/")+"hlg.tokbox.com/prod/logging/vcp_webrtc",t},t.getHeaders=function(){return{"Content-Type":"application/json"}},t.buildReport=function(e){const t=ge();return Object.assign({guid:this.uuid},e,{applicationId:t.appId,timestamp:Date.now(),proxyUrl:t.proxyUrl,source:t.sourceType})},e}();const Fe="2.0.4";let pe=function(){function e(e,t){this.config=e,this.frameTransformedCount=0,this.frameFromSourceCount=0,this.startAt=0,this.reporter=new Qe(e,t)}var t=e.prototype;return t.onFrameFromSource=function(){var e=(0,c.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.frameFromSourceCount++;case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.onFrameTransformed=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===t&&(t={}),void 0===n&&(n=!1),0===this.startAt&&(this.startAt=Date.now()),this.frameTransformedCount++,r=this.startAt,i=this.frameTransformedCount,a=this.frameFromSourceCount,l=Date.now(),s=i/(c=(l-r)/1e3),d=a/c,e.abrupt("return",n||this.frameTransformedCount>=this.config.loggingIntervalFrameCount?(this.frameFromSourceCount=0,this.frameTransformedCount=0,this.startAt=l,this.reporter.config=this.config,this.reporter.send(Object.assign({},this.config.report,{variation:"QoS",fps:d,transformedFps:s,framesTransformed:i},t))):"success");case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),(0,l.default)(e,[{key:"fps",get:function(){const e=this.startAt;return this.frameFromSourceCount/((Date.now()-e)/1e3)}}]),e}();var Ue=(e=>(e.FPS_DROP="fps_drop",e))(Ue||{}),me=(e=>(e.start="start",e.transform="transform",e.flush="flush",e))(me||{}),be=(e=>(e.pipeline_ended="pipeline_ended",e.pipeline_ended_with_error="pipeline_ended_with_error",e.pipeline_started="pipeline_started",e.pipeline_started_with_error="pipeline_started_with_error",e.pipeline_restarted="pipeline_restarted",e.pipeline_restarted_with_error="pipeline_restarted_with_error",e))(be||{});t.PipelineInfoData=be,t.ErrorFunction=me,t.WarningType=Ue;let Be=function(e){function t(t,n){var r;return(r=e.call(this)||this).reporter_=new Qe,r.reporterQos_=new pe({loggingIntervalFrameCount:500,report:{version:Fe}}),r.index_=n,r.transformer_=t,r.shouldStop_=!1,r.isFlashed_=!1,r.mediaTransformerQosReportStartTimestamp_=0,r.videoHeight_=0,r.videoWidth_=0,r.trackExpectedRate_=-1,r.transformerType_="Custom","getTransformerType"in t&&(r.transformerType_=t.getTransformerType()),r.report({variation:"Create"}),r}(0,a.default)(t,e);var n=t.prototype;return n.setTrackExpectedRate=function(e){this.trackExpectedRate_=e},n.start=function(){var e=(0,c.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.controller_=t,!this.transformer_||"function"!=typeof this.transformer_.start){e.next=11;break}return e.prev=1,e.next=4,this.transformer_.start(t);case 4:e.next=11;break;case 6:e.prev=6,e.t0=e.catch(1),this.report({message:Q.errors.transformer_start,variation:"Error",error:X(e.t0)}),n={eventMetaData:{transformerIndex:this.index_},error:e.t0,function:"start"},this.emit("error",n);case 11:case"end":return e.stop()}}),e,this,[[1,6]])})));return function(t){return e.apply(this,arguments)}}(),n.transform=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===this.mediaTransformerQosReportStartTimestamp_&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),t instanceof VideoFrame&&(this.videoHeight_=null!=(r=null==t?void 0:t.displayHeight)?r:0,this.videoWidth_=null!=(i=null==t?void 0:t.displayWidth)?i:0),this.reporterQos_.onFrameFromSource(),!this.transformer_){e.next=17;break}if(!this.shouldStop_){e.next=5;break}console.warn("[Pipeline] flush from transform"),t.close(),this.flush(n),n.terminate(),e.next=17;break;case 5:return e.prev=5,e.next=8,null==(l=(a=this.transformer_).transform)?void 0:l.call(a,t,n);case 8:this.reportQos(),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(5),this.report({message:Q.errors.transformer_transform,variation:"Error",error:X(e.t0)}),c={eventMetaData:{transformerIndex:this.index_},error:e.t0,function:"transform"},this.emit("error",c);case 16:-1!=this.trackExpectedRate_&&.8*this.trackExpectedRate_>this.reporterQos_.fps&&(s={eventMetaData:{transformerIndex:this.index_},warningType:"fps_drop",dropInfo:{requested:this.trackExpectedRate_,current:this.reporterQos_.fps}},this.emit("warn",s));case 17:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t,n){return e.apply(this,arguments)}}(),n.flush=function(){var e=(0,c.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.transformer_||"function"!=typeof this.transformer_.flush||this.isFlashed_){e.next=12;break}return this.isFlashed_=!0,e.prev=2,e.next=5,this.transformer_.flush(t);case 5:e.next=12;break;case 7:e.prev=7,e.t0=e.catch(2),this.report({message:Q.errors.transformer_flush,variation:"Error",error:X(e.t0)}),n={eventMetaData:{transformerIndex:this.index_},error:e.t0,function:"flush"},this.emit("error",n);case 12:this.reportQos(!0),this.report({variation:"Delete"});case 13:case"end":return e.stop()}}),e,this,[[2,7]])})));return function(t){return e.apply(this,arguments)}}(),n.stop=function(){console.log("[Pipeline] Stop stream."),this.controller_&&(this.flush(this.controller_),this.controller_.terminate()),this.shouldStop_=!0},n.report=function(e){this.reporter_.send(Object.assign({version:Fe,action:"MediaTransformer",transformerType:this.transformerType_},e))},n.reportQos=function(e){void 0===e&&(e=!1),this.reporterQos_.config=Object.assign({},this.reporterQos_.config),this.reporterQos_.onFrameTransformed({version:Fe,action:"MediaTransformer",transformerType:this.transformerType_,videoWidth:this.videoWidth_,videoHeight:this.videoHeight_},e)},t}(G),Ze=function(e){function t(t){var n;(n=e.call(this)||this).transformers_=[],n.trackExpectedRate_=-1;for(let e=0;e<t.length;e++){let r=new Be(t[e],e);r.on("error",e=>{n.emit("error",e)}),r.on("warn",e=>{n.emit("warn",e)}),n.transformers_.push(r)}return n}(0,a.default)(t,e);var n=t.prototype;return n.setTrackExpectedRate=function(e){this.trackExpectedRate_=e;for(var t,n=A(this.transformers_);!(t=n()).done;){t.value.setTrackExpectedRate(this.trackExpectedRate_)}},n.start=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,s=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.transformers_&&0!==this.transformers_.length){e.next=3;break}return console.log("[Pipeline] No transformers."),e.abrupt("return");case 3:for(e.prev=3,r=t,i=A(this.transformers_);!(a=i()).done;)l=a.value,t=t.pipeThrough(new TransformStream(l));t.pipeTo(n).then((0,c.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("[Pipeline] Setup."),e.next=3,n.abort();case 3:return e.next=5,r.cancel();case 5:s.emit("pipelineInfo","pipeline_ended");case 6:case"end":return e.stop()}}),e)})))).catch(function(){var e=(0,c.default)(o.default.mark((function e(i){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.cancel().then(()=>{console.log("[Pipeline] Shutting down streams after abort.")}).catch(e=>{console.error("[Pipeline] Error from stream transform:",e)}),e.next=3,n.abort(i);case 3:return e.next=5,r.cancel(i);case 5:s.emit("pipelineInfo","pipeline_ended_with_error");case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),this.emit("pipelineInfo","pipeline_started_with_error"),this.destroy(),e.abrupt("return");case 13:this.emit("pipelineInfo","pipeline_started"),console.log("[Pipeline] Pipeline started.");case 14:case"end":return e.stop()}}),e,this,[[3,9]])})));return function(t,n){return e.apply(this,arguments)}}(),n.destroy=function(){var e=(0,c.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(console.log("[Pipeline] Destroying Pipeline."),t=A(this.transformers_);!(n=t()).done;)n.value.stop();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t}(G),fe=function(t){function n(){var e;return(e=t.call(this)||this).reporter_=new Qe,e.trackExpectedRate_=-1,e.report({variation:"Create"}),e}(0,a.default)(n,t);var r=n.prototype;return r.setTrackExpectedRate=function(e){this.trackExpectedRate_=e,this.pipeline_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_)},r.transform=function(e,t){return this.readable_=e,this.writable_=t,this.transformInternal()},r.transformInternal=function(){var t=this;return new e(function(){var e=(0,c.default)(o.default.mark((function e(n,r){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.transformers_&&0!==t.transformers_.length){e.next=3;break}return t.report({message:Q.errors.transformer_none,variation:"Error"}),r("[MediaProcessor] Need to set transformers."),e.abrupt("return");case 3:if(t.readable_){e.next=6;break}return t.report({variation:"Error",message:Q.errors.readable_null}),r("[MediaProcessor] Readable is null."),e.abrupt("return");case 6:if(t.writable_){e.next=9;break}return t.report({variation:"Error",message:Q.errors.writable_null}),r("[MediaProcessor] Writable is null."),e.abrupt("return");case 9:i=!1,t.pipeline_&&(i=!0,t.pipeline_.clearListeners(),t.pipeline_.destroy()),t.pipeline_=new Ze(t.transformers_),t.pipeline_.on("warn",e=>{t.emit("warn",e)}),t.pipeline_.on("error",e=>{t.emit("error",e)}),t.pipeline_.on("pipelineInfo",e=>{i&&("pipeline_started"===e?e=be.pipeline_restarted:"pipeline_started_with_error"===e&&(e=be.pipeline_restarted_with_error)),t.emit("pipelineInfo",e)}),-1!=t.trackExpectedRate_&&t.pipeline_.setTrackExpectedRate(t.trackExpectedRate_),t.pipeline_.start(t.readable_,t.writable_).then(()=>{n()}).catch(e=>{r(e)});case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())},r.setTransformers=function(t){return this.report({variation:"Update",message:Q.updates.transformer_new}),this.transformers_=t,this.readable_&&this.writable_?this.transformInternal():e.resolve()},r.destroy=function(){var t=this;return new e(function(){var e=(0,c.default)(o.default.mark((function e(n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.pipeline_&&t.pipeline_.destroy(),t.report({variation:"Delete"}),n();case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},r.report=function(e){this.reporter_.send(Object.assign({version:Fe,action:"MediaProcessor"},e))},n}(G),Re=function(){function t(){this.processor_=null,this.generator_=null}var n=t.prototype;return n.init=function(t){return new e((e,n)=>{try{this.processor_=new MediaStreamTrackProcessor(t)}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackProcessor failed: "+e),n(e)}try{"audio"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):"video"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):n("kind not supported")}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackGenerator failed: "+e),n(e)}e()})},n.getReadable=function(){return this.processor_.readable},n.getWriteable=function(){return this.generator_.writable},n.getProccesorTrack=function(){return this.generator_},t}(),Ie=function(){function t(e){this.insertableStreamHelper_=new Re,this.mediaProcessor_=e}var n=t.prototype;return n.setTrack=function(t){return new e((e,n)=>{this.insertableStreamHelper_.init(t).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{e(this.insertableStreamHelper_.getProccesorTrack())}).catch(e=>{n(e)})}).catch(e=>{n(e)})})},n.destroy=function(){return new e((e,t)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(e=>{t(e)}):t("no processor")})},t}();var ye=(e=>(e.Low="Low",e.High="High",e))(ye||{}),Ve=(e=>(e.BackgroundBlur="BackgroundBlur",e.VirtualBackground="VirtualBackground",e.VideoBackground="VideoBackground",e.SilhouetteBlur="SilhouetteBlur",e))(Ve||{}),Ce=(e=>(e.FAST="FAST",e.PRECISE="PRECISE",e))(Ce||{}),We=(e=>(e.CANVAS="CANVAS",e.WEBGL="WEBGL",e))(We||{});t.RenderingType=We,t.WebglSelfieSegmentationType=Ce,t.BackgroundTransformerType=Ve,t.BlurRadius=ye;const Ee=function(){var e=(0,c.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function Se(){return(Se=(0,c.default)(o.default.mark((function e(){var t,n,r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ve();case 2:if(t=e.sent,n=t.wasm,r=t.insertableStreams,i=t.simd,a=t.webgl,n.supported){e.next=9;break}throw n.message;case 9:if(r.supported){e.next=11;break}throw r.message;case 11:if(i.supported){e.next=13;break}throw i.message;case 13:if(a.supported){e.next=15;break}throw a.message;case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(){return Je.apply(this,arguments)}function Je(){return(Je=(0,c.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0={supported:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate,message:"Your browser does not support WebAssembly features."},e.next=3,Ee();case 3:return e.t1=e.sent,e.t2={supported:e.t1,message:"Your browser does not support simd features."},e.t3={supported:!0},e.t4={message:"Your browser does not support gpu features.",supported:!0},e.t5=Ne(),e.t6=Ge(),t={wasm:e.t0,simd:e.t2,insertableStreams:e.t3,gpu:e.t4,webgl:e.t5,performance:e.t6},e.prev=10,e.next=13,g();case 13:e.next=18;break;case 15:e.prev=15,e.t7=e.catch(10),t.insertableStreams.supported=!1,t.insertableStreams.message=e.t7;case 18:return e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,null,[[10,15]])})))).apply(this,arguments)}function Ne(){if(!OffscreenCanvas)return{supported:!1,message:"Your browser does not support offscreen canvas"};const e=new OffscreenCanvas(0,0).getContext("webgl2");if(!e)return{supported:!1,message:"Your browser does not support webgl 2"};{const t=null==e?void 0:e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return{supported:!0}}function Ge(){const e=new OffscreenCanvas(0,0).getContext("webgl2",{failIfMajorPerformanceCaveat:!0});if(!e)return{supported:!1,message:"Your hardware does not perform good enough to run the library efficiently"};{const t=null==e?void 0:e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return{supported:!0}}const Xe={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(e,t){return t=new Z(new m(t)),h&&e.prototype&&h(t,e.prototype),t}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s};var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var C,W,E=typeof TextDecoder<"u",S=typeof TextEncoder<"u";function v(e){if(S)e=(W||(W=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var J={},N=null;function G(e,t){void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array.prototype.slice;function w(e,t,n){return t===n?T||(T=new Uint8Array(0)):Y?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var D=0;function x(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.l=!1,this.v=t,e&&M(this,e)}function M(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?X(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.j=0,e.i=e.h.length,e.g=e.j}function H(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&e.g++,r)))))}function K(e){var t=e.h[e.g],n=e.h[e.g+1],r=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,e=2*((n=(t<<0|n<<8|r<<16|i<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))}x.prototype.reset=function(){this.g=this.j};var L=[];function z(){this.g=new Uint8Array(64),this.h=0}function O(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function j(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,L.length?(n=L.pop(),t&&(n.v=t.v),e&&M(n,e),e=n):e=new x(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function P(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.m=e.g.g;var n=7&(t=H(e.g));return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function _(e,t,n){var r=e.g.i,i=H(e.g);return i=e.g.g+i,e.g.i=i,n(t,e),e.g.g=i,e.g.i=r,t}function q(e){var t,n=H(e.g),r=(e=e.g).g;if(e.g+=n,e=e.h,E)(t=C)||(t=C=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(r,r+n));else{n=r+n;for(var i,o,a,l=[],c=null;r<n;)128>(i=e[r++])?l.push(i):224>i?r>=n?l.push(65533):(o=e[r++],194>i||128!=(192&o)?(r--,l.push(65533)):l.push((31&i)<<6|63&o)):240>i?r>=n-1?l.push(65533):128!=(192&(o=e[r++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[r++]))?(r--,l.push(65533)):l.push((15&i)<<12|(63&o)<<6|63&t):244>=i?r>=n-2?l.push(65533):128!=(192&(o=e[r++]))||o-144+(i<<28)>>30||128!=(192&(t=e[r++]))||128!=(192&(a=e[r++]))?(r--,l.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&a,i-=65536,l.push(55296+(i>>10&1023),56320+(1023&i))):l.push(65533),8192<=l.length&&(c=V(c,l),l.length=0);t=V(c,l)}return t}function $(){this.h=[],this.i=0,this.g=new z}function ee(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function te(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var n=e.h,r=n.length,i=0,o=0;o<r;o++){var a=n[o];0!==a.length&&(t.set(a,i),i+=a.length)}return 0!==(r=(n=e.g).h)&&(t.set(n.g.subarray(0,r),i),n.h=0),e.h=[t],t}function ne(e,t,n){if(null!=n){O(e.g,8*t+5),e=e.g;var r=n;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?D=0:(0,D=2147483648):isNaN(r)?(0,D=2147483647):34028234663852886e22<r?(0,D=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,D=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),r=8388607&Math.round(8388608*r),0,D=(n<<31|t+127<<23|r)>>>0),n=D,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}z.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},z.prototype.length=function(){return this.h},z.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,w(e,0,t)},j.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var re="function"==typeof Uint8Array;function ie(e,t,n){if(null!=e)return"object"==typeof e?re&&e instanceof Uint8Array?n(e):oe(e,t,n):t(e)}function oe(e,t,n){if(Array.isArray(e)){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=ie(e[i],t,n);return Array.isArray(e)&&e.W&&se(r),r}for(i in r={},e)r[i]=ie(e[i],t,n);return r}function ae(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var le,ce={W:{value:!0,configurable:!0}};function se(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,ce),e}function de(e,t,n){var r=le;if(le=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=r?0:-1,this.i=null,this.g=e,e=(r=this.g.length)-1,r&&null!==(r=this.g[e])&&"object"==typeof r&&r.constructor===Object?(this.l=e-this.j,this.h=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.g[e])?se(r):this.g[e]=ue):(Ae(this),(r=this.h[e])?se(r):this.h[e]=ue)}var ue=Object.freeze(se([]));function Ae(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function he(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function ge(e){var t=void 0!==t&&t,n=he(e,1,t);return null==n&&(n=ue),n===ue&&Fe(e,1,n=se([]),t),n}function Qe(e,t,n){var r;return null!=(r=e=null==(e=he(e,t))?e:+e)?r:void 0===n?0:n}function Fe(e,t,n,r){void 0!==r&&r||t>=e.l?(Ae(e),e.h[t]=n):e.g[t+e.j]=n}function pe(e,t){e.i||(e.i={});var n=e.i[1];if(!n){var r=ge(e);n=[];for(var i=0;i<r.length;i++)n[i]=new t(r[i]);e.i[1]=n}return n}function Ue(e,t,n,r){var i=pe(e,n);t=t||new n,e=ge(e),null!=r?(i.splice(r,0,t),e.splice(r,0,me(t))):(i.push(t),e.push(me(t)))}function me(e,t){if(e.i)for(var n in e.i){var r=e.i[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&me(r[i]);else r&&me(r)}return e.g}function be(e,t){var n;return null!=(n=e=he(e,t))?n:0}function Be(e,t){var n;return null!=(n=e=he(e,t))?n:""}function Ze(e,t){if(e=e.m){ee(t,t.g.end());for(var n=0;n<e.length;n++)ee(t,e[n])}}function fe(e,t){if(4==t.h)return!1;var n=t.m;return function e(t){switch(t.h){case 0:if(0!=t.h)e(t);else{for(t=t.g;128&t.h[t.g];)t.g++;t.g++}break;case 1:1!=t.h?e(t):(t=t.g).g+=8;break;case 2:if(2!=t.h)e(t);else{var n=H(t.g);(t=t.g).g+=n}break;case 5:5!=t.h?e(t):(t=t.g).g+=4;break;case 3:for(n=t.l;;){if(!P(t)){t.j=!0;break}if(4==t.h){t.l!=n&&(t.j=!0);break}e(t)}break;default:t.j=!0}}(t),t.N||(t=w(t.g.h,n,t.g.g),(n=e.m)?n.push(t):e.m=[t]),!0}function Re(t,n){var r=void 0;return new(r||(r=e))((function(e,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,a)}l((n=n.apply(t,void 0)).next())}))}function Ie(e){de.call(this,e)}function ye(e,t){for(;P(t);)switch(t.i){case 8:var n=H(t.g);Fe(e,1,n);break;case 21:Fe(e,2,n=K(t.g));break;case 26:Fe(e,3,n=q(t));break;case 34:Fe(e,4,n=q(t));break;default:if(!fe(e,t))return e}return e}function Ve(e){de.call(this,e,-1,Ce)}de.prototype.toJSON=function(){return oe(me(this),ae,G)},de.prototype.toString=function(){return me(this).toString()},g(Ie,de),g(Ve,de),Ve.prototype.addClassification=function(e,t){Ue(this,e,Ie,t)};var Ce=[1];function We(e){de.call(this,e)}function Ee(e,t){for(;P(t);)switch(t.i){case 13:var n=K(t.g);Fe(e,1,n);break;case 21:Fe(e,2,n=K(t.g));break;case 29:Fe(e,3,n=K(t.g));break;case 37:Fe(e,4,n=K(t.g));break;case 45:Fe(e,5,n=K(t.g));break;default:if(!fe(e,t))return e}return e}function Se(e){de.call(this,e,-1,ve)}g(We,de),g(Se,de);var ve=[1];function Je(e){de.call(this,e)}function Ne(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Ge(e){return pe(e,Ie).map((function(e){return{index:be(e,1),Y:Qe(e,2),label:null!=he(e,3)?Be(e,3):void 0,displayName:null!=he(e,4)?Be(e,4):void 0}}))}function Xe(e){return{x:Qe(e,1),y:Qe(e,2),z:Qe(e,3),visibility:null!=he(e,4)?Qe(e,4):void 0}}function ke(e,t){this.h=e,this.g=t,this.l=0}function Te(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Ne(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Ne(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Ye(e){this.g=e}g(Je,de);var we=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function De(e,t){return t+e}function xe(e,t){window[e]=t}function Me(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||De,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function He(t){return Re(t,(function t(){var n,r,i,o,a,l,s,d,u,A,h,g=this;return f(t,(function(t){switch(t.g){case 1:return n=g,g.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(g,g.j),U(t,function(){return Re(this,(function e(){return f(e,(function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(we),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):t.return();case 2:if(i=t.h,"object"==typeof window)return xe("createMediapipeSolutionsWasm",{locateFile:g.locateFile}),xe("createMediapipeSolutionsPackedAssets",{locateFile:g.locateFile}),l=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(t){var r=Ke(n,t.url);if(void 0!==t.path){var i=t.path;r=r.then((function(t){return n.overrideFile(i,t),e.resolve(t)}))}return r}))),u=e.all(s.map((function(t){return void 0===t.simd||t.simd&&i||!t.simd&&!i?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(n.locateFile(t.url,n.S)):e.resolve()}))).then((function(){return Re(n,(function e(){var t,n,r=this;return f(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,U(e,t(n),2);r.h=e.h,e.g=0}))}))})),A=Re(n,(function e(){var t=this;return f(e,(function(e){return t.g.graph&&t.g.graph.url?e=U(e,Ke(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),U(t,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter((function(e){return void 0===e.simd||e.simd&&i||!e.simd&&!i})).map((function(e){return n.locateFile(e.url,n.S)})),importScripts.apply(null,c(o)),U(t,createMediapipeSolutionsWasm(Module),6);case 6:g.h=t.h,g.l=new OffscreenCanvas(1,1),g.h.canvas=g.l,a=g.h.GL.createContext(g.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),g.h.GL.makeContextCurrent(a),t.g=4;break;case 7:if(g.l=document.createElement("canvas"),!(h=g.l.getContext("webgl2",{}))&&!(h=g.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();g.D=h,g.h.canvas=g.l,g.h.createContext(g.l,!0,!0,{});case 4:g.i=new g.h.SolutionWasm,g.R=!1,t.g=0}}))}))}function Ke(e,t){return Re(e,(function e(){var n,r,i=this;return f(e,(function(e){return t in i.F?e.return(i.F[t]):(n=i.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),i.F[t]=r,e.return(r))}))}))}function Le(e,t,n){return Re(e,(function e(){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p,m=this;return f(e,(function(e){switch(e.g){case 1:if(!n)return e.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(m.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){e.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(e,function(e,t,n){return Re(e,(function e(){var r,i=this;return f(e,(function(e){return"number"==typeof n||n instanceof Uint8Array||n instanceof i.h.Uint8BlobList?e.return(n):n instanceof i.h.Texture2dDataOut?((r=i.s[t])||(r=new ke(i.h,i.D),i.s[t]=r),e.return(Te(r,n,i.G))):e.return(void 0)}))}))}(m,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=b.get(I);e:{var V=new Je;for(y=new j(y);P(y);)switch(y.i){case 13:var C=K(y.g);Fe(V,1,C);break;case 21:Fe(V,2,C=K(y.g));break;case 29:Fe(V,3,C=K(y.g));break;case 37:Fe(V,4,C=K(y.g));break;case 45:Fe(V,5,C=K(y.g));break;case 48:for(var W=y.g,E=128,S=0,v=C=0;4>v&&128<=E;v++)S|=(127&(E=W.h[W.g++]))<<7*v;if(128<=E&&(S|=(127&(E=W.h[W.g++]))<<28,C|=(127&E)>>4),128<=E)for(v=0;5>v&&128<=E;v++)C|=(127&(E=W.h[W.g++]))<<7*v+3;128>E?(W=S>>>0,(C=2147483648&(E=C>>>0))&&(E=~E>>>0,0==(W=1+~W>>>0)&&(E=E+1>>>0)),W=4294967296*E+(W>>>0),C=C?-W:W):(W.l=!0,C=void 0),Fe(V,6,C);break;default:if(!fe(V,y))break e}}V={Z:Qe(V,1),$:Qe(V,2),height:Qe(V,3),width:Qe(V,4),rotation:Qe(V,5,0),X:be(V,6)},C=B.get(I);e:for(y=new Se,C=new j(C);P(C);)switch(C.i){case 10:Ue(y,W=_(C,new We,Ee),We,void 0);break;default:if(!fe(y,C))break e}y=pe(y,We).map(Xe),W=Z.get(I);e:for(C=new Ve,W=new j(W);P(W);)switch(W.i){case 10:C.addClassification(_(W,new Ie,ye));break;default:if(!fe(C,W))break e}V={T:V,O:y,M:Ge(C)},R.push(V)}b=R}else b=[];r[u]=b,e.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===A.type){r[u]=h,e.g=7;break}if("proto"===A.type){r[u]=h,e.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=m.s[u])||(g=new ke(m.h,m.D),m.s[u]=g),U(e,Te(g,h,m.G),13);case 13:Q=e.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),e.g=3;break;case 14:F[p]=e.h;case 3:a=d.next(),e.g=2;break;case 4:return e.return(r)}}))}))}function ze(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=Le(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Oe(e){switch(void 0===e&&(e=0),e){case 1:return"selfie_segmentation_landscape.tflite";default:return"selfie_segmentation.tflite"}}function je(e){var t=this;e=e||{},this.g=new Me({locateFile:e.locateFile,files:function(e){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:Oe(e.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(e){return Re(t,(function t(){var n,r,i,o=this;return f(t,(function(t){return 1==t.g?(n=Oe(e),r="third_party/mediapipe/modules/selfie_segmentation/"+n,U(t,Ke(o.g,n),2)):(i=t.h,o.g.overrideFile(r,i),t.return(!0))}))}))}}}})}(t=Me.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){return Re(this,(function e(){var t=this;return f(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return Re(n,(function t(){var n=this;return f(t,(function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(r))}},t.initialize=function(){return Re(this,(function e(){var t=this;return f(e,(function(e){return 1==e.g?U(e,He(t),2):3!=e.g?U(e,function(e){return Re(e,(function e(){var t,n,r,i,o,a,c,s,d=this;return f(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,U(e,Ke(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),n=l(Object.keys(d.B)),r=n.next();!r.done;r=n.next())i=r.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(o=l(d.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,ze(d,c);s=d.j,d.j={},d.setOptions(s),e.g=0}))}))}(t),3):U(e,function(e){return Re(e,(function e(){var t,n,r,i,o,a,c=this;return f(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=l(c.u),n=t.next();case 3:if(n.done){e.g=5;break}return U(e,(0,n.value)(),4);case 4:n=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(r=new c.h.GraphOptionChangeRequestList,i=l(c.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);c.i.changeOptions(r),r.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){return Re(this,(function n(){var r,i,o,a,c,s,d,u,A,h=this;return f(n,(function(n){switch(n.g){case 1:return h.g.inputs?(r=1e3*(null!=t?t:performance.now()),U(n,h.C,2)):n.return();case 2:return U(n,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,o=l(Object.keys(e)),a=o.next();!a.done;a=o.next())if(c=a.value,s=h.g.inputs[c]){e:{var g=h,Q=e[c];switch(s.type){case"video":var F=g.m[s.stream];if(F||(F=new ke(g.h,g.D),g.m[s.stream]=F),0===(g=F).l&&(g.l=g.h.createTexture()),typeof HTMLVideoElement<"u"&&Q instanceof HTMLVideoElement){var p=Q.videoWidth;F=Q.videoHeight}else typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement?(p=Q.naturalWidth,F=Q.naturalHeight):(p=Q.width,F=Q.height);F={glName:g.l,width:p,height:F},(p=g.g).canvas.width=F.width,p.canvas.height=F.height,p.activeTexture(p.TEXTURE0),g.h.bindTexture2d(g.l),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,Q),g.h.bindTexture2d(0),g=F;break e;case"detections":for((F=g.m[s.stream])||(F=new Ye(g.h),g.m[s.stream]=F),(g=F).data||(g.data=new g.g.DetectionListData),g.data.reset(Q.length),F=0;F<Q.length;++F){p=Q[F];var m=g.data,b=m.setBoundingBox,B=F,Z=p.T,f=new Je;Fe(f,1,Z.Z),Fe(f,2,Z.$),Fe(f,3,Z.height),Fe(f,4,Z.width),Fe(f,5,Z.rotation),Fe(f,6,Z.X);var R=Z=new $;ne(R,1,he(f,1)),ne(R,2,he(f,2)),ne(R,3,he(f,3)),ne(R,4,he(f,4)),ne(R,5,he(f,5));var I=he(f,6);if(null!=I&&null!=I){O(R.g,48);var y=R.g,V=I;I=0>V;var C=(V=Math.abs(V))>>>0;for(V=Math.floor((V-C)/4294967296),V>>>=0,I&&(V=~V>>>0,4294967295<(C=1+(~C>>>0))&&(C=0,4294967295<++V&&(V=0))),I=D=C,C=V;0<C||127<I;)y.push(127&I|128),I=(I>>>7|C<<25)>>>0,C>>>=7;y.push(I)}if(Ze(f,R),Z=te(Z),b.call(m,B,Z),p.O)for(m=0;m<p.O.length;++m)R=!!(f=p.O[m]).visibility,B=(b=g.data).addNormalizedLandmark,Z=F,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Fe(R=new We,1,f.x),Fe(R,2,f.y),Fe(R,3,f.z),f.visibility&&Fe(R,4,f.visibility),ne(y=f=new $,1,he(R,1)),ne(y,2,he(R,2)),ne(y,3,he(R,3)),ne(y,4,he(R,4)),ne(y,5,he(R,5)),Ze(R,y),f=te(f),B.call(b,Z,f);if(p.M)for(m=0;m<p.M.length;++m){if(B=(b=g.data).addClassification,Z=F,f=p.M[m],Fe(R=new Ie,2,f.Y),f.index&&Fe(R,1,f.index),f.label&&Fe(R,3,f.label),f.displayName&&Fe(R,4,f.displayName),y=f=new $,null!=(C=he(R,1))&&null!=C)if(O(y.g,8),I=y.g,0<=C)O(I,C);else{for(V=0;9>V;V++)I.push(127&C|128),C>>=7;I.push(1)}ne(y,2,he(R,2)),null!=(I=he(R,3))&&(I=v(I),O(y.g,26),O(y.g,I.length),ee(y,y.g.end()),ee(y,I)),null!=(I=he(R,4))&&(I=v(I),O(y.g,34),O(y.g,I.length),ee(y,y.g.end()),ee(y,I)),Ze(R,y),f=te(f),B.call(b,Z,f)}}g=g.data;break e;default:g={}}}switch(d=g,u=s.stream,s.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:r}));break;case"detections":(A=d).stream=u,A.timestamp=r,i.pushDetectionList(A);break;default:throw Error("Unknown input config type: '"+s.type+"'")}}return h.i.send(i),U(n,h.C,4);case 4:i.delete(),n.g=0}}))}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Me),y("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=je.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){return Re(this,(function e(){var t=this;return f(e,(function(e){return U(e,t.g.initialize(),0)}))}))},t.reset=function(){this.g.reset()},t.send=function(e){return Re(this,(function t(){var n=this;return f(t,(function(t){return U(t,n.g.send(e),0)}))}))},t.setOptions=function(e){this.g.setOptions(e)},y("SelfieSegmentation",je),y("VERSION","0.1.1632777926")}).call(Xe);const ke={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ra=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={fa:t,ga:!0},e.g=e.o||e.u}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ga)throw t.fa;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.s):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.s=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.M(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.s=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).M(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).M(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(){throw Error("Invalid UTF8")}function C(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var W,E,S=typeof TextDecoder<"u",v=typeof TextEncoder<"u",J={},N=null;function G(e){var t;void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),i!==n?r.subarray(0,i):r}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array;function w(e){return Y&&null!=e&&e instanceof Uint8Array}function D(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var x="function"==typeof Uint8Array.prototype.slice,M=0;function H(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function K(){return Error("Failed to read varint, encoding is invalid.")}function L(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&z(this,e)}function z(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return X(e);if(e.constructor===D)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||w(t)?t:"string"==typeof t?X(t):null,(e=e.L=t)?new Uint8Array(e):T||(T=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function O(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function j(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,O(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,O(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,O(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,O(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return O(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw K();return O(e),r}L.prototype.reset=function(){this.g=this.j};var P=[];function _(){this.g=[]}function q(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function $(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,P.length?(n=P.pop(),t&&(n.v=t.v),e&&z(n,e),e=n):e=new L(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=j(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw H(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(!(128&e.h[t++])){e.g=t,O(e);break e}throw K()}break;case 1:(e=e.g).g+=8,O(e);break;case 2:2!=e.h?te(e):(t=j(e.g)>>>0,(e=e.g).g+=t,O(e));break;case 5:(e=e.g).g+=4,O(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw H(e.h,e.j)}}_.prototype.length=function(){return this.g.length},_.prototype.end=function(){var e=this.g;return this.g=[],e},$.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new _}function ie(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(oe?e[oe]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function le(e){var t;return null!=(t=oe?e[oe]:e.N)?t:0}function ce(e){return ae(e,1),e}function se(e){return!!Array.isArray(e)&&!!(2&le(e))}function de(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function ue(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var Ae=Object.freeze(ce([]));function he(e){if(se(e.m))throw Error("Cannot mutate an immutable Message")}var ge,Qe=typeof Symbol<"u"&&typeof Symbol.hasInstance<"u";function Fe(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function pe(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function Ue(e,t,n,r){r=void 0!==r&&r,he(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function me(e,t,n,r){n=void 0===n||n;var i=pe(e,t,r=void 0!==r&&r);return null==i&&(i=Ae),se(e.m)?n&&(de(i),Object.freeze(i)):(i===Ae||se(i))&&Ue(e,t,i=ce(i.slice()),r),i}function be(e,t,n){var r;return null!=(r=e=null==(e=pe(e,t))?e:+e)?r:void 0===n?0:n}function Be(e,t,n,r){e.j||(e.j={});var i=se(e.m),o=e.j[n];if(!o){r=me(e,n,!0,void 0!==r&&r),o=[],i=i||se(r);for(var a=0;a<r.length;a++)o[a]=new t(r[a]),i&&de(o[a].m);i&&(de(o),Object.freeze(o)),e.j[n]=o}return o}function Ze(e,t,n,r,i){var o=void 0!==o&&o;return he(e),o=Be(e,n,t,o),n=r||new n,e=me(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.m)):(o.push(n),e.push(n.m)),n}function fe(e,t){var n;return null!=(n=e=pe(e,t))?n:0}function Re(e,t){var n;return null!=(n=e=pe(e,t))?n:""}function Ie(e){var t=Ce;return Ve(e,t=void 0===t?We:t)}function ye(e,t){if(null!=e){if(Array.isArray(e))e=Ve(e,t);else if(ue(e)){var n,r={};for(n in e)r[n]=ye(e[n],t);e=r}else e=t(e);return e}}function Ve(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=ye(n[r],t);return Array.isArray(e)&&1&le(e)&&ce(n),n}function Ce(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(w(e))return G(e);if(e instanceof D){var t=e.L;return t=null==t||"string"==typeof t?t:Y&&t instanceof Uint8Array?G(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?Ie(e):e)}function We(e){return w(e)?new Uint8Array(e):e}function Ee(e,t,n){e||(e=ge),ge=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&ue(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)e+=this.h,(r=this.m[e])?Array.isArray(r)&&ce(r):this.m[e]=Ae;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];i?Array.isArray(i)&&ce(i):r[e]=Ae}}function Se(){Ee.apply(this,arguments)}if(Ee.prototype.toJSON=function(){return Ie(this.m)},Ee.prototype.toString=function(){return this.m.toString()},g(Se,Ee),Qe){var ve={};Object.defineProperties(Se,(ve[Symbol.hasInstance]=Fe((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),ve))}function Je(e,t,n){if(n){var r,i={};for(r in n){var o=n[r],a=o.ja;a||(i.F=o.pa||o.ha.P,o.ba?(i.U=we(o.ba),a=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(i)):o.da?(i.T=De(o.X.g,o.da),a=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(i)):a=i.F,o.ja=a),a(t,e,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(e,t){if(t=t.ca){ie(e,e.g.end());for(var n=0;n<t.length;n++)ie(e,t[n])}}(t,e)}var Ne=Symbol();function Ge(e,t,n){return e[Ne]||(e[Ne]=function(e,r){return t(e,r,n)})}function Xe(e){var t=e[Ne];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ne]=t}return t}function ke(e){var t=function(e){var t=e.ba;return t?Xe(t):(t=e.oa)?Ge(e.X.g,t,e.da):void 0}(e),n=e.X,r=e.ha.O;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Te(e,t,n,r,i,o){var a=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),a++);a<e.length;){n=e[a++];for(var l=a+1;l<e.length&&"number"!=typeof e[l];)l++;var c=e[a++];switch(l-=a){case 0:r(t,n,c);break;case 1:r(t,n,c,e[a++]);break;case 2:i(t,n,c,e[a++],e[a++]);break;case 3:l=e[a++];var s=e[a++],d=e[a++];Array.isArray(d)?i(t,n,c,l,s,d):o(t,n,c,l,s,d);break;case 4:o(t,n,c,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return t}var Ye=Symbol();function we(e){var t=e[Ye];if(!t){var n=ze(e);t=function(e,t){return nt(e,t,n)},e[Ye]=t}return t}function De(e,t){var n=e[Ye];return n||(n=function(e,n){return Je(e,n,t)},e[Ye]=n),n}var xe=Symbol();function Me(e,t){e.push(t)}function He(e,t,n){e.push(t,n.P)}function Ke(e,t,n,r,i){var o=we(i),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,o)}))}function Le(e,t,n,r,i,o){var a=De(r,o),l=n.P;e.push(t,(function(e,t,n){return l(e,t,n,r,a)}))}function ze(e){return e[xe]||Te(e,e[xe]=[],Me,He,Ke,Le)}var Oe=Symbol();function je(e,t){e[0]=t}function Pe(e,t,n,r){var i=n.O;e[t]=r?function(e,t,n){return i(e,t,n,r)}:i}function _e(e,t,n,r,i,o){var a=n.O,l=Xe(i);e[t]=function(e,t,n){return a(e,t,n,r,l,o)}}function qe(e,t,n,r,i,o,a){var l=n.O,c=Ge(r,i,o);e[t]=function(e,t,n){return l(e,t,n,r,c,a)}}function $e(e){return e[Oe]||Te(e,e[Oe]={},je,Pe,_e,qe)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=ke(o))}if(!(i&&i(t,e,r)||(i=t,r=e,o=i.j,te(i),i.W))){var a=i.g.h;i=o===(i=i.g.g)?T||(T=new Uint8Array(0)):x?a.slice(o,i):new Uint8Array(a.subarray(o,i)),(o=r.ca)?o.push(i):r.ca=[i]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(z(r.g,e),r.i=-1,r.h=-1),e=r}else e=new $(e);try{return et(new t,e,$e(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,i=r%2==1,o=i?1:0;o<r;o+=2)(0,n[o+1])(t,e,n[o]);Je(e,t,i?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,ze(t)),ie(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,i=0,o=0;o<r;o++){var a=t[o];e.set(a,i),i+=a.length}return n.i=[e],e}function it(e,t){return{O:e,P:t}}var ot=it((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,O(e),e=2*((i=(r<<0|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,Ue(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){q(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?M=0:(0,M=2147483648):isNaN(r)?(0,M=2147483647):34028234663852886e22<r?(0,M=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,M=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,M=(n<<31|t+127<<23|8388607&r)>>>0),n=M,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=it((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,a=e=0;4>a&&128<=i;a++)i=r.h[r.g++],O(r),o|=(127&i)<<7*a;if(128<=i&&(i=r.h[r.g++],O(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)i=r.h[r.g++],O(r),e|=(127&i)<<7*a+3;if(!(128>i))throw K();return r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),Ue(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t){q(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=M=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),lt=it((function(e,t,n){return 0===e.h&&(Ue(t,n,j(e.g)),!0)}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t)if(q(e.g,8*n),e=e.g,0<=(n=t))q(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ct=it((function(e,t,n){if(2!==e.h)return!1;var r,i=j(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,O(e),e=e.h,S)(r=W)||(r=W=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?V():(l=e[o++],194>a||128!=(192&l)?(o--,V()):s.push((31&a)<<6|63&l)):240>a?o>=i-1?V():128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,V()):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?V():128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,V()):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):V(),8192<=s.length&&(d=C(d,s),s.length=0);r=C(d,s)}return Ue(t,n,r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){var r=!1;if(r=void 0!==r&&r,v){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(E||(E=new TextEncoder)).encode(t)}else{for(var i=0,o=new Uint8Array(3*t.length),a=0;a<t.length;a++){var l=t.charCodeAt(a);if(128>l)o[i++]=l;else{if(2048>l)o[i++]=l>>6|192;else{if(55296<=l&&57343>=l){if(56319>=l&&a<t.length){var c=t.charCodeAt(++a);if(56320<=c&&57343>=c){l=1024*(l-55296)+c-56320+65536,o[i++]=l>>18|240,o[i++]=l>>12&63|128,o[i++]=l>>6&63|128,o[i++]=63&l|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");l=65533}o[i++]=l>>12|224,o[i++]=l>>6&63|128}o[i++]=63&l|128}}t=o.subarray(0,i)}q(e.g,8*n+2),q(e.g,t.length),ie(e,e.g.end()),ie(e,t)}})),st=it((function(e,t,n,r,i){if(2!==e.h)return!1;t=Ze(t,n,r),n=e.g.i,r=j(e.g)>>>0;var o=e.g.g+r,a=o-n;if(0>=a&&(e.g.i=o,i(t,e),a=o-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=n,!0}),(function(e,t,n,r,i){if(null!=(t=Be(t,r,n)))for(r=0;r<t.length;r++){var o=e;q(o.g,8*n+2);var a=o.g.end();ie(o,a),a.push(o.h),o=a,i(t[r],e),a=e;var l=o.pop();for(l=a.h+a.g.length()-l;127<l;)o.push(127&l|128),l>>>=7,a.h++;o.push(l),a.h++}}));function dt(){Se.apply(this,arguments)}if(g(dt,Se),Qe){var ut={};Object.defineProperties(dt,(ut[Symbol.hasInstance]=Fe(Object[Symbol.hasInstance]),ut))}function At(e){dt.call(this,e)}function ht(){return[1,lt,2,ot,3,ct,4,ct]}function gt(e){dt.call(this,e,-1,Ft)}function Qt(){return[1,st,At,ht]}g(At,dt),g(gt,dt),gt.prototype.addClassification=function(e,t){return Ze(this,1,At,e,t),this};var Ft=[1];function pt(e){dt.call(this,e)}function Ut(){return[1,ot,2,ot,3,ot,4,ot,5,ot]}function mt(e){dt.call(this,e,-1,Bt)}function bt(){return[1,st,pt,Ut]}g(pt,dt),g(mt,dt);var Bt=[1];function Zt(e){dt.call(this,e)}function ft(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,at]}function Rt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function It(e){return Be(e,At,1).map((function(e){return{index:fe(e,1),score:be(e,2),label:null!=pe(e,3)?Re(e,3):void 0,displayName:null!=pe(e,4)?Re(e,4):void 0}}))}function yt(e){return{x:be(e,1),y:be(e,2),z:be(e,3),visibility:null!=pe(e,4)?be(e,4):void 0}}function Vt(e){return e.map((function(e){return Be(tt(e,mt,bt),pt,1).map(yt)}))}function Ct(e,t){this.h=e,this.g=t,this.l=0}function Wt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.o){var r=Rt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Rt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),qa:i},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Et(e){this.g=e}g(Zt,dt);var St=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function vt(e,t){return t+e}function Jt(e,t){window[e]=t}function Nt(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.$=!0,this.D=e.resolve(),this.Z="",this.C={},this.locateFile=t&&t.locateFile||vt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.aa=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Gt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.$?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.o=2,U(e,WebAssembly.instantiate(St),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return Jt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Jt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=Xt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.aa)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,Xt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.aa)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,na:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.G=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.$=!1,g.g=0}}))}function Xt(e,t){var n,r;return f((function(i){return t in e.H?i.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,i.return(r))}))}function kt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.I=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Ct(e.h,e.G),e.u[t]=r),i.return(Wt(r,n,e.I))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=tt(b.get(I),Zt,ft);y={ea:{ka:be(y,1),la:be(y,2),height:be(y,3),width:be(y,4),rotation:be(y,5,0),ia:fe(y,6)},Y:Be(tt(B.get(I),mt,bt),pt,1).map(yt),V:It(tt(Z.get(I),gt,Qt))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.u[u])||(g=new Ct(e.h,e.G),e.u[u]=g),U(m,Wt(g,h,e.I),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Tt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.D=kt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Yt(e){return void 0===e&&(e=0),1===e?"hand_landmark_full.tflite":"hand_landmark_lite.tflite"}function wt(e){var t=this;e=e||{},this.g=new Nt({locateFile:e.locateFile,files:function(e){return[{url:"hands_solution_packed_assets_loader.js"},{simd:!1,url:"hands_solution_wasm_bin.js"},{simd:!0,url:"hands_solution_simd_wasm_bin.js"},{data:!0,url:Yt(e.modelComplexity)}]},graph:{url:"hands.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["multi_hand_landmarks","multi_hand_world_landmarks","image_transformed","multi_handedness"],outs:{image:"image_transformed",multiHandLandmarks:{type:"proto_list",stream:"multi_hand_landmarks",transform:Vt},multiHandWorldLandmarks:{type:"proto_list",stream:"multi_hand_world_landmarks",transform:Vt},multiHandedness:{type:"proto_list",stream:"multi_handedness",transform:function(e){return e.map((function(e){return It(tt(e,gt,Qt))[0]}))}}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumHands:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculator",fieldName:"int_value"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i;return f((function(o){return 1==o.g?(n=Yt(e),r="third_party/mediapipe/modules/hand_landmark/"+n,U(o,Xt(t.g,n),2)):(i=o.h,t.g.overrideFile(r,i),o.return(!0))}))}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"handlandmarktrackinggpu__palmdetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"handlandmarktrackinggpu__handlandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}}}})}(t=Nt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={R:o.R,S:o.S},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.R=c.onChange,o.S=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Gt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.Z===e.g.graph.url?d.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Z=e.g.graph.url,U(d,Xt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Tt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.s)return c.return();if(!e.A){c.g=2;break}t=l(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.B),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.D,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.o[c.stream];if(Q||(Q=new Ct(A.h,A.G),A.o[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.o[c.stream])||(Q=new Et(A.h),A.o[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.ea,f=new Zt;if(Ue(f,1,Z.ka),Ue(f,2,Z.la),Ue(f,3,Z.height),Ue(f,4,Z.width),Ue(f,5,Z.rotation),Ue(f,6,Z.ia),Z=rt(f,ft),b.call(m,B,Z),F.Y)for(m=0;m<F.Y.length;++m){var R=!!(f=F.Y[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ue(R=new pt,1,f.x),Ue(R,2,f.y),Ue(R,3,f.z),f.visibility&&Ue(R,4,f.visibility),f=rt(R,Ut),B.call(b,Z,f)}if(F.V)for(m=0;m<F.V.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.V[m],Ue(R=new At,2,f.score),f.index&&Ue(R,1,f.index),f.label&&Ue(R,3,f.label),f.displayName&&Ue(R,4,f.displayName),f=rt(R,ht),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.D,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Nt),y("OptionType",{BOOL:0,NUMBER:1,ma:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=wt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Hands",wt),y("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),y("VERSION","0.4.1646424915")}).call(ke);var Te={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.da=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e){!function(e){I.setTimeout((function(){throw e}),0)}(e)}function C(e,t){V(Error("Invalid wire type: "+e+" (at position "+t+")"))}function W(){V(Error("Failed to read varint, encoding is invalid."))}function E(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var S,v,J=typeof TextDecoder<"u",N=typeof TextEncoder<"u";function G(e){if(N)e=(v||(v=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var X={},k=null;function T(e){var t;void 0===t&&(t=0),w(),t=X[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function Y(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=k[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}w();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function w(){if(!k){k={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));X[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===k[o]&&(k[o]=i)}}}}var D,x="function"==typeof Uint8Array;function M(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}M.prototype.toJSON=function(){if(null==this.g)var e="";else e=this.g,e=this.g=null==e||"string"==typeof e?e:x&&e instanceof Uint8Array?T(e):null;return e};var H="function"==typeof Uint8Array.prototype.slice;function K(e,t,n){return t===n?D||(D=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var L=0;function z(e,t){t=void 0!==(t=void 0===t?{}:t).u&&t.u,this.h=null,this.g=this.i=this.m=0,this.l=!1,this.u=t,e&&O(this,e)}function O(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return Y(e);if(e.constructor===M){if(null==e.g)var t=D||(D=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||x&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?Y(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.m=0,e.i=e.h.length,e.g=e.m}function j(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.l=!0,W()}function P(e){e.g>e.i&&(e.l=!0,V(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}z.prototype.reset=function(){this.g=this.m},z.prototype.j=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,P(this),n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,P(this),n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,P(this),n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,P(this),n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,P(this),n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]?(this.l=!0,W(),n):(P(this),n))))))},z.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,P(this),e=2*((n=(e<<0|t<<8|n<<16|r<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var _=[];function q(){this.g=new Uint8Array(64),this.h=0}function $(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ee(e,t){for(;127<t;)$(e,127&t|128),t>>>=7;$(e,t)}function te(e){var t={},n=void 0!==t.N&&t.N;this.m={u:void 0!==t.u&&t.u},this.N=n,t=this.m,_.length?(n=_.pop(),t&&(n.u=t.u),e&&O(n,e),e=n):e=new z(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ne(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=e.g.j();return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,C(n,e.l),!1)}function re(e){switch(e.h){case 0:if(0!=e.h)re(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(!(128&e.h[t])){e.g=t+1,P(e);break e}t++}e.l=!0,W()}break;case 1:(e=e.g).g+=8,P(e);break;case 2:2!=e.h?re(e):(t=e.g.j(),(e=e.g).g+=t,P(e));break;case 5:(e=e.g).g+=4,P(e);break;case 3:for(t=e.i;;){if(!ne(e)){e.j=!0,V(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,V(Error("Unmatched end-group tag")));break}re(e)}break;default:e.j=!0,C(e.h,e.l)}}function ie(e,t,n){e.N||(e=K(e.g.h,n,e.g.g),(n=t.o)?n.push(e):t.o=[e])}function oe(e,t,n){var r=e.g.i,i=e.g.j(),o=e.g.g+i;if(e.g.i=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=r,t}function ae(e,t,n){var r=e.g.j();for(r=e.g.g+r;e.g.g<r;)n.push(t.call(e.g))}q.prototype.length=function(){return this.h},q.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,K(e,0,t)},te.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var le=[];function ce(){this.h=[],this.i=0,this.g=new q}function se(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function de(e,t,n){ee(e.g,8*t+2),ee(e.g,n.length),se(e,e.g.end()),se(e,n)}var ue,Ae="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function he(e,t){Object.isFrozen(e)||(Ae?e[Ae]|=t:void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function ge(e){var t;return e?null!=(t=Ae?e[Ae]:e.g)?t:0:0}function Qe(e){return Array.isArray(e)&&he(e,1),e}function Fe(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");he(e,2)}function pe(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Ue(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":return x&&null!=e&&e instanceof Uint8Array?T(e):e;default:return e}}function me(e,t){if(null!=e)return Array.isArray(e)||pe(e)?be(e,t):t(e)}function be(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=me(e[r],t);return 1&ge(e)&&Qe(n),n}for(r in n={},e)n[r]=me(e[r],t);return n}function Be(e,t,n){var r=ue;if(ue=null,e||(e=r),r=this.constructor.ba,e||(e=r?[r]:[]),this.j=(r?0:-1)-(this.constructor.$||0),this.m=this.g=null,this.h=e,e=(r=this.h.length)-1,r&&pe(r=this.h[e])?(this.l=e-this.j,this.i=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.h[e])?Qe(r):this.h[e]=fe):(Re(this),(r=this.i[e])?Qe(r):this.i[e]=fe)}var Ze,fe=Object.freeze(Qe([]));function Re(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function Ie(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ye(e,t,n){n=void 0===n||n;var r=void 0!==r&&r,i=Ie(e,t,r);return null==i&&(i=fe),i===fe?Ee(e,t,i=Qe([]),r):n&&Array.isArray(i)&&2&ge(i)&&Ee(e,t,i=i.slice(),r),i}function Ve(e){var t=ye(e,3,!1);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n<t.length;n++)t[n]=+t[n];e.m[3]=!0}return t}function Ce(e,t,n){var r;return null!=(r=e=Ie(e,t))?r:n}function We(e,t,n){var r;return null!=(r=e=null==(e=Ie(e,t))?e:+e)?r:void 0===n?0:n}function Ee(e,t,n,r){void 0!==r&&r||t>=e.l?(Re(e),e.i[t]=n):e.h[t+e.j]=n}function Se(e,t,n){if(-1===n)return null;e.g||(e.g={});var r=e.g[n];if(r)return r;var i=Ie(e,n,!1);return null==i?r:(t=new t(i),e.g[n]=t)}function ve(e,t,n){e.g||(e.g={});var r=e.g[n];if(!r){var i=ye(e,n,!1);r=[];for(var o=!!Array.isArray(i)&&!!(2&ge(i)),a=0;a<i.length;a++)r[a]=new t(i[a]),o&&Fe(r[a].h);o&&(Fe(r),Object.freeze(r)),e.g[n]=r}return r}function Je(e,t,n,r,i){var o=ve(e,r,t);n=n||new r,e=ye(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,Ne(n))):(o.push(n),e.push(Ne(n)))}function Ne(e){if(e.g)for(var t in e.g){var n=e.g[t];if(Array.isArray(n))for(var r=0;r<n.length;r++)n[r]&&Ne(n[r]);else n&&Ne(n)}return e.h}function Ge(e,t){if(e=e.o){se(t,t.g.end());for(var n=0;n<e.length;n++)se(t,e[n])}}function Xe(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=e[2];return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],a=e[2],l=e[3];return function(e,n,r){return t(e,n,r,o,a,l)};default:throw Error("unsupported number of parameters, expected [2-4], got "+e.length)}}function ke(e,t,n){for(;ne(t)&&4!=t.h;){var r=t.i,i=n[r];if(i){if(Array.isArray(i)&&(i=n[r]=Xe(i)),!i(t,e,r)){i=e;var o=(r=t).l;re(r),ie(r,i,o)}}else i=e,o=(r=t).l,re(r),ie(r,i,o)}return e}function Te(e,t){var n=new ce;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var a=r[o];0!==a.length&&(e.set(a,t),t+=a.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function Ye(e,t,n){if(le.length){var r=le.pop();e&&(O(r.g,e),r.i=-1,r.h=-1),e=r}else e=new te(e);try{return n(new t,e)}finally{(t=e.g).h=null,t.m=0,t.i=0,t.g=0,t.l=!1,t.u=!1,e.i=-1,e.h=-1,e.j=!1,100>le.length&&le.push(e)}}function we(e,t,n){if(null!=(t=Ie(t,n))){ee(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?L=0:(0,L=2147483648):isNaN(r)?(0,L=2147483647):34028234663852886e22<r?(0,L=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,L=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,L=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=L)>>>0&255),$(e,n>>>8&255),$(e,n>>>16&255),$(e,n>>>24&255)}}function De(e,t,n){return 5===e.h&&(Ee(t,n,e.g.o()),!0)}function xe(e,t,n){return(5===e.h||2===e.h)&&(t=ye(t,n),2==e.h?ae(e,z.prototype.o,t):t.push(e.g.o()),!0)}function Me(e,t,n){return 0===e.h&&(Ee(t,n,j(e.g)),!0)}function He(e,t,n){return 0===e.h&&(Ee(t,n,e.g.j()),!0)}function Ke(e,t,n){if(2!==e.h)return!1;var r,i=e.g.j(),o=(e=e.g).g;if(e.g+=i,P(e),e=e.h,J)(r=S)||(r=S=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?s.push(65533):(l=e[o++],194>a||128!=(192&l)?(o--,s.push(65533)):s.push((31&a)<<6|63&l)):240>a?o>=i-1?s.push(65533):128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,s.push(65533)):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?s.push(65533):128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,s.push(65533)):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):s.push(65533),8192<=s.length&&(d=E(d,s),s.length=0);r=E(d,s)}return Ee(t,n,r),!0}function Le(e,t,n,r,i){if(2!==e.h)return!1;e=oe(e,new r,i);var o=void 0!==o&&o;return t.g||(t.g={}),r=e&&Ne(e),t.g[n]=e,Ee(t,n,r,o),!0}function ze(e,t,n,r,i){return 2===e.h&&(Je(t,n,e=oe(e,new r,i),r,void 0),!0)}function Oe(e,t,n){return(0===e.h||2===e.h)&&(t=ye(t,n),2==e.h?ae(e,z.prototype.j,t):t.push(e.g.j()),!0)}function je(e,t,n){return 0===e.h&&(Ee(t,n,j(e.g)),!0)}function Pe(e){Be.call(this,e,-1,et)}function _e(e,t){return ke(e,t,Ze||(Ze={1:He,2:He,3:xe,4:je}))}Be.prototype.toJSON=function(){return be(Ne(this),Ue)},Be.prototype.toString=function(){return Ne(this).toString()},g(Pe,Be),Pe.prototype.getRows=function(){return Ie(this,1)},Pe.prototype.getCols=function(){return Ie(this,2)},Pe.prototype.getPackedDataList=function(){return Ve(this)},Pe.prototype.getLayout=function(){return Ce(this,4,0)};var qe,$e,et=[3];function tt(e){Be.call(this,e)}function nt(e,t){var n=Ie(e,1);if(null!=n&&null!=n){ee(t.g,8);var r=t.g;if(0<=n)ee(r,n);else{for(var i=0;9>i;i++)$(r,127&n|128),n>>=7;$(r,1)}}we(t,e,2),null!=(r=Ie(e,3))&&de(t,3,G(r)),null!=(r=Ie(e,4))&&de(t,4,G(r)),Ge(e,t)}function rt(e,t){return ke(e,t,qe||(qe={1:He,2:De,3:Ke,4:Ke}))}function it(e){Be.call(this,e,-1,ct)}function ot(e,t){return ke(e,t,$e||($e={1:[ze,tt,rt]}))}g(tt,Be),g(it,Be),it.prototype.addClassification=function(e,t){return Je(this,1,e,tt,t),this};var at,lt,ct=[1];function st(e){Be.call(this,e)}function dt(e,t){we(t,e,1),we(t,e,2),we(t,e,3),we(t,e,4),we(t,e,5),Ge(e,t)}function ut(e,t){return ke(e,t,at||(at={1:De,2:De,3:De,4:De,5:De}))}function At(e){Be.call(this,e,-1,Ft)}function ht(e,t){return ke(e,t,lt||(lt={1:[ze,st,ut]}))}g(st,Be),g(At,Be);var gt,Qt,Ft=[1];function pt(e){Be.call(this,e)}function Ut(e,t){we(t,e,1),we(t,e,2),we(t,e,3),we(t,e,4),we(t,e,5);var n=Ie(e,6);if(null!=n&&null!=n){ee(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=L=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}Ge(e,t)}function mt(e,t){return ke(e,t,gt||(gt={1:De,2:De,3:De,4:De,5:De,6:Me}))}function bt(e){Be.call(this,e,-1,ft)}function Bt(e,t){return ke(e,t,Qt||(Qt={1:je,2:je,3:xe,4:Oe}))}g(pt,Be),g(bt,Be),bt.prototype.getVertexType=function(){return Ce(this,1,0)},bt.prototype.getPrimitiveType=function(){return Ce(this,2,0)},bt.prototype.getVertexBufferList=function(){return Ve(this)},bt.prototype.getIndexBufferList=function(){return ye(this,4)};var Zt,ft=[3,4];function Rt(e){Be.call(this,e)}function It(e,t){return ke(e,t,Zt||(Zt={1:[Le,bt,Bt],2:[Le,Pe,_e]}))}g(Rt,Be),Rt.prototype.getMesh=function(){return Se(this,bt,1)},Rt.prototype.getPoseTransformMatrix=function(){return Se(this,Pe,2)};var yt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Vt=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ct=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Wt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Et=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],St=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],vt=[].concat(c(yt),c(Vt),c(Ct),c(Wt),c(Et),c(St));function Jt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Nt(e){return ve(e,tt,1).map((function(e){return{index:Ce(e,1,0),score:We(e,2),label:null!=Ie(e,3)?Ce(e,3,""):void 0,displayName:null!=Ie(e,4)?Ce(e,4,""):void 0}}))}function Gt(e){return{x:We(e,1),y:We(e,2),z:We(e,3),visibility:null!=Ie(e,4)?We(e,4):void 0}}function Xt(e){return ve(Ye(e,At,ht),st,1).map(Gt)}function kt(e,t){this.h=e,this.g=t,this.l=0}function Tt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Jt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Jt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),ca:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Yt(e){this.g=e}var wt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Dt(e,t){return t+e}function xt(e,t){window[e]=t}function Mt(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||Dt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Ht(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.R?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(wt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return xt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),xt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=Kt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.S)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,Kt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,aa:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.D=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,g.g=0}}))}function Kt(e,t){var n,r;return f((function(i){return t in e.F?i.return(e.F[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.F[t]=r,i.return(r))}))}function Lt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new kt(e.h,e.D),e.s[t]=r),i.return(Tt(r,n,e.G))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=Ye(b.get(I),pt,mt);y={T:{X:We(y,1),Y:We(y,2),height:We(y,3),width:We(y,4),rotation:We(y,5,0),W:Ce(y,6,0)},O:Xt(B.get(I)),M:Nt(Ye(Z.get(I),it,ot))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.s[u])||(g=new kt(e.h,e.D),e.s[u]=g),U(m,Tt(g,h,e.G),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function zt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=Lt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Ot(e){return e.map(jt)}function jt(e){var t=(e=Ye(e,Rt,It)).getMesh();if(!t)return e;var n=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return n};var r=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return r},e}function Pt(e){var t=this;e=e||{},this.g=new Mt({locateFile:e.locateFile,files:[{url:"holistic_solution_packed_assets_loader.js"},{simd:!1,url:"holistic_solution_wasm_bin.js"},{simd:!0,url:"holistic_solution_simd_wasm_bin.js"}],graph:{url:"holistic.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:"left_hand_landmarks right_hand_landmarks face_landmarks pose_landmarks world_landmarks segmentation_mask image_transformed multi_face_geometry".split(" "),outs:{image:{type:"texture",stream:"image_transformed"},leftHandLandmarks:{type:"proto",stream:"left_hand_landmarks",transform:Xt},rightHandLandmarks:{type:"proto",stream:"right_hand_landmarks",transform:Xt},faceLandmarks:{type:"proto",stream:"face_landmarks",transform:Xt},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:Xt},ea:{type:"proto",stream:"world_landmarks",transform:Xt},segmentationMask:{type:"texture",stream:"segmentation_mask"},multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:Ot}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelComplexity:{type:1,default:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i,o;return f((function(a){if(1==a.g){switch(n="",e){case 1:n="pose_landmark_full.tflite";break;case 2:n="pose_landmark_heavy.tflite";break;default:n="pose_landmark_lite.tflite"}return r="third_party/mediapipe/modules/pose_landmark/"+n,i=t.g.locateFile(n,""),U(a,fetch(i),3)}return 2!=a.g?U(a,a.h.arrayBuffer(),2):(o=a.h,t.g.overrideFile(r,o),U(a,t.g.reset(),0))}))}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},refineFaceLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineFaceLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"holisticlandmarkgpu__poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"holisticlandmarkgpu__poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}})}(t=Mt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Ht(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.P===e.g.graph.url?d.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.P=e.g.graph.url,U(d,Kt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.B)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.B[i]);if(e.B={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,zt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.v){c.g=2;break}t=l(e.v),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.v=void 0;case 2:if(e.A){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.A=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.C,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.m[c.stream];if(Q||(Q=new kt(A.h,A.D),A.m[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.m[c.stream])||(Q=new Yt(A.h),A.m[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.T,f=new pt;if(Ee(f,1,Z.X),Ee(f,2,Z.Y),Ee(f,3,Z.height),Ee(f,4,Z.width),Ee(f,5,Z.rotation),Ee(f,6,Z.W),Z=Te(f,Ut),b.call(m,B,Z),F.O)for(m=0;m<F.O.length;++m){var R=!!(f=F.O[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ee(R=new st,1,f.x),Ee(R,2,f.y),Ee(R,3,f.z),f.visibility&&Ee(R,4,f.visibility),f=Te(R,dt),B.call(b,Z,f)}if(F.M)for(m=0;m<F.M.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.M[m],Ee(R=new tt,2,f.score),f.index&&Ee(R,1,f.index),f.label&&Ee(R,3,f.label),f.displayName&&Ee(R,4,f.displayName),f=Te(R,nt),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.C,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Mt),y("OptionType",{BOOL:0,NUMBER:1,Z:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Pt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Holistic",Pt),y("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),y("FACEMESH_LIPS",yt),y("FACEMESH_LEFT_EYE",Vt),y("FACEMESH_LEFT_EYEBROW",Ct),y("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),y("FACEMESH_RIGHT_EYE",Wt),y("FACEMESH_RIGHT_EYEBROW",Et),y("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),y("FACEMESH_FACE_OVAL",St),y("FACEMESH_CONTOURS",vt),y("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),y("HAND_CONNECTIONS",[[0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]]),y("POSE_CONNECTIONS",[[0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]]),y("POSE_LANDMARKS",{NOSE:0,LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,LEFT_EAR:7,RIGHT_EAR:8,LEFT_RIGHT:9,RIGHT_LEFT:10,LEFT_SHOULDER:11,RIGHT_SHOULDER:12,LEFT_ELBOW:13,RIGHT_ELBOW:14,LEFT_WRIST:15,RIGHT_WRIST:16,LEFT_PINKY:17,RIGHT_PINKY:18,LEFT_INDEX:19,RIGHT_INDEX:20,LEFT_THUMB:21,RIGHT_THUMB:22,LEFT_HIP:23,RIGHT_HIP:24,LEFT_KNEE:25,RIGHT_KNEE:26,LEFT_ANKLE:27,RIGHT_ANKLE:28,LEFT_HEEL:29,RIGHT_HEEL:30,LEFT_FOOT_INDEX:31,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_LEFT",{LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,LEFT_EAR:7,LEFT_RIGHT:9,LEFT_SHOULDER:11,LEFT_ELBOW:13,LEFT_WRIST:15,LEFT_PINKY:17,LEFT_INDEX:19,LEFT_THUMB:21,LEFT_HIP:23,LEFT_KNEE:25,LEFT_ANKLE:27,LEFT_HEEL:29,LEFT_FOOT_INDEX:31}),y("POSE_LANDMARKS_RIGHT",{RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,RIGHT_EAR:8,RIGHT_LEFT:10,RIGHT_SHOULDER:12,RIGHT_ELBOW:14,RIGHT_WRIST:16,RIGHT_PINKY:18,RIGHT_INDEX:20,RIGHT_THUMB:22,RIGHT_HIP:24,RIGHT_KNEE:26,RIGHT_ANKLE:28,RIGHT_HEEL:30,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_NEUTRAL",{NOSE:0}),y("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),r=e.getPackedDataList(),i=[],o=0;o<n;o++)i.push(Array(t));for(o=0;o<n;o++)for(var a=0;a<t;a++){var l=1===e.getLayout()?o*t+a:a*n+o;i[o][a]=r[l]}return i})),y("VERSION","0.5.1635989137")}).call(Te);const Ye={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.na=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={da:t,ea:!0},e.g=e.o||e.u}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.ea)throw t.da;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.s):(e.g.s(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.s):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.s=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.u},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.s=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.H(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.o(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.I(t,e):this.o(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.o=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.G(),this.B()},t.prototype.G=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.s)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.H=function(e){var t=this.j();e.M(t.resolve,t.reject)},t.prototype.I=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.M(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.M=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.s=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).M(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).M(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(){throw Error("Invalid UTF8")}function C(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var W,E,S=typeof TextDecoder<"u",v=typeof TextEncoder<"u",J={},N=null;function G(e){var t;void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),i!==n?r.subarray(0,i):r}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array;function w(e){return Y&&null!=e&&e instanceof Uint8Array}function D(e){if(this.L=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var x="function"==typeof Uint8Array.prototype.slice,M=0;function H(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function K(){return Error("Failed to read varint, encoding is invalid.")}function L(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.v=t,e&&z(this,e)}function z(e,t){e.h=function(e,t){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return X(e);if(e.constructor===D)return!t&&(t=e.L)&&t.constructor===Uint8Array?t:(t=null==(t=e.L)||w(t)?t:"string"==typeof t?X(t):null,(e=e.L=t)?new Uint8Array(e):T||(T=new Uint8Array(0)));if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t,e.v),e.j=0,e.i=e.h.length,e.g=e.j}function O(e){if(e.g>e.i)throw Error("Tried to read past the end of the data "+e.g+" > "+e.i)}function j(e){var t=e.h,n=t[e.g],r=127&n;if(128>n)return e.g+=1,O(e),r;if(r|=(127&(n=t[e.g+1]))<<7,128>n)return e.g+=2,O(e),r;if(r|=(127&(n=t[e.g+2]))<<14,128>n)return e.g+=3,O(e),r;if(r|=(127&(n=t[e.g+3]))<<21,128>n)return e.g+=4,O(e),r;if(n=t[e.g+4],e.g+=5,r|=(15&n)<<28,128>n)return O(e),r;if(128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++])throw K();return O(e),r}L.prototype.reset=function(){this.g=this.j};var P=[];function _(){this.g=[]}function q(e,t){for(;127<t;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function $(e){var t={},n=void 0!==t.W&&t.W;this.l={v:void 0!==t.v&&t.v},this.W=n,t=this.l,P.length?(n=P.pop(),t&&(n.v=t.v),e&&z(n,e),e=n):e=new L(e,t),this.g=e,this.j=this.g.g,this.h=this.i=-1}function ee(e){var t=e.g;if(t.g==t.i)return!1;e.j=e.g.g;var n=j(e.g)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw H(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.i=t,e.h=n,!0}function te(e){switch(e.h){case 0:if(0!=e.h)te(e);else e:{for(var t=(e=e.g).g,n=t+10;t<n;)if(!(128&e.h[t++])){e.g=t,O(e);break e}throw K()}break;case 1:(e=e.g).g+=8,O(e);break;case 2:2!=e.h?te(e):(t=j(e.g)>>>0,(e=e.g).g+=t,O(e));break;case 5:(e=e.g).g+=4,O(e);break;case 3:for(t=e.i;;){if(!ee(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.h){if(e.i!=t)throw Error("Unmatched end-group tag");break}te(e)}break;default:throw H(e.h,e.j)}}_.prototype.length=function(){return this.g.length},_.prototype.end=function(){var e=this.g;return this.g=[],e},$.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var ne=[];function re(){this.i=[],this.h=0,this.g=new _}function ie(e,t){0!==t.length&&(e.i.push(t),e.h+=t.length)}var oe="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ae(e,t){Object.isFrozen(e)||(oe?e[oe]|=t:void 0!==e.N?e.N|=t:Object.defineProperties(e,{N:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function le(e){var t;return null!=(t=oe?e[oe]:e.N)?t:0}function ce(e){return ae(e,1),e}function se(e){return!!Array.isArray(e)&&!!(2&le(e))}function de(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ae(e,2)}function ue(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var Ae=Object.freeze(ce([]));function he(e){if(se(e.m))throw Error("Cannot mutate an immutable Message")}var ge,Qe=typeof Symbol<"u"&&typeof Symbol.hasInstance<"u";function Fe(e){return{value:e,configurable:!1,writable:!1,enumerable:!1}}function pe(e,t,n){return-1===t?null:t>=e.i?e.g?e.g[t]:void 0:void 0!==n&&n&&e.g&&null!=(n=e.g[t])?n:e.m[t+e.h]}function Ue(e,t,n,r){r=void 0!==r&&r,he(e),t<e.i&&!r?e.m[t+e.h]=n:(e.g||(e.g=e.m[e.i+e.h]={}))[t]=n}function me(e,t,n,r){n=void 0===n||n;var i=pe(e,t,r=void 0!==r&&r);return null==i&&(i=Ae),se(e.m)?n&&(de(i),Object.freeze(i)):(i===Ae||se(i))&&Ue(e,t,i=ce(i.slice()),r),i}function be(e,t,n){var r;return null!=(r=e=null==(e=pe(e,t))?e:+e)?r:void 0===n?0:n}function Be(e,t,n,r){e.j||(e.j={});var i=se(e.m),o=e.j[n];if(!o){r=me(e,n,!0,void 0!==r&&r),o=[],i=i||se(r);for(var a=0;a<r.length;a++)o[a]=new t(r[a]),i&&de(o[a].m);i&&(de(o),Object.freeze(o)),e.j[n]=o}return o}function Ze(e,t,n,r,i){var o=void 0!==o&&o;return he(e),o=Be(e,n,t,o),n=r||new n,e=me(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.m)):(o.push(n),e.push(n.m)),n}function fe(e,t){var n;return null!=(n=e=pe(e,t))?n:0}function Re(e,t){var n;return null!=(n=e=pe(e,t))?n:""}function Ie(e){var t=Ce;return Ve(e,t=void 0===t?We:t)}function ye(e,t){if(null!=e){if(Array.isArray(e))e=Ve(e,t);else if(ue(e)){var n,r={};for(n in e)r[n]=ye(e[n],t);e=r}else e=t(e);return e}}function Ve(e,t){for(var n=e.slice(),r=0;r<n.length;r++)n[r]=ye(n[r],t);return Array.isArray(e)&&1&le(e)&&ce(n),n}function Ce(e){return e&&"object"==typeof e&&e.toJSON?e.toJSON():(e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e&&!Array.isArray(e)){if(w(e))return G(e);if(e instanceof D){var t=e.L;return t=null==t||"string"==typeof t?t:Y&&t instanceof Uint8Array?G(t):null,(e.L=t)||""}}}return e}(e),Array.isArray(e)?Ie(e):e)}function We(e){return w(e)?new Uint8Array(e):e}function Ee(e,t,n){e||(e=ge),ge=null;var r=this.constructor.h;if(e||(e=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=e,e=(r=this.m.length)-1,r&&ue(r=this.m[e])?(this.i=e-this.h,this.g=r):void 0!==t&&-1<t?(this.i=Math.max(t,e+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)if((e=n[t])<this.i)e+=this.h,(r=this.m[e])?Array.isArray(r)&&ce(r):this.m[e]=Ae;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[e];i?Array.isArray(i)&&ce(i):r[e]=Ae}}function Se(){Ee.apply(this,arguments)}if(Ee.prototype.toJSON=function(){return Ie(this.m)},Ee.prototype.toString=function(){return this.m.toString()},g(Se,Ee),Qe){var ve={};Object.defineProperties(Se,(ve[Symbol.hasInstance]=Fe((function(){throw Error("Cannot perform instanceof checks for MutableMessage")})),ve))}function Je(e,t,n){if(n){var r,i={};for(r in n){var o=n[r],a=o.ha;a||(i.F=o.la||o.fa.P,o.aa?(i.U=we(o.aa),a=function(e){return function(t,n,r){return e.F(t,n,r,e.U)}}(i)):o.ca?(i.T=De(o.X.g,o.ca),a=function(e){return function(t,n,r){return e.F(t,n,r,e.T)}}(i)):a=i.F,o.ha=a),a(t,e,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(e,t){if(t=t.ba){ie(e,e.g.end());for(var n=0;n<t.length;n++)ie(e,t[n])}}(t,e)}var Ne=Symbol();function Ge(e,t,n){return e[Ne]||(e[Ne]=function(e,r){return t(e,r,n)})}function Xe(e){var t=e[Ne];if(!t){var n=$e(e);t=function(e,t){return et(e,t,n)},e[Ne]=t}return t}function ke(e){var t=function(e){var t=e.aa;return t?Xe(t):(t=e.ka)?Ge(e.X.g,t,e.ca):void 0}(e),n=e.X,r=e.fa.O;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function Te(e,t,n,r,i,o){var a=0;for((e=e()).length&&"number"!=typeof e[0]&&(n(t,e[0]),a++);a<e.length;){n=e[a++];for(var l=a+1;l<e.length&&"number"!=typeof e[l];)l++;var c=e[a++];switch(l-=a){case 0:r(t,n,c);break;case 1:r(t,n,c,e[a++]);break;case 2:i(t,n,c,e[a++],e[a++]);break;case 3:l=e[a++];var s=e[a++],d=e[a++];Array.isArray(d)?i(t,n,c,l,s,d):o(t,n,c,l,s,d);break;case 4:o(t,n,c,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return t}var Ye=Symbol();function we(e){var t=e[Ye];if(!t){var n=ze(e);t=function(e,t){return nt(e,t,n)},e[Ye]=t}return t}function De(e,t){var n=e[Ye];return n||(n=function(e,n){return Je(e,n,t)},e[Ye]=n),n}var xe=Symbol();function Me(e,t){e.push(t)}function He(e,t,n){e.push(t,n.P)}function Ke(e,t,n,r,i){var o=we(i),a=n.P;e.push(t,(function(e,t,n){return a(e,t,n,r,o)}))}function Le(e,t,n,r,i,o){var a=De(r,o),l=n.P;e.push(t,(function(e,t,n){return l(e,t,n,r,a)}))}function ze(e){return e[xe]||Te(e,e[xe]=[],Me,He,Ke,Le)}var Oe=Symbol();function je(e,t){e[0]=t}function Pe(e,t,n,r){var i=n.O;e[t]=r?function(e,t,n){return i(e,t,n,r)}:i}function _e(e,t,n,r,i,o){var a=n.O,l=Xe(i);e[t]=function(e,t,n){return a(e,t,n,r,l,o)}}function qe(e,t,n,r,i,o,a){var l=n.O,c=Ge(r,i,o);e[t]=function(e,t,n){return l(e,t,n,r,c,a)}}function $e(e){return e[Oe]||Te(e,e[Oe]={},je,Pe,_e,qe)}function et(e,t,n){for(;ee(t)&&4!=t.h;){var r=t.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=ke(o))}if(!(i&&i(t,e,r)||(i=t,r=e,o=i.j,te(i),i.W))){var a=i.g.h;i=o===(i=i.g.g)?T||(T=new Uint8Array(0)):x?a.slice(o,i):new Uint8Array(a.subarray(o,i)),(o=r.ba)?o.push(i):r.ba=[i]}}return e}function tt(e,t,n){if(ne.length){var r=ne.pop();e&&(z(r.g,e),r.i=-1,r.h=-1),e=r}else e=new $(e);try{return et(new t,e,$e(n))}finally{(t=e.g).h=null,t.j=0,t.i=0,t.g=0,t.v=!1,e.i=-1,e.h=-1,100>ne.length&&ne.push(e)}}function nt(e,t,n){for(var r=n.length,i=r%2==1,o=i?1:0;o<r;o+=2)(0,n[o+1])(t,e,n[o]);Je(e,t,i?n[0]:void 0)}function rt(e,t){var n=new re;nt(e,n,ze(t)),ie(n,n.g.end()),e=new Uint8Array(n.h);for(var r=(t=n.i).length,i=0,o=0;o<r;o++){var a=t[o];e.set(a,i),i+=a.length}return n.i=[e],e}function it(e,t){return{O:e,P:t}}var ot=it((function(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,O(e),e=2*((i=(r<<0|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,Ue(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){q(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?M=0:(0,M=2147483648):isNaN(r)?(0,M=2147483647):34028234663852886e22<r?(0,M=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,M=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,M=(n<<31|t+127<<23|8388607&r)>>>0),n=M,e.g.push(n>>>0&255),e.g.push(n>>>8&255),e.g.push(n>>>16&255),e.g.push(n>>>24&255)}})),at=it((function(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,a=e=0;4>a&&128<=i;a++)i=r.h[r.g++],O(r),o|=(127&i)<<7*a;if(128<=i&&(i=r.h[r.g++],O(r),o|=(127&i)<<28,e|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)i=r.h[r.g++],O(r),e|=(127&i)<<7*a+3;if(!(128>i))throw K();return r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),Ue(t,n,e?-r:r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t){q(e.g,8*n),e=e.g;var r=t;for(n=0>r,t=(r=Math.abs(r))>>>0,r=Math.floor((r-t)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(t=1+(~t>>>0))&&(t=0,4294967295<++r&&(r=0))),n=M=t,t=r;0<t||127<n;)e.g.push(127&n|128),n=(n>>>7|t<<25)>>>0,t>>>=7;e.g.push(n)}})),lt=it((function(e,t,n){return 0===e.h&&(Ue(t,n,j(e.g)),!0)}),(function(e,t,n){if(null!=(t=pe(t,n))&&null!=t)if(q(e.g,8*n),e=e.g,0<=(n=t))q(e,n);else{for(t=0;9>t;t++)e.g.push(127&n|128),n>>=7;e.g.push(1)}})),ct=it((function(e,t,n){if(2!==e.h)return!1;var r,i=j(e.g)>>>0,o=(e=e.g).g;if(e.g+=i,O(e),e=e.h,S)(r=W)||(r=W=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?V():(l=e[o++],194>a||128!=(192&l)?(o--,V()):s.push((31&a)<<6|63&l)):240>a?o>=i-1?V():128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,V()):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?V():128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,V()):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):V(),8192<=s.length&&(d=C(d,s),s.length=0);r=C(d,s)}return Ue(t,n,r),!0}),(function(e,t,n){if(null!=(t=pe(t,n))){var r=!1;if(r=void 0!==r&&r,v){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(E||(E=new TextEncoder)).encode(t)}else{for(var i=0,o=new Uint8Array(3*t.length),a=0;a<t.length;a++){var l=t.charCodeAt(a);if(128>l)o[i++]=l;else{if(2048>l)o[i++]=l>>6|192;else{if(55296<=l&&57343>=l){if(56319>=l&&a<t.length){var c=t.charCodeAt(++a);if(56320<=c&&57343>=c){l=1024*(l-55296)+c-56320+65536,o[i++]=l>>18|240,o[i++]=l>>12&63|128,o[i++]=l>>6&63|128,o[i++]=63&l|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");l=65533}o[i++]=l>>12|224,o[i++]=l>>6&63|128}o[i++]=63&l|128}}t=o.subarray(0,i)}q(e.g,8*n+2),q(e.g,t.length),ie(e,e.g.end()),ie(e,t)}})),st=it((function(e,t,n,r,i){if(2!==e.h)return!1;t=Ze(t,n,r),n=e.g.i,r=j(e.g)>>>0;var o=e.g.g+r,a=o-n;if(0>=a&&(e.g.i=o,i(t,e),a=o-e.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=n,!0}),(function(e,t,n,r,i){if(null!=(t=Be(t,r,n)))for(r=0;r<t.length;r++){var o=e;q(o.g,8*n+2);var a=o.g.end();ie(o,a),a.push(o.h),o=a,i(t[r],e),a=e;var l=o.pop();for(l=a.h+a.g.length()-l;127<l;)o.push(127&l|128),l>>>=7,a.h++;o.push(l),a.h++}}));function dt(){Se.apply(this,arguments)}if(g(dt,Se),Qe){var ut={};Object.defineProperties(dt,(ut[Symbol.hasInstance]=Fe(Object[Symbol.hasInstance]),ut))}function At(e){dt.call(this,e)}function ht(){return[1,lt,2,ot,3,ct,4,ct]}function gt(e){dt.call(this,e,-1,Ft)}function Qt(){return[1,st,At,ht]}g(At,dt),g(gt,dt),gt.prototype.addClassification=function(e,t){return Ze(this,1,At,e,t),this};var Ft=[1];function pt(e){dt.call(this,e)}function Ut(){return[1,ot,2,ot,3,ot,4,ot,5,ot]}function mt(e){dt.call(this,e,-1,Bt)}function bt(){return[1,st,pt,Ut]}g(pt,dt),g(mt,dt);var Bt=[1];function Zt(e){dt.call(this,e)}function ft(){return[1,ot,2,ot,3,ot,4,ot,5,ot,6,at]}g(Zt,dt);var Rt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],It=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],yt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Vt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Ct=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Wt=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Et=[].concat(c(Rt),c(It),c(yt),c(Vt),c(Ct),c(Wt));function St(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function vt(e){return Be(e,At,1).map((function(e){return{index:fe(e,1),ga:be(e,2),label:null!=pe(e,3)?Re(e,3):void 0,displayName:null!=pe(e,4)?Re(e,4):void 0}}))}function Jt(e){return{x:be(e,1),y:be(e,2),z:be(e,3),visibility:null!=pe(e,4)?be(e,4):void 0}}function Nt(e,t){this.h=e,this.g=t,this.l=0}function Gt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.o){var r=St(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=St(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),ma:i},e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.j.K),n.vertexAttribPointer(e.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.o),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Xt(e){this.g=e}var kt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Tt(e,t){return t+e}function Yt(e,t){window[e]=t}function wt(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=e.resolve(),this.Y="",this.C={},this.locateFile=t&&t.locateFile||Tt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Dt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.Z?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.o=2,U(e,WebAssembly.instantiate(kt),4);case 4:e.g=3,e.o=0;break;case 2:return e.o=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return Yt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Yt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=xt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.$)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,xt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.$)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ja:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.G=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.Z=!1,g.g=0}}))}function xt(e,t){var n,r;return f((function(i){return t in e.H?i.return(e.H[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.H[t]=r,i.return(r))}))}function Mt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.I=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.u[t])||(r=new Nt(e.h,e.G),e.u[t]=r),i.return(Gt(r,n,e.I))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=tt(b.get(I),Zt,ft);y={boundingBox:{xCenter:be(y,1),yCenter:be(y,2),height:be(y,3),width:be(y,4),rotation:be(y,5,0),rectId:fe(y,6)},landmarks:Be(tt(B.get(I),mt,bt),pt,1).map(Jt),V:vt(tt(Z.get(I),gt,Qt))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.u[u])||(g=new Nt(e.h,e.G),e.u[u]=g),U(m,Gt(g,h,e.I),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Ht(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.D=Mt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function Kt(e){var t=this;e=e||{};var n={url:"face_detection_short.binarypb"},r={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new wt({locateFile:e.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:n,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(e){var i,o,a,c,s;return f((function(d){switch(d.g){case 1:i=l("short"===e?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"]),o=i.next();case 2:if(o.done){d.g=4;break}return a=o.value,c="third_party/mediapipe/modules/face_detection/"+a,U(d,xt(t.g,a),5);case 5:s=d.h,t.g.overrideFile(c,s),o=i.next(),d.g=2;break;case 4:return n.url="short"===e?"face_detection_short.binarypb":"face_detection_full.binarypb",r.graphOptionXref.calculatorName="short"===e?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",d.return(!0)}}))}},minDetectionConfidence:r}})}(t=wt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.o={},e.u={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={R:o.R,S:o.S},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.R=c.onChange,o.S=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.R(e.S),2);!0===t.h&&(n.s=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Dt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.Y===e.g.graph.url?d.return():(e.s=!0,e.g.graph&&e.g.graph.url?(e.Y=e.g.graph.url,U(d,xt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Ht(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.s)return c.return();if(!e.A){c.g=2;break}t=l(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.B),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.B=void 0}e.s=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.D,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.o[c.stream];if(Q||(Q=new Nt(A.h,A.G),A.o[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.o[c.stream])||(Q=new Xt(A.h),A.o[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.boundingBox,f=new Zt;if(Ue(f,1,Z.xCenter),Ue(f,2,Z.yCenter),Ue(f,3,Z.height),Ue(f,4,Z.width),Ue(f,5,Z.rotation),Ue(f,6,Z.rectId),Z=rt(f,ft),b.call(m,B,Z),F.landmarks)for(m=0;m<F.landmarks.length;++m){var R=!!(f=F.landmarks[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ue(R=new pt,1,f.x),Ue(R,2,f.y),Ue(R,3,f.z),f.visibility&&Ue(R,4,f.visibility),f=rt(R,Ut),B.call(b,Z,f)}if(F.V)for(m=0;m<F.V.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.V[m],Ue(R=new At,2,f.ga),f.index&&Ue(R,1,f.index),f.label&&Ue(R,3,f.label),f.displayName&&Ue(R,4,f.displayName),f=rt(R,ht),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.D,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",wt),y("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Kt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("FaceDetection",Kt),y("FACEDETECTION_LIPS",Rt),y("FACEDETECTION_LEFT_EYE",It),y("FACEDETECTION_LEFT_EYEBROW",yt),y("FACEDETECTION_RIGHT_EYE",Vt),y("FACEDETECTION_RIGHT_EYEBROW",Ct),y("FACEDETECTION_FACE_OVAL",Wt),y("FACEDETECTION_CONTOURS",Et),y("FACEDETECTION_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),y("VERSION","0.4.1646425229")}).call(Ye);const we={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(e,t){return t=new Z(new m(t)),h&&e.prototype&&h(t,e.prototype),t}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s};var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var C,W,E=typeof TextDecoder<"u",S=typeof TextEncoder<"u";function v(e){if(S)e=(W||(W=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var J={},N=null;function G(e,t){void 0===t&&(t=0),k(),t=J[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function X(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=N[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}k();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function k(){if(!N){N={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));J[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===N[o]&&(N[o]=i)}}}}var T,Y="function"==typeof Uint8Array.prototype.slice;function w(e,t,n){return t===n?T||(T=new Uint8Array(0)):Y?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var D=0;function x(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.j=this.l=0,this.m=!1,this.v=t,e&&M(this,e)}function M(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?X(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.l=0,e.j=e.h.length,e.g=e.l}function H(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.m=!0}x.prototype.reset=function(){this.g=this.l},x.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},x.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,e=2*((n=(e<<0|t<<8|n<<16|r<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var K=[];function L(){this.g=new Uint8Array(64),this.h=0}function z(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function O(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,K.length?(n=K.pop(),t&&(n.v=t.v),e&&M(n,e),e=n):e=new x(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function j(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function P(e,t,n){var r=e.g.j,i=e.g.i(),o=e.g.g+i;if(e.g.j=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.j=r,t}function _(e){return e.g.o()}function q(e){var t,n=e.g.i(),r=(e=e.g).g;if(e.g+=n,e=e.h,E)(t=C)||(t=C=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(r,r+n));else{n=r+n;for(var i,o,a,l=[],c=null;r<n;)128>(i=e[r++])?l.push(i):224>i?r>=n?l.push(65533):(o=e[r++],194>i||128!=(192&o)?(r--,l.push(65533)):l.push((31&i)<<6|63&o)):240>i?r>=n-1?l.push(65533):128!=(192&(o=e[r++]))||224===i&&160>o||237===i&&160<=o||128!=(192&(t=e[r++]))?(r--,l.push(65533)):l.push((15&i)<<12|(63&o)<<6|63&t):244>=i?r>=n-2?l.push(65533):128!=(192&(o=e[r++]))||o-144+(i<<28)>>30||128!=(192&(t=e[r++]))||128!=(192&(a=e[r++]))?(r--,l.push(65533)):(i=(7&i)<<18|(63&o)<<12|(63&t)<<6|63&a,i-=65536,l.push(55296+(i>>10&1023),56320+(1023&i))):l.push(65533),8192<=l.length&&(c=V(c,l),l.length=0);t=V(c,l)}return t}function $(e,t,n){var r=e.g.i();for(r=e.g.g+r;e.g.g<r;)n.push(t.call(e.g))}function ee(e,t){2==e.h?$(e,x.prototype.o,t):t.push(_(e))}function te(){this.h=[],this.i=0,this.g=new L}function ne(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function re(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var n=e.h,r=n.length,i=0,o=0;o<r;o++){var a=n[o];0!==a.length&&(t.set(a,i),i+=a.length)}return 0!==(r=(n=e.g).h)&&(t.set(n.g.subarray(0,r),i),n.h=0),e.h=[t],t}function ie(e,t,n){if(null!=n){z(e.g,8*t+5),e=e.g;var r=n;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?D=0:(0,D=2147483648):isNaN(r)?(0,D=2147483647):34028234663852886e22<r?(0,D=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,D=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,D=(n<<31|t+127<<23|8388607&r)>>>0),n=D,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}L.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},L.prototype.length=function(){return this.h},L.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,w(e,0,t)},O.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var oe="function"==typeof Uint8Array;function ae(e,t,n){if(null!=e)return"object"==typeof e?oe&&e instanceof Uint8Array?n(e):le(e,t,n):t(e)}function le(e,t,n){if(Array.isArray(e)){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=ae(e[i],t,n);return Array.isArray(e)&&e.W&&ue(r),r}for(i in r={},e)r[i]=ae(e[i],t,n);return r}function ce(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var se,de={W:{value:!0,configurable:!0}};function ue(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,de),e}function Ae(e,t,n){var r=se;if(se=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=r?0:-1,this.m=this.g=null,this.h=e,e=(r=this.h.length)-1,!r||(null===(r=this.h[e])||"object"!=typeof r||Array.isArray(r)||oe&&r instanceof Uint8Array)?void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE:(this.l=e-this.j,this.i=r),n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.h[e])?ue(r):this.h[e]=he):(ge(this),(r=this.i[e])?ue(r):this.i[e]=he)}var he=Object.freeze(ue([]));function ge(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function Qe(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function Fe(e,t){var n=void 0!==n&&n,r=Qe(e,t,n);return null==r&&(r=he),r===he&&be(e,t,r=ue([]),n),r}function pe(e){var t=Fe(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n<t.length;n++)t[n]=+t[n];e.m[3]=!0}return t}function Ue(e,t,n){var r;return null!=(r=e=Qe(e,t))?r:n}function me(e,t,n){var r;return null!=(r=e=null==(e=Qe(e,t))?e:+e)?r:void 0===n?0:n}function be(e,t,n,r){void 0!==r&&r||t>=e.l?(ge(e),e.i[t]=n):e.h[t+e.j]=n}function Be(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var r=Qe(e,n,!1);r&&(e.g[n]=new t(r))}return e.g[n]}function Ze(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var r=Fe(e,1);n=[];for(var i=0;i<r.length;i++)n[i]=new t(r[i]);e.g[1]=n}return n}function fe(e,t,n){var r=void 0!==r&&r;e.g||(e.g={});var i=n&&Ie(n);e.g[t]=n,be(e,t,i,r)}function Re(e,t,n,r){var i=Ze(e,n);t=t||new n,e=Fe(e,1),null!=r?(i.splice(r,0,t),e.splice(r,0,Ie(t))):(i.push(t),e.push(Ie(t)))}function Ie(e,t){if(e.g)for(var n in e.g){var r=e.g[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&Ie(r[i]);else r&&Ie(r)}return e.h}function ye(e,t){if(e=e.o){ne(t,t.g.end());for(var n=0;n<e.length;n++)ne(t,e[n])}}function Ve(e,t){if(4==t.h)return!1;var n=t.m;return function e(t){switch(t.h){case 0:if(0!=t.h)e(t);else{for(t=t.g;128&t.h[t.g];)t.g++;t.g++}break;case 1:1!=t.h?e(t):(t=t.g).g+=8;break;case 2:if(2!=t.h)e(t);else{var n=t.g.i();(t=t.g).g+=n}break;case 5:5!=t.h?e(t):(t=t.g).g+=4;break;case 3:for(n=t.l;;){if(!j(t)){t.j=!0;break}if(4==t.h){t.l!=n&&(t.j=!0);break}e(t)}break;default:t.j=!0}}(t),t.N||(t=w(t.g.h,n,t.g.g),(n=e.o)?n.push(t):e.o=[t]),!0}function Ce(e){Ae.call(this,e,-1,Ee)}function We(e,t){for(;j(t);)switch(t.i){case 8:var n=t.g.i();be(e,1,n);break;case 16:be(e,2,n=t.g.i());break;case 29:case 26:ee(t,e.getPackedDataList());break;case 32:be(e,4,n=H(t.g));break;default:if(!Ve(e,t))return e}return e}Ae.prototype.toJSON=function(){return le(Ie(this),ce,G)},Ae.prototype.toString=function(){return Ie(this).toString()},g(Ce,Ae),Ce.prototype.getRows=function(){return Qe(this,1)},Ce.prototype.getCols=function(){return Qe(this,2)},Ce.prototype.getPackedDataList=function(){return pe(this)},Ce.prototype.getLayout=function(){return Ue(this,4,0)};var Ee=[3];function Se(t,n){var r=void 0;return new(r||(r=e))((function(e,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(o,a)}l((n=n.apply(t,void 0)).next())}))}function ve(e){Ae.call(this,e)}function Je(e,t){for(;j(t);)switch(t.i){case 8:var n=t.g.i();be(e,1,n);break;case 21:be(e,2,n=_(t));break;case 26:be(e,3,n=q(t));break;case 34:be(e,4,n=q(t));break;default:if(!Ve(e,t))return e}return e}function Ne(e){Ae.call(this,e,-1,Ge)}g(ve,Ae),g(Ne,Ae),Ne.prototype.addClassification=function(e,t){return Re(this,e,ve,t),this};var Ge=[1];function Xe(e){Ae.call(this,e)}function ke(e,t){for(;j(t);)switch(t.i){case 13:var n=_(t);be(e,1,n);break;case 21:be(e,2,n=_(t));break;case 29:be(e,3,n=_(t));break;case 37:be(e,4,n=_(t));break;case 45:be(e,5,n=_(t));break;default:if(!Ve(e,t))return e}return e}function Te(e){Ae.call(this,e,-1,we)}function Ye(e){e:{var t=new Te;for(e=new O(e);j(e);)switch(e.i){case 10:Re(t,P(e,new Xe,ke),Xe,void 0);break;default:if(!Ve(t,e))break e}}return t}g(Xe,Ae),g(Te,Ae);var we=[1];function De(e){Ae.call(this,e)}function xe(e){Ae.call(this,e,-1,He)}function Me(e,t){for(;j(t);)switch(t.i){case 8:var n=H(t.g);be(e,1,n);break;case 16:be(e,2,n=H(t.g));break;case 29:case 26:ee(t,e.getVertexBufferList());break;case 32:case 34:n=t;var r=e.getIndexBufferList();2==n.h?$(n,x.prototype.i,r):r.push(n.g.i());break;default:if(!Ve(e,t))return e}return e}g(De,Ae),g(xe,Ae),xe.prototype.getVertexType=function(){return Ue(this,1,0)},xe.prototype.getPrimitiveType=function(){return Ue(this,2,0)},xe.prototype.getVertexBufferList=function(){return pe(this)},xe.prototype.getIndexBufferList=function(){return Fe(this,4)};var He=[3,4];function Ke(e){Ae.call(this,e)}function Le(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function ze(e){return Ze(e,ve).map((function(e){return{index:Ue(e,1,0),Y:me(e,2),label:null!=Qe(e,3)?Ue(e,3,""):void 0,displayName:null!=Qe(e,4)?Ue(e,4,""):void 0}}))}function Oe(e){return{x:me(e,1),y:me(e,2),z:me(e,3),visibility:null!=Qe(e,4)?me(e,4):void 0}}function je(e,t){this.h=e,this.g=t,this.l=0}function Pe(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Le(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Le(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function _e(e){this.g=e}g(Ke,Ae),Ke.prototype.getMesh=function(){return Be(this,xe,1)},Ke.prototype.getPoseTransformMatrix=function(){return Be(this,Ce,2)};var qe=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function $e(e,t){return t+e}function et(e,t){window[e]=t}function tt(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||$e,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function nt(t){return Se(t,(function t(){var n,r,i,o,a,l,s,d,u,A,h,g=this;return f(t,(function(t){switch(t.g){case 1:return n=g,g.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(g,g.j),U(t,function(){return Se(this,(function e(){return f(e,(function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(qe),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):t.return();case 2:if(i=t.h,"object"==typeof window)return et("createMediapipeSolutionsWasm",{locateFile:g.locateFile}),et("createMediapipeSolutionsPackedAssets",{locateFile:g.locateFile}),l=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(t){var r=rt(n,t.url);if(void 0!==t.path){var i=t.path;r=r.then((function(t){return n.overrideFile(i,t),e.resolve(t)}))}return r}))),u=e.all(s.map((function(t){return void 0===t.simd||t.simd&&i||!t.simd&&!i?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(n.locateFile(t.url,n.S)):e.resolve()}))).then((function(){return Se(n,(function e(){var t,n,r=this;return f(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,U(e,t(n),2);r.h=e.h,e.g=0}))}))})),A=Se(n,(function e(){var t=this;return f(e,(function(e){return t.g.graph&&t.g.graph.url?e=U(e,rt(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),U(t,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return o=r.filter((function(e){return void 0===e.simd||e.simd&&i||!e.simd&&!i})).map((function(e){return n.locateFile(e.url,n.S)})),importScripts.apply(null,c(o)),U(t,createMediapipeSolutionsWasm(Module),6);case 6:g.h=t.h,g.l=new OffscreenCanvas(1,1),g.h.canvas=g.l,a=g.h.GL.createContext(g.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),g.h.GL.makeContextCurrent(a),t.g=4;break;case 7:if(g.l=document.createElement("canvas"),!(h=g.l.getContext("webgl2",{}))&&!(h=g.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),t.return();g.D=h,g.h.canvas=g.l,g.h.createContext(g.l,!0,!0,{});case 4:g.i=new g.h.SolutionWasm,g.R=!1,t.g=0}}))}))}function rt(e,t){return Se(e,(function e(){var n,r,i=this;return f(e,(function(e){return t in i.F?e.return(i.F[t]):(n=i.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),i.F[t]=r,e.return(r))}))}))}function it(e,t,n){return Se(e,(function e(){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p,m=this;return f(e,(function(e){switch(e.g){case 1:if(!n)return e.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(m.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){e.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(e,function(e,t,n){return Se(e,(function e(){var r,i=this;return f(e,(function(e){return"number"==typeof n||n instanceof Uint8Array||n instanceof i.h.Uint8BlobList?e.return(n):n instanceof i.h.Texture2dDataOut?((r=i.s[t])||(r=new je(i.h,i.D),i.s[t]=r),e.return(Pe(r,n,i.G))):e.return(void 0)}))}))}(m,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=b.get(I);e:{var V=new De;for(y=new O(y);j(y);)switch(y.i){case 13:var C=_(y);be(V,1,C);break;case 21:be(V,2,C=_(y));break;case 29:be(V,3,C=_(y));break;case 37:be(V,4,C=_(y));break;case 45:be(V,5,C=_(y));break;case 48:be(V,6,C=H(y.g));break;default:if(!Ve(V,y))break e}}V={Z:me(V,1),$:me(V,2),height:me(V,3),width:me(V,4),rotation:me(V,5,0),X:Ue(V,6,0)},y=Ze(Ye(B.get(I)),Xe).map(Oe);var W=Z.get(I);e:for(C=new Ne,W=new O(W);j(W);)switch(W.i){case 10:C.addClassification(P(W,new ve,Je));break;default:if(!Ve(C,W))break e}V={T:V,O:y,M:ze(C)},R.push(V)}b=R}else b=[];r[u]=b,e.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===A.type){r[u]=h,e.g=7;break}if("proto"===A.type){r[u]=h,e.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=m.s[u])||(g=new je(m.h,m.D),m.s[u]=g),U(e,Pe(g,h,m.G),13);case 13:Q=e.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),e.g=3;break;case 14:F[p]=e.h;case 3:a=d.next(),e.g=2;break;case 4:return e.return(r)}}))}))}function ot(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=it(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function at(e){var t=(e=function(e){e:{var t=new Ke;for(e=new O(e);j(e);)switch(e.i){case 10:var n=P(e,new xe,Me);fe(t,1,n);break;case 18:fe(t,2,n=P(e,new Ce,We));break;default:if(!Ve(t,e))break e}}return t}(e)).getMesh();if(!t)return e;var n=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return n};var r=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return r},e}(t=tt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){return Se(this,(function e(){var t=this;return f(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return Se(n,(function t(){var n=this;return f(t,(function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(r))}},t.initialize=function(){return Se(this,(function e(){var t=this;return f(e,(function(e){return 1==e.g?U(e,nt(t),2):3!=e.g?U(e,function(e){return Se(e,(function e(){var t,n,r,i,o,a,c,s,d=this;return f(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,U(e,rt(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),n=l(Object.keys(d.B)),r=n.next();!r.done;r=n.next())i=r.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(o=l(d.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,ot(d,c);s=d.j,d.j={},d.setOptions(s),e.g=0}))}))}(t),3):U(e,function(e){return Se(e,(function e(){var t,n,r,i,o,a,c=this;return f(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=l(c.u),n=t.next();case 3:if(n.done){e.g=5;break}return U(e,(0,n.value)(),4);case 4:n=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(r=new c.h.GraphOptionChangeRequestList,i=l(c.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);c.i.changeOptions(r),r.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){return Se(this,(function n(){var r,i,o,a,c,s,d,u,A,h=this;return f(n,(function(n){switch(n.g){case 1:return h.g.inputs?(r=1e3*(null!=t?t:performance.now()),U(n,h.C,2)):n.return();case 2:return U(n,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,o=l(Object.keys(e)),a=o.next();!a.done;a=o.next())if(c=a.value,s=h.g.inputs[c]){e:{var g=h,Q=e[c];switch(s.type){case"video":var F=g.m[s.stream];if(F||(F=new je(g.h,g.D),g.m[s.stream]=F),0===(g=F).l&&(g.l=g.h.createTexture()),typeof HTMLVideoElement<"u"&&Q instanceof HTMLVideoElement){var p=Q.videoWidth;F=Q.videoHeight}else typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement?(p=Q.naturalWidth,F=Q.naturalHeight):(p=Q.width,F=Q.height);F={glName:g.l,width:p,height:F},(p=g.g).canvas.width=F.width,p.canvas.height=F.height,p.activeTexture(p.TEXTURE0),g.h.bindTexture2d(g.l),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,Q),g.h.bindTexture2d(0),g=F;break e;case"detections":for((F=g.m[s.stream])||(F=new _e(g.h),g.m[s.stream]=F),(g=F).data||(g.data=new g.g.DetectionListData),g.data.reset(Q.length),F=0;F<Q.length;++F){p=Q[F];var m=g.data,b=m.setBoundingBox,B=F,Z=p.T,f=new De;be(f,1,Z.Z),be(f,2,Z.$),be(f,3,Z.height),be(f,4,Z.width),be(f,5,Z.rotation),be(f,6,Z.X);var R=Z=new te;ie(R,1,Qe(f,1)),ie(R,2,Qe(f,2)),ie(R,3,Qe(f,3)),ie(R,4,Qe(f,4)),ie(R,5,Qe(f,5));var I=Qe(f,6);if(null!=I&&null!=I){z(R.g,48);var y=R.g,V=I;I=0>V;var C=(V=Math.abs(V))>>>0;for(V=Math.floor((V-C)/4294967296),V>>>=0,I&&(V=~V>>>0,4294967295<(C=1+(~C>>>0))&&(C=0,4294967295<++V&&(V=0))),I=D=C,C=V;0<C||127<I;)y.push(127&I|128),I=(I>>>7|C<<25)>>>0,C>>>=7;y.push(I)}if(ye(f,R),Z=re(Z),b.call(m,B,Z),p.O)for(m=0;m<p.O.length;++m)R=!!(f=p.O[m]).visibility,B=(b=g.data).addNormalizedLandmark,Z=F,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),be(R=new Xe,1,f.x),be(R,2,f.y),be(R,3,f.z),f.visibility&&be(R,4,f.visibility),ie(y=f=new te,1,Qe(R,1)),ie(y,2,Qe(R,2)),ie(y,3,Qe(R,3)),ie(y,4,Qe(R,4)),ie(y,5,Qe(R,5)),ye(R,y),f=re(f),B.call(b,Z,f);if(p.M)for(m=0;m<p.M.length;++m){if(B=(b=g.data).addClassification,Z=F,f=p.M[m],be(R=new ve,2,f.Y),f.index&&be(R,1,f.index),f.label&&be(R,3,f.label),f.displayName&&be(R,4,f.displayName),y=f=new te,null!=(C=Qe(R,1))&&null!=C)if(z(y.g,8),I=y.g,0<=C)z(I,C);else{for(V=0;9>V;V++)I.push(127&C|128),C>>=7;I.push(1)}ie(y,2,Qe(R,2)),null!=(I=Qe(R,3))&&(I=v(I),z(y.g,26),z(y.g,I.length),ne(y,y.g.end()),ne(y,I)),null!=(I=Qe(R,4))&&(I=v(I),z(y.g,34),z(y.g,I.length),ne(y,y.g.end()),ne(y,I)),ye(R,y),f=re(f),B.call(b,Z,f)}}g=g.data;break e;default:g={}}}switch(d=g,u=s.stream,s.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:r}));break;case"detections":(A=d).stream=u,A.timestamp=r,i.pushDetectionList(A);break;default:throw Error("Unknown input config type: '"+s.type+"'")}}return h.i.send(i),U(n,h.C,4);case 4:i.delete(),n.g=0}}))}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",tt),y("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var lt={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(at)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return Ze(Ye(e),Xe).map(Oe)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},ct=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],st=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],dt=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ut=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],At=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],ht=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],gt=[].concat(c(ct),c(st),c(dt),c(ut),c(At),c(ht));function Qt(e){e=e||{},e=Object.assign(Object.assign({},lt),e),this.g=new tt(e)}(t=Qt.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){return Se(this,(function e(){var t=this;return f(e,(function(e){return U(e,t.g.initialize(),0)}))}))},t.reset=function(){this.g.reset()},t.send=function(e){return Se(this,(function t(){var n=this;return f(t,(function(t){return U(t,n.g.send(e),0)}))}))},t.setOptions=function(e){this.g.setOptions(e)},y("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),y("FaceMesh",Qt),y("FACEMESH_LIPS",ct),y("FACEMESH_LEFT_EYE",st),y("FACEMESH_LEFT_EYEBROW",dt),y("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),y("FACEMESH_RIGHT_EYE",ut),y("FACEMESH_RIGHT_EYEBROW",At),y("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),y("FACEMESH_FACE_OVAL",ht),y("FACEMESH_CONTOURS",gt),y("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]]),y("matrixDataToMatrix",(function(e){for(var t=e.getCols(),n=e.getRows(),r=e.getPackedDataList(),i=[],o=0;o<n;o++)i.push(Array(t));for(o=0;o<n;o++)for(var a=0;a<t;a++){var l=1===e.getLayout()?o*t+a:a*n+o;i[o][a]=r[l]}return i})),y("VERSION","0.4.1633559619")}).call(we);const De={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ka=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={V:t,X:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.X)throw t.V;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.D),reject:e(this.l)}},t.prototype.D=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.G(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.A(e):this.m(e)}},t.prototype.A=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.H(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.F(),this.B()},t.prototype.F=function(){var e=this;o((function(){if(e.C()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.C=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.B=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.G=function(e){var t=this.j();e.K(t.resolve,t.reject)},t.prototype.H=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.K(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.K=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).K(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).K(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e){throw e}function C(e,t){V(Error("Invalid wire type: "+e+" (at position "+t+")"))}function W(){V(Error("Failed to read varint, encoding is invalid."))}function E(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var S,v,J=typeof TextDecoder<"u",N=typeof TextEncoder<"u";function G(e){if(N)e=(v||(v=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var X={},k=null;function T(e){var t;void 0===t&&(t=0),w(),t=X[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function Y(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=k[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}w();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function w(){if(!k){k={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));X[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===k[o]&&(k[o]=i)}}}}var D,x="function"==typeof Uint8Array;function M(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}var H="function"==typeof Uint8Array.prototype.slice;function K(e,t,n){return t===n?D||(D=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var L=0;function z(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.l=0,this.j=!1,this.v=t,e&&O(this,e)}function O(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return Y(e);if(e.constructor===M){if(null==e.g)var t=D||(D=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||x&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?Y(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.l=0,e.i=e.h.length,e.g=e.l}function j(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.j=!0,W()}function P(e){e.g>e.i&&(e.j=!0,V(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}function _(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,P(e),r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,P(e),r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,P(e),r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,P(e),r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,P(e),r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]?(e.j=!0,W(),r):(P(e),r))))))}function q(e){var t=e.h[e.g],n=e.h[e.g+1],r=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,P(e),(t<<0|n<<8|r<<16|i<<24)>>>0}z.prototype.reset=function(){this.g=this.l},z.prototype.m=function(){var e=q(this),t=2*(e>>31)+1,n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))};var $=[];function ee(){this.g=new Uint8Array(64),this.h=0}function te(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ne(e,t){for(;127<t;)te(e,127&t|128),t>>>=7;te(e,t)}function re(e){var t={},n=void 0!==t.O&&t.O;this.m={v:void 0!==t.v&&t.v},this.O=n,t=this.m,$.length?(n=$.pop(),t&&(n.v=t.v),e&&O(n,e),e=n):e=new z(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ie(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).j||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=_(e.g);return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,C(n,e.l),!1)}function oe(e){switch(e.h){case 0:if(0!=e.h)oe(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(!(128&e.h[t])){e.g=t+1,P(e);break e}t++}e.j=!0,W()}break;case 1:(e=e.g).g+=8,P(e);break;case 2:2!=e.h?oe(e):(t=_(e.g),(e=e.g).g+=t,P(e));break;case 5:(e=e.g).g+=4,P(e);break;case 3:for(t=e.i;;){if(!ie(e)){e.j=!0,V(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,V(Error("Unmatched end-group tag")));break}oe(e)}break;default:e.j=!0,C(e.h,e.l)}}function ae(e,t,n){var r=e.g.i,i=_(e.g),o=e.g.g+i;if(e.g.i=o,n(t,e),0!==(n=o-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=o,e.g.i=r,t}ee.prototype.length=function(){return this.h},ee.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,K(e,0,t)},re.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var le=[];function ce(){this.h=[],this.i=0,this.g=new ee}function se(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function de(e,t,n){ne(e.g,8*t+2),ne(e.g,n.length),se(e,e.g.end()),se(e,n)}var ue,Ae="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function he(e){return Object.isFrozen(e)||(Ae?e[Ae]|=1:void 0!==e.g?e.g|=1:Object.defineProperties(e,{g:{value:1,configurable:!0,writable:!0,enumerable:!1}})),e}function ge(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Qe(e,t){if(null!=e)return Array.isArray(e)||ge(e)?Fe(e,t):t(e)}function Fe(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=Qe(e[r],t);var i,o;if(t=Array.isArray(e))t=1&(null!=(i=o=Ae?e[Ae]:e.g)?i:0);return t&&he(n),n}for(n in o={},e)o[n]=Qe(e[n],t);return o}function pe(e){return e=function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(x&&null!=e&&e instanceof Uint8Array)return T(e);if(e instanceof M){if(null==e.g)e="";else{var t=e.g;t=null==t||"string"==typeof t?t:x&&t instanceof Uint8Array?T(t):null,e=e.g=t}return e}}return e}(e),Array.isArray(e)?Fe(e,pe):e}function Ue(e,t,n){var r=ue;if(ue=null,e||(e=r),r=this.constructor.ha,e||(e=r?[r]:[]),this.i=(r?0:-1)-(this.constructor.fa||0),this.l=this.g=null,this.u=e,e=(r=this.u.length)-1,r&&ge(r=this.u[e])?(this.j=e-this.i,this.h=r):void 0!==t&&-1<t?(this.j=Math.max(t,e+1-this.i),this.h=null):this.j=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.j?(e+=this.i,(r=this.u[e])?Array.isArray(r)&&he(r):this.u[e]=me):(be(this),(r=this.h[e])?Array.isArray(r)&&he(r):this.h[e]=me)}var me=Object.freeze(he([]));function be(e){var t=e.j+e.i;e.u[t]||(e.h=e.u[t]={})}function Be(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.j?e.h?e.h[t]:void 0:e.u[t+e.i]}function Ze(e,t,n){var r=Be(e,t,n=void 0!==n&&n);return null==r&&(r=me),r===me&&Ie(e,t,r=he(r.slice()),n),r}function fe(e,t){var n=Ze(e,t);if(e.l||(e.l={}),!e.l[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.l[t]=!0}return n}function Re(e,t,n){var r;return null!=(r=e=null==(e=Be(e,t))?e:+e)?r:void 0===n?0:n}function Ie(e,t,n,r){void 0!==r&&r||t>=e.j?(be(e),e.h[t]=n):e.u[t+e.i]=n}function ye(e,t,n,r){n!==r?Ie(e,t,n):Ie(e,t,void 0,!1)}function Ve(e,t,n){if(-1===n)return null;e.g||(e.g={});var r=e.g[n];if(r)return r;var i=Be(e,n,!1);return null==i?r:(t=new t(i),e.g[n]=t)}function Ce(e,t,n){e.g||(e.g={});var r=e.g[n];if(!r){var i=Ze(e,n,!1);r=[];for(var o=0;o<i.length;o++)r[o]=new t(i[o]);e.g[n]=r}return r}function We(e,t,n,r,i){var o=Ce(e,r,t);n=n||new r,e=Ze(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,n.u)):(o.push(n),e.push(n.u))}function Ee(e,t){var n;return null!=(n=e=Be(e,t))?n:0}function Se(e,t){var n;return null!=(n=e=Be(e,t))?n:""}function ve(e,t){if(e=e.m){se(t,t.g.end());for(var n=0;n<e.length;n++)se(t,e[n])}}Ue.prototype.toJSON=function(){return Fe(this.u,pe)},Ue.prototype.toString=function(){return this.u.toString()};var Je=Symbol();function Ne(e,t,n){return e[Je]||(e[Je]=function(e,r){return t(e,r,n)})}function Ge(e){var t=e[Je];if(!t){var n=e[Te]||(e[Te]=e());t=function(e,t){return Ye(e,t,n)},e[Je]=t}return t}function Xe(e){var t=function(e){var t=e.da;if(t)return Ge(t);if(t=e.ia){var n=e.Y;return delete e.Y,Ne(e.W.g,t,n)}}(e),n=e.W,r=e.ea;return t?function(e,i){return r(e,i,n,t)}:function(e,t){return r(e,t,n)}}function ke(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=Ge(e[2]);return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],a=e[3],l=Ge(e[2]);return function(e,n,r){return t(e,n,r,o,l,a)};case 5:var c=e[1],s=Ne(c,e[3],e[4]);return function(e,n,r){return t(e,n,r,c,s)};case 6:var d=e[1],u=e[5],A=Ne(d,e[3],e[4]);return function(e,n,r){return t(e,n,r,d,A,u)};default:throw Error("Unsupported number of parameters, expected [2-6], got "+e.length)}}var Te=Symbol();function Ye(e,t,n){for(;ie(t)&&4!=t.h;){var r=t.i,i=n[r];if(i)Array.isArray(i)&&(i=n[r]=ke(i));else{var o=n[0];o&&(o=o[r])&&(i=n[r]=Xe(o))}i&&i(t,e,r)||(r=e,o=(i=t).l,oe(i),i.O||(i=K(i.g.h,o,i.g.g),(o=r.m)?o.push(i):r.m=[i]))}return e}function we(e,t){var n=new ce;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var a=r[o];0!==a.length&&(e.set(a,t),t+=a.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function De(e,t,n){if(le.length){var r=le.pop();e&&(O(r.g,e),r.i=-1,r.h=-1),e=r}else e=new re(e);try{return Ye(new t,e,n[Te]||(n[Te]=n()))}finally{(t=e.g).h=null,t.l=0,t.i=0,t.g=0,t.j=!1,t.v=!1,e.i=-1,e.h=-1,e.j=!1,100>le.length&&le.push(e)}}function xe(e,t,n){if(null!=(t=Be(t,n))){ne(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?L=0:(0,L=2147483648):isNaN(r)?(0,L=2147483647):34028234663852886e22<r?(0,L=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,L=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,L=(n<<31|t+127<<23|8388607&r)>>>0),te(e,(n=L)>>>0&255),te(e,n>>>8&255),te(e,n>>>16&255),te(e,n>>>24&255)}}function Me(e,t,n){if(1!==e.h)return!1;var r=e.g;e=q(r);var i=q(r);r=2*(i>>31)+1;var o=i>>>20&2047;return e=4294967296*(1048575&i)+e,ye(t,n,2047==o?e?NaN:1/0*r:0==o?r*Math.pow(2,-1074)*e:r*Math.pow(2,o-1075)*(e+4503599627370496),0),!0}function He(e,t,n){return 5===e.h&&(Ie(t,n,e.g.m()),!0)}function Ke(e,t,n){if(5!==e.h&&2!==e.h)return!1;if(t=Ze(t,n),2==e.h){n=z.prototype.m;var r=_(e.g);for(r=e.g.g+r;e.g.g<r;)t.push(n.call(e.g))}else t.push(e.g.m());return!0}function Le(e,t,n){return 5===e.h&&(ye(t,n,e=e.g.m(),0),!0)}function ze(e,t,n){return 0===e.h&&(Ie(t,n,j(e.g)),!0)}function Oe(e,t,n){return 0===e.h&&(Ie(t,n,_(e.g)),!0)}function je(e,t,n){return 0===e.h&&(ye(t,n,e=_(e.g),0),!0)}function Pe(e,t,n){return 0===e.h&&(ye(t,n,e=!!_(e.g),!1),!0)}function _e(e,t,n){if(2!==e.h)return!1;var r,i=_(e.g),o=(e=e.g).g;if(e.g+=i,P(e),e=e.h,J)(r=S)||(r=S=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?s.push(65533):(l=e[o++],194>a||128!=(192&l)?(o--,s.push(65533)):s.push((31&a)<<6|63&l)):240>a?o>=i-1?s.push(65533):128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,s.push(65533)):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?s.push(65533):128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,s.push(65533)):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):s.push(65533),8192<=s.length&&(d=E(d,s),s.length=0);r=E(d,s)}return Ie(t,n,r),!0}function qe(e,t,n,r,i){return 2===e.h&&(e=ae(e,new r,i),t.g||(t.g={}),r=e&&e.u,t.g[n]=e,Ie(t,n,r,!1),!0)}function $e(e,t,n,r,i){return 2===e.h&&(We(t,n,e=ae(e,new r,i),r,void 0),!0)}function et(e,t,n){return 0===e.h&&(Ie(t,n,j(e.g)),!0)}function tt(e){Ue.call(this,e)}function nt(){return{1:Oe,2:He,3:_e,4:_e}}function rt(e,t){var n=Be(e,1);if(null!=n&&null!=n){ne(t.g,8);var r=t.g;if(0<=n)ne(r,n);else{for(var i=0;9>i;i++)te(r,127&n|128),n>>=7;te(r,1)}}xe(t,e,2),null!=(r=Be(e,3))&&de(t,3,G(r)),null!=(r=Be(e,4))&&de(t,4,G(r)),ve(e,t)}function it(e){Ue.call(this,e,-1,at)}function ot(){return{1:[$e,tt,nt]}}g(tt,Ue),g(it,Ue),it.prototype.addClassification=function(e,t){return We(this,1,e,tt,t),this};var at=[1];function lt(e){Ue.call(this,e)}function ct(){return{1:He,2:He,3:He,4:He,5:He}}function st(e,t){xe(t,e,1),xe(t,e,2),xe(t,e,3),xe(t,e,4),xe(t,e,5),ve(e,t)}function dt(e){Ue.call(this,e,-1,At)}function ut(){return{1:[$e,lt,ct]}}g(lt,Ue),g(dt,Ue);var At=[1];function ht(e){Ue.call(this,e)}function gt(){return{1:He,2:He,3:He,4:He,5:He,6:ze}}function Qt(e,t){xe(t,e,1),xe(t,e,2),xe(t,e,3),xe(t,e,4),xe(t,e,5);var n=Be(e,6);if(null!=n&&null!=n){ne(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=L=o,o=i;0<o||127<n;)te(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;te(r,n)}ve(e,t)}function Ft(e){Ue.call(this,e,-1,bt)}function pt(){return{1:et,2:et,3:Ke,4:[qe,Ut,mt],5:Oe,6:Oe,7:Ke,8:Ke,9:Ke}}function Ut(e){Ue.call(this,e)}function mt(){return{1:He,2:He,3:He}}g(ht,Ue),g(Ft,Ue),g(Ut,Ue);var bt=[3,7,8,9];function Bt(e){Ue.call(this,e)}function Zt(){return{1:Le,2:Le,3:Le}}function ft(e){Ue.call(this,e)}function Rt(){return{1:Le,2:Le,3:Le}}function It(e){Ue.call(this,e)}function yt(){return{1:je,2:[qe,ft,Rt],3:[qe,Bt,Zt],4:Pe}}function Vt(e){Ue.call(this,e,-1,Wt)}function Ct(){return{1:je,2:[$e,It,yt],3:Le,4:Ke,5:Ke,6:Ke}}g(Bt,Ue),g(ft,Ue),g(It,Ue),g(Vt,Ue);var Wt=[2,4,5,6];function Et(e){Ue.call(this,e,-1,vt)}function St(){return{1:je,2:[$e,Vt,Ct],3:[qe,Ft,pt],4:Me,5:Ke,6:Ke}}g(Et,Ue);var vt=[2,5,6];function Jt(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function Nt(e){return Ce(e,tt,1).map((function(e){return{index:Ee(e,1),$:Re(e,2),label:null!=Be(e,3)?Se(e,3):void 0,displayName:null!=Be(e,4)?Se(e,4):void 0}}))}function Gt(e){return{x:Re(e,1),y:Re(e,2),z:Re(e,3),visibility:null!=Be(e,4)?Re(e,4):void 0}}function Xt(e,t){this.h=e,this.g=t,this.l=0}function kt(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=Jt(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Jt(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={J:n.getAttribLocation(r,"aVertex"),I:n.getAttribLocation(r,"aTex"),ja:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.J),n.vertexAttribPointer(e.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.J),n.disableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function Tt(e){this.g=e}var Yt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function wt(e,t){return t+e}function Dt(e,t){window[e]=t}function xt(t){if(this.g=t,this.listeners={},this.j={},this.G={},this.m={},this.s={},this.H=this.o=this.S=!0,this.D=e.resolve(),this.R="",this.C={},this.locateFile=t&&t.locateFile||wt,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.T=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function Mt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.S?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(Yt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return Dt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Dt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=Ht(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.T)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,Ht(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.T)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ga:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.F=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.S=!1,g.g=0}}))}function Ht(e,t){var n,r;return f((function(i){return t in e.G?i.return(e.G[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.G[t]=r,i.return(r))}))}function Kt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.H=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new Xt(e.h,e.F),e.s[t]=r),i.return(kt(r,n,e.H))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=De(b.get(I),ht,gt);y={U:{aa:Re(y,1),ba:Re(y,2),height:Re(y,3),width:Re(y,4),rotation:Re(y,5,0),Z:Ee(y,6)},P:Ce(De(B.get(I),dt,ut),lt,1).map(Gt),N:Nt(De(Z.get(I),it,ot))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.s[u])||(g=new Xt(e.h,e.F),e.s[u]=g),U(m,kt(g,h,e.H),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Lt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.D=Kt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.D=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function zt(e){var t=Ee(e,1),n=Ve(e,Bt,3);return{id:t,point2d:n={x:Re(n,1),y:Re(n,2),depth:Re(n,3)},point3d:{x:Re(e=Ve(e,ft,2),1),y:Re(e,2),z:Re(e,3)}}}function Ot(e){var t=De(e,Et,St);e=[],t=Ce(t,Vt,2);for(var n=0;n<t.length;n++)e.push({id:Ee(t[n],1),keypoints:Ce(t[n],It,2).map(zt),visibility:Re(t[n],3),scale:fe(t[n],6),translation:fe(t[n],5),rotation:fe(t[n],4)});return e}function jt(e){switch(e){case"Camera":return"Camera";case"Chair":return"Chair";case"Cup":return"Coffee cup, Mug";default:return"Footwear"}}(t=xt.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={L:o.L,M:o.M},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.L=c.onChange,o.M=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.L(e.M),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,Mt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.R===e.g.graph.url?d.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.R=e.g.graph.url,U(d,Ht(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.C)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.C[i]);if(e.C={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Lt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.A){c.g=2;break}t=l(e.A),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.A=void 0;case 2:if(e.B){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.B),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.B=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.C[e]=t},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.D,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.m[c.stream];if(Q||(Q=new Xt(A.h,A.F),A.m[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.m[c.stream])||(Q=new Tt(A.h),A.m[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.U,f=new ht;if(Ie(f,1,Z.aa),Ie(f,2,Z.ba),Ie(f,3,Z.height),Ie(f,4,Z.width),Ie(f,5,Z.rotation),Ie(f,6,Z.Z),Z=we(f,Qt),b.call(m,B,Z),F.P)for(m=0;m<F.P.length;++m){var R=!!(f=F.P[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ie(R=new lt,1,f.x),Ie(R,2,f.y),Ie(R,3,f.z),f.visibility&&Ie(R,4,f.visibility),f=we(R,st),B.call(b,Z,f)}if(F.N)for(m=0;m<F.N.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.N[m],Ie(R=new tt,2,f.$),f.index&&Ie(R,1,f.index),f.label&&Ie(R,3,f.label),f.displayName&&Ie(R,4,f.displayName),f=we(R,rt),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.D,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",xt),y("OptionType",{BOOL:0,NUMBER:1,ca:2,0:"BOOL",1:"NUMBER",2:"STRING"});var Pt={focalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_x"}},focalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_y"}},principalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_x"}},principalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_y"}},allowedLabels:{type:2,graphOptionXref:{calculatorName:"ConstantSidePacketCalculatorAllowedLabels",calculatorType:"ConstantSidePacketCalculator",fieldName:"string_value"}}};function _t(e){var t=this;e=e||{},this.g=new xt({locateFile:e.locateFile,files:[{url:"objectron_solution_packed_assets_loader.js"},{simd:!1,url:"objectron_solution_wasm_bin.js"},{simd:!0,url:"objectron_solution_simd_wasm_bin.js"}],graph:{url:"objectron.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["lifted_objects","image_transformed"],outs:{image:"image_transformed",objectDetections:{type:"proto",stream:"lifted_objects",transform:Ot}}}],options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,default:!1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumObjects:{type:1,default:5,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorMaxNumObjects",fieldName:"int_value"}},staticImageMode:{type:0,default:!0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"objectrongpusubgraph__ConstantSidePacketCalculator",fieldName:"bool_value"}},minDetectionConfidence:{type:1,default:.5,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"objectrongpusubgraph__objectdetectionoidv4subgraph__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,default:.99,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"objectrongpusubgraph__boxlandmarksubgraph__ThresholdingCalculator",fieldName:"threshold"}},modelName:{default:"Shoe",onChange:function(e){var n,r,i,o;return f((function(a){return 1==a.g?(n=e,t.g.setOptions({allowedLabels:jt(n)},Pt),r=function(e){switch(e){case"Camera":return"object_detection_3d_camera.tflite";case"Chair":return"object_detection_3d_chair.tflite";case"Cup":return"object_detection_3d_cup.tflite";default:return"object_detection_3d_sneakers.tflite"}}(n),i="object_detection_3d.tflite",U(a,Ht(t.g,r),2)):(o=a.h,t.g.overrideFile(i,o),a.return(!0))}))}},focalLength:{default:[1,1],onChange:function(e){var n;return f((function(r){return n=e,t.h=n,t.g.setOptions({focalX:n[0],focalY:n[1]},Pt),r.return(!0)}))}},principalPoint:{default:[0,0],onChange:function(e){var n;return f((function(r){return n=e,t.i=n,t.g.setOptions({principalX:n[0],principalY:n[1]},Pt),r.return(!0)}))}},imageSize:{onChange:function(e){var n,r,i,o;return f((function(a){if(void 0===t.h||void 0===t.i)return console.error('"focalLength" and "principalPoint" must be set if setting image size'),a.return();r=[(n=e)[0]/2,n[1]/2],i=[t.h[0]/r[0],t.h[1]/r[1]],o=[t.i[0]/r[0],t.i[1]/r[1]],t.setOptions({focalLength:i,principalPoint:o}),a.g=0}))}}}})}(t=_t.prototype).close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.reset=function(){this.g.reset()},t.send=function(e){var t=this;return f((function(n){return U(n,t.g.send(e),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Objectron",_t),y("BOX_CONNECTIONS",[[1,2],[2,4],[4,3],[3,1],[5,6],[6,8],[8,7],[7,5],[1,5],[2,6],[3,7],[4,8]]),y("BOX_KEYPOINTS",{CENTER:0,BACK_BOTTOM_LEFT:1,FRONT_BOTTOM_LEFT:2,BACK_TOP_LEFT:3,FRONT_TOP_LEFT:4,BACK_BOTTOM_RIGHT:5,FRONT_BOTTOM_RIGHT:6,BACK_TOP_RIGHT:7,FRONT_TOP_RIGHT:8}),y("VERSION","0.4.1636596145")}).call(De);const xe={};(function(){var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var n=i;e=e.split(".");for(var o=0;o<e.length-1;o++){var a=e[o];if(!(a in n))break e;n=n[a]}(t=t(o=n[e=e[e.length-1]]))!=o&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function l(e){var t=typeof Symbol<"u"&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function c(e){if(!(e instanceof Array)){e=l(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}o("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),o=0;o<t.length;o++){var l=i[t[o]];"function"==typeof l&&"function"!=typeof l.prototype[e]&&r(l.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var s,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var u;e:{var A={};try{A.__proto__={a:!0},u=A.a;break e}catch(e){}u=!1}s=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function g(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.ea=t.prototype}function Q(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function F(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function p(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function U(e,t,n){return e.g=n,{value:t}}function m(e){this.g=new Q,this.h=e}function b(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var o=i.value}catch(t){return e.g.i=null,p(e.g,t),B(e)}return e.g.i=null,r.call(e.g,o),B(e)}function B(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,p(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function Z(e){this.next=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=B(e)),t},this.throw=function(t){return F(e.g),e.g.i?t=b(e,e.g.i.throw,t,e.g.o):(p(e.g,t),t=B(e)),t},this.return=function(t){return function(e,t){F(e.g);var n=e.g.i;return n?b(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),B(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function f(t){return function(t){function n(e){return t.next(e)}function r(e){return t.throw(e)}return new e((function(i,o){!function t(a){a.done?i(a.value):e.resolve(a.value).then(n,r).then(t,o)}(t.next())}))}(new Z(new m(t)))}Q.prototype.o=function(e){this.h=e},Q.prototype.return=function(e){this.j={return:e},this.g=this.s},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var o=i.setTimeout;n.prototype.i=function(e){o(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;o((function(){if(e.B()){var t=i.console;typeof t<"u"&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return typeof n>"u"||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)a.h(this.g[e]);this.g=null}};var a=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){o(e)}}:t}var i,o,a=new t((function(e,t){i=e,o=t}));return this.J(r(e,i),r(n,o)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?a.h(n):this.g.push(n),this.o=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var i=l(e),o=i.next();!o.done;o=i.next())r(o.value).J(t,n)}))},t.all=function(e){var n=l(e),i=n.next();return i.done?r([]):new t((function(e,t){function o(t){return function(n){a[t]=n,0==--l&&e(a)}}var a=[],l=0;do{a.push(void 0),l++,r(i.value).J(o(a.length-1),t),i=n.next()}while(!i.done)}))},t}));var R="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};o("Object.assign",(function(e){return e||R})),o("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),o("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),o("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),o("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var I=this||self;function y(e,t){e=e.split(".");var n,r=I;e[0]in r||typeof r.execScript>"u"||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function V(e){!function(e){I.setTimeout((function(){throw e}),0)}(e)}function C(e,t){V(Error("Invalid wire type: "+e+" (at position "+t+")"))}function W(){V(Error("Failed to read varint, encoding is invalid."))}function E(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var S,v,J=typeof TextDecoder<"u",N=typeof TextEncoder<"u";function G(e){if(N)e=(v||(v=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var o=e.charCodeAt(i);if(128>o)r[n++]=o;else{if(2048>o)r[n++]=o>>6|192;else{if(55296<=o&&57343>=o){if(56319>=o&&i<e.length){var a=e.charCodeAt(++i);if(56320<=a&&57343>=a){o=1024*(o-55296)+a-56320+65536,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");o=65533}r[n++]=o>>12|224,r[n++]=o>>6&63|128}r[n++]=63&o|128}}e=r.subarray(0,n)}return e}var X={},k=null;function T(e){var t;void 0===t&&(t=0),w(),t=X[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,o=0;i<e.length-2;i+=3){var a=e[i],l=e[i+1],c=e[i+2],s=t[a>>2];a=t[(3&a)<<4|l>>4],l=t[(15&l)<<2|c>>6],c=t[63&c],n[o++]=s+a+l+c}switch(s=0,c=r,e.length-i){case 2:c=t[(15&(s=e[i+1]))<<2]||r;case 1:e=e[i],n[o]=t[e>>2]+t[(3&e)<<4|s>>4]+c+r}return n.join("")}function Y(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=k[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}w();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),l=n(64);if(64===l&&-1===i)break;t(i<<2|o>>4),64!=a&&(t(o<<4&240|a>>2),64!=l&&t(a<<6&192|l))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function w(){if(!k){k={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));X[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===k[o]&&(k[o]=i)}}}}var D,x="function"==typeof Uint8Array;function M(e){if(this.g=e,null!==e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}M.prototype.toJSON=function(){if(null==this.g)var e="";else e=this.g,e=this.g=null==e||"string"==typeof e?e:x&&e instanceof Uint8Array?T(e):null;return e};var H="function"==typeof Uint8Array.prototype.slice;function K(e,t,n){return t===n?D||(D=new Uint8Array(0)):H?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var L=0;function z(e,t){t=void 0!==(t=void 0===t?{}:t).u&&t.u,this.h=null,this.g=this.i=this.l=0,this.j=!1,this.u=t,e&&O(this,e)}function O(e,t){e.h=function(e){if(e.constructor===Uint8Array)return e;if(e.constructor===ArrayBuffer)return new Uint8Array(e);if(e.constructor===Array)return new Uint8Array(e);if(e.constructor===String)return Y(e);if(e.constructor===M){if(null==e.g)var t=D||(D=new Uint8Array(0));else{t=Uint8Array;var n=e.g;n=null==n||x&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?Y(n):null,t=new t(e=e.g=n)}return t}if(e instanceof Uint8Array)return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(t),e.l=0,e.i=e.h.length,e.g=e.l}function j(e){e.g>e.i&&(e.j=!0,V(Error("Tried to read past the end of the data "+e.g+" > "+e.i)))}function P(e){var t=e.h,n=t[e.g],r=127&n;return 128>n?(e.g+=1,j(e),r):(r|=(127&(n=t[e.g+1]))<<7,128>n?(e.g+=2,j(e),r):(r|=(127&(n=t[e.g+2]))<<14,128>n?(e.g+=3,j(e),r):(r|=(127&(n=t[e.g+3]))<<21,128>n?(e.g+=4,j(e),r):(r|=(15&(n=t[e.g+4]))<<28,128>n?(e.g+=5,j(e),r>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]?(e.j=!0,W(),r):(j(e),r))))))}z.prototype.reset=function(){this.g=this.l};var _=[];function q(){this.g=new Uint8Array(64),this.h=0}function $(e,t){if(!(e.h+1<e.g.length)){var n=e.g;e.g=new Uint8Array(Math.ceil(1+2*e.g.length)),e.g.set(n)}e.g[e.h++]=t}function ee(e,t){for(;127<t;)$(e,127&t|128),t>>>=7;$(e,t)}function te(e){var t={},n=void 0!==t.N&&t.N;this.m={u:void 0!==t.u&&t.u},this.N=n,t=this.m,_.length?(n=_.pop(),t&&(n.u=t.u),e&&O(n,e),e=n):e=new z(e,t),this.g=e,this.l=this.g.g,this.h=this.i=-1,this.j=!1}function ne(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).j||0>t.g||t.g>t.i),t)return!1;e.l=e.g.g;var n=P(e.g);return t=n>>>3,0<=(n&=7)&&5>=n?(e.i=t,e.h=n,!0):(e.j=!0,C(n,e.l),!1)}function re(e){switch(e.h){case 0:if(0!=e.h)re(e);else e:{for(var t=(e=e.g).g,n=0;10>n;n++){if(!(128&e.h[t])){e.g=t+1,j(e);break e}t++}e.j=!0,W()}break;case 1:(e=e.g).g+=8,j(e);break;case 2:2!=e.h?re(e):(t=P(e.g),(e=e.g).g+=t,j(e));break;case 5:(e=e.g).g+=4,j(e);break;case 3:for(t=e.i;;){if(!ne(e)){e.j=!0,V(Error("Unmatched start-group tag: stream EOF"));break}if(4==e.h){e.i!=t&&(e.j=!0,V(Error("Unmatched end-group tag")));break}re(e)}break;default:e.j=!0,C(e.h,e.l)}}function ie(e,t,n){e.N||(e=K(e.g.h,n,e.g.g),(n=t.m)?n.push(e):t.m=[e])}q.prototype.length=function(){return this.h},q.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,K(e,0,t)},te.prototype.reset=function(){this.g.reset(),this.h=this.i=-1};var oe=[];function ae(){this.h=[],this.i=0,this.g=new q}function le(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function ce(e,t,n){ee(e.g,8*t+2),ee(e.g,n.length),le(e,e.g.end()),le(e,n)}var se,de="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ue(e,t){Object.isFrozen(e)||(de?e[de]|=t:void 0!==e.g?e.g|=t:Object.defineProperties(e,{g:{value:t,configurable:!0,writable:!0,enumerable:!1}}))}function Ae(e){var t;return e?null!=(t=de?e[de]:e.g)?t:0:0}function he(e){return Array.isArray(e)&&ue(e,1),e}function ge(e){if(!Array.isArray(e))throw Error("cannot mark non-array as immutable");ue(e,2)}function Qe(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function Fe(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":return x&&null!=e&&e instanceof Uint8Array?T(e):e;default:return e}}function pe(e,t){if(null!=e)return Array.isArray(e)||Qe(e)?Ue(e,t):t(e)}function Ue(e,t){if(Array.isArray(e)){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=pe(e[r],t);return 1&Ae(e)&&he(n),n}for(r in n={},e)n[r]=pe(e[r],t);return n}function me(e,t,n){var r=se;if(se=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=(r?0:-1)-(this.constructor.aa||0),this.i=null,this.g=e,e=(r=this.g.length)-1,r&&Qe(r=this.g[e])?(this.l=e-this.j,this.h=r):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.g[e])?he(r):this.g[e]=Ze):(fe(this),(r=this.h[e])?he(r):this.h[e]=Ze)}var be,Be,Ze=Object.freeze(he([]));function fe(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function Re(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function Ie(e,t,n){n=void 0===n||n;var r=void 0!==r&&r,i=Re(e,t,r);return null==i&&(i=Ze),i===Ze?Ve(e,t,i=he([]),r):n&&Array.isArray(i)&&2&Ae(i)&&Ve(e,t,i=i.slice(),r),i}function ye(e,t,n){var r;return null!=(r=e=null==(e=Re(e,t))?e:+e)?r:void 0===n?0:n}function Ve(e,t,n,r){void 0!==r&&r||t>=e.l?(fe(e),e.h[t]=n):e.g[t+e.j]=n}function Ce(e,t,n){e.i||(e.i={});var r=e.i[n];if(!r){var i=Ie(e,n,!1);r=[];for(var o=!!Array.isArray(i)&&!!(2&Ae(i)),a=0;a<i.length;a++)r[a]=new t(i[a]),o&&ge(r[a].g);o&&(ge(r),Object.freeze(r)),e.i[n]=r}return r}function We(e,t,n,r,i){var o=Ce(e,r,t);n=n||new r,e=Ie(e,t),null!=i?(o.splice(i,0,n),e.splice(i,0,Ee(n))):(o.push(n),e.push(Ee(n)))}function Ee(e){if(e.i)for(var t in e.i){var n=e.i[t];if(Array.isArray(n))for(var r=0;r<n.length;r++)n[r]&&Ee(n[r]);else n&&Ee(n)}return e.g}function Se(e,t){var n;return null!=(n=e=Re(e,t))?n:0}function ve(e,t){var n;return null!=(n=e=Re(e,t))?n:""}function Je(e,t){if(e=e.m){le(t,t.g.end());for(var n=0;n<e.length;n++)le(t,e[n])}}function Ne(e){var t=e[0];switch(e.length){case 2:var n=e[1];return function(e,r,i){return t(e,r,i,n)};case 3:var r=e[1],i=e[2];return function(e,n,o){return t(e,n,o,r,i)};case 4:var o=e[1],a=e[2],l=e[3];return function(e,n,r){return t(e,n,r,o,a,l)};default:throw Error("unsupported number of parameters, expected [2-4], got "+e.length)}}function Ge(e,t,n){for(;ne(t)&&4!=t.h;){var r=t.i,i=n[r];if(i){if(Array.isArray(i)&&(i=n[r]=Ne(i)),!i(t,e,r)){i=e;var o=(r=t).l;re(r),ie(r,i,o)}}else i=e,o=(r=t).l,re(r),ie(r,i,o)}return e}function Xe(e,t){var n=new ae;if(t(e,n),0===(e=n.i+n.g.length()))n=new Uint8Array(0);else{e=new Uint8Array(e);for(var r=n.h,i=r.length,o=t=0;o<i;o++){var a=r[o];0!==a.length&&(e.set(a,t),t+=a.length)}0!==(i=(r=n.g).h)&&(e.set(r.g.subarray(0,i),t),r.h=0),n.h=[e],n=e}return n}function ke(e,t,n){if(oe.length){var r=oe.pop();e&&(O(r.g,e),r.i=-1,r.h=-1),e=r}else e=new te(e);try{return n(new t,e)}finally{(t=e.g).h=null,t.l=0,t.i=0,t.g=0,t.j=!1,t.u=!1,e.i=-1,e.h=-1,e.j=!1,100>oe.length&&oe.push(e)}}function Te(e,t,n){if(null!=(t=Re(t,n))){ee(e.g,8*n+5),e=e.g;var r=t;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?L=0:(0,L=2147483648):isNaN(r)?(0,L=2147483647):34028234663852886e22<r?(0,L=(n<<31|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),0,L=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,0,L=(n<<31|t+127<<23|8388607&r)>>>0),$(e,(n=L)>>>0&255),$(e,n>>>8&255),$(e,n>>>16&255),$(e,n>>>24&255)}}function Ye(e,t,n){if(5!==e.h)return!1;var r=(e=e.g).h[e.g],i=e.h[e.g+1],o=e.h[e.g+2],a=e.h[e.g+3];return e.g+=4,j(e),e=2*((i=(r<<0|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,Ve(t,n,255==r?i?NaN:1/0*e:0==r?e*Math.pow(2,-149)*i:e*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0}function we(e,t,n){if(0!==e.h)return!1;for(var r=e.g,i=128,o=0,a=e=0;4>a&&128<=i;a++)o|=(127&(i=r.h[r.g++]))<<7*a;if(128<=i&&(o|=(127&(i=r.h[r.g++]))<<28,e|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)e|=(127&(i=r.h[r.g++]))<<7*a+3;return 128>i?(r=o>>>0,(e=2147483648&(i=e>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),e=e?-r:r):(r.j=!0,W(),e=void 0),Ve(t,n,e),!0}function De(e,t,n){return 0===e.h&&(Ve(t,n,P(e.g)),!0)}function xe(e,t,n){if(2!==e.h)return!1;var r,i=P(e.g),o=(e=e.g).g;if(e.g+=i,j(e),e=e.h,J)(r=S)||(r=S=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(e.subarray(o,o+i));else{i=o+i;for(var a,l,c,s=[],d=null;o<i;)128>(a=e[o++])?s.push(a):224>a?o>=i?s.push(65533):(l=e[o++],194>a||128!=(192&l)?(o--,s.push(65533)):s.push((31&a)<<6|63&l)):240>a?o>=i-1?s.push(65533):128!=(192&(l=e[o++]))||224===a&&160>l||237===a&&160<=l||128!=(192&(r=e[o++]))?(o--,s.push(65533)):s.push((15&a)<<12|(63&l)<<6|63&r):244>=a?o>=i-2?s.push(65533):128!=(192&(l=e[o++]))||l-144+(a<<28)>>30||128!=(192&(r=e[o++]))||128!=(192&(c=e[o++]))?(o--,s.push(65533)):(a=(7&a)<<18|(63&l)<<12|(63&r)<<6|63&c,a-=65536,s.push(55296+(a>>10&1023),56320+(1023&a))):s.push(65533),8192<=s.length&&(d=E(d,s),s.length=0);r=E(d,s)}return Ve(t,n,r),!0}function Me(e,t,n,r,i){if(2!==e.h)return!1;var o=new r,a=e.g.i,l=P(e.g),c=e.g.g+l;if(e.g.i=c,i(o,e),0!==(i=c-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+l+" bytes, instead read "+(l-i)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=c,e.g.i=a,We(t,n,o,r,void 0),!0}function He(e){me.call(this,e)}function Ke(e,t){var n=Re(e,1);if(null!=n&&null!=n){ee(t.g,8);var r=t.g;if(0<=n)ee(r,n);else{for(var i=0;9>i;i++)$(r,127&n|128),n>>=7;$(r,1)}}Te(t,e,2),null!=(r=Re(e,3))&&ce(t,3,G(r)),null!=(r=Re(e,4))&&ce(t,4,G(r)),Je(e,t)}function Le(e,t){return Ge(e,t,be||(be={1:De,2:Ye,3:xe,4:xe}))}function ze(e){me.call(this,e,-1,_e)}function Oe(e,t){return Ge(e,t,Be||(Be={1:[Me,He,Le]}))}me.prototype.toJSON=function(){return Ue(Ee(this),Fe)},me.prototype.toString=function(){return Ee(this).toString()},g(He,me),g(ze,me),ze.prototype.addClassification=function(e,t){return We(this,1,e,He,t),this};var je,Pe,_e=[1];function qe(e){me.call(this,e)}function $e(e,t){Te(t,e,1),Te(t,e,2),Te(t,e,3),Te(t,e,4),Te(t,e,5),Je(e,t)}function et(e,t){return Ge(e,t,je||(je={1:Ye,2:Ye,3:Ye,4:Ye,5:Ye}))}function tt(e){me.call(this,e,-1,it)}function nt(e,t){return Ge(e,t,Pe||(Pe={1:[Me,qe,et]}))}g(qe,me),g(tt,me);var rt,it=[1];function ot(e){me.call(this,e)}function at(e,t){Te(t,e,1),Te(t,e,2),Te(t,e,3),Te(t,e,4),Te(t,e,5);var n=Re(e,6);if(null!=n&&null!=n){ee(t.g,48);var r=t.g,i=n;n=0>i;var o=(i=Math.abs(i))>>>0;for(i=Math.floor((i-o)/4294967296),i>>>=0,n&&(i=~i>>>0,4294967295<(o=1+(~o>>>0))&&(o=0,4294967295<++i&&(i=0))),n=L=o,o=i;0<o||127<n;)$(r,127&n|128),n=(n>>>7|o<<25)>>>0,o>>>=7;$(r,n)}Je(e,t)}function lt(e,t){return Ge(e,t,rt||(rt={1:Ye,2:Ye,3:Ye,4:Ye,5:Ye,6:we}))}function ct(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function st(e){return Ce(e,He,1).map((function(e){return{index:Se(e,1),X:ye(e,2),label:null!=Re(e,3)?ve(e,3):void 0,displayName:null!=Re(e,4)?ve(e,4):void 0}}))}function dt(e){return{x:ye(e,1),y:ye(e,2),z:ye(e,3),visibility:null!=Re(e,4)?ye(e,4):void 0}}function ut(e){return Ce(ke(e,tt,nt),qe,1).map(dt)}function At(e,t){this.h=e,this.g=t,this.l=0}function ht(t,n,r){return function(e,t){var n=e.g;if(void 0===e.m){var r=ct(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=ct(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=e.m=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(t,n),"function"==typeof t.g.canvas.transferToImageBitmap?e.resolve(t.g.canvas.transferToImageBitmap()):r?e.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new e((function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)})))}function gt(e){this.g=e}g(ot,me);var Qt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Ft(e,t){return t+e}function pt(e,t){window[e]=t}function Ut(t){if(this.g=t,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=e.resolve(),this.P="",this.B={},this.locateFile=t&&t.locateFile||Ft,"object"==typeof window)var n=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if(!(typeof location<"u"))throw Error("solutions can only be loaded on a web page or in a web worker");n=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=n,t.options)for(var r=(n=l(Object.keys(t.options))).next();!r.done;r=n.next()){r=r.value;var i=t.options[r].default;void 0!==i&&(this.j[r]="function"==typeof i?i():i)}}function mt(t){var n,r,i,o,a,l,s,d,u,A,h;return f((function(g){switch(g.g){case 1:return t.R?(n=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,U(g,f((function(e){switch(e.g){case 1:return e.m=2,U(e,WebAssembly.instantiate(Qt),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}})),2)):g.return();case 2:if(r=g.h,"object"==typeof window)return pt("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),pt("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),l=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),d=e.all(l.map((function(n){var r=bt(t,n.url);if(void 0!==n.path){var i=n.path;r=r.then((function(n){return t.overrideFile(i,n),e.resolve(n)}))}return r}))),u=e.all(s.map((function(n){return void 0===n.simd||n.simd&&r||!n.simd&&!r?function(t){var n=document.createElement("script");return n.setAttribute("src",t),n.setAttribute("crossorigin","anonymous"),new e((function(e){n.addEventListener("load",(function(){e()}),!1),n.addEventListener("error",(function(){e()}),!1),document.body.appendChild(n)}))}(t.locateFile(n.url,t.S)):e.resolve()}))).then((function(){var e,n,r;return f((function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,U(i,e(n),2);r.h=i.h,i.g=0}))})),A=f((function(e){return t.g.graph&&t.g.graph.url?e=U(e,bt(t,t.g.graph.url),0):(e.g=0,e=void 0),e})),U(g,e.all([u,d,A]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),o=t,U(g,createMediapipeSolutionsWasm(Module),6);case 6:o.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,a=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),t.h.GL.makeContextCurrent(a),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.D=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.R=!1,g.g=0}}))}function bt(e,t){var n,r;return f((function(i){return t in e.F?i.return(e.F[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.F[t]=r,i.return(r))}))}function Bt(e,t,n){var r,i,o,a,c,s,d,u,A,h,g,Q,F,p;return f((function(m){switch(m.g){case 1:if(!n)return m.return(t);for(r={},i=0,o=l(Object.keys(n)),a=o.next();!a.done;a=o.next())c=a.value,"string"!=typeof(s=n[c])&&"texture"===s.type&&void 0!==t[s.stream]&&++i;1<i&&(e.G=!1),d=l(Object.keys(n)),a=d.next();case 2:if(a.done){m.g=4;break}if(u=a.value,"string"==typeof(A=n[u]))return F=r,p=u,U(m,function(e,t,n){var r;return f((function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.h.Uint8BlobList?i.return(n):n instanceof e.h.Texture2dDataOut?((r=e.s[t])||(r=new At(e.h,e.D),e.s[t]=r),i.return(ht(r,n,e.G))):i.return(void 0)}))}(e,u,t[A]),14);if(h=t[A.stream],"detection_list"===A.type){if(h){for(var b=h.getRectList(),B=h.getLandmarksList(),Z=h.getClassificationsList(),R=[],I=0;I<b.size();++I){var y=ke(b.get(I),ot,lt);y={T:{Y:ye(y,1),Z:ye(y,2),height:ye(y,3),width:ye(y,4),rotation:ye(y,5,0),W:Se(y,6)},O:ut(B.get(I)),M:st(ke(Z.get(I),ze,Oe))},R.push(y)}b=R}else b=[];r[u]=b,m.g=7;break}if("proto_list"===A.type){if(h){for(b=Array(h.size()),B=0;B<h.size();B++)b[B]=h.get(B);h.delete()}else b=[];r[u]=b,m.g=7;break}if(void 0===h){m.g=3;break}if("float_list"===A.type){r[u]=h,m.g=7;break}if("proto"===A.type){r[u]=h,m.g=7;break}if("texture"!==A.type)throw Error("Unknown output config type: '"+A.type+"'");return(g=e.s[u])||(g=new At(e.h,e.D),e.s[u]=g),U(m,ht(g,h,e.G),13);case 13:Q=m.h,r[u]=Q;case 7:A.transform&&r[u]&&(r[u]=A.transform(r[u])),m.g=3;break;case 14:F[p]=m.h;case 3:a=d.next(),m.g=2;break;case 4:return m.return(r)}}))}function Zt(e,t){for(var n=t.name||"$",r=[].concat(c(t.wants)),i=new e.h.StringList,o=l(t.wants),a=o.next();!a.done;a=o.next())i.push_back(a.value);o=e.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<t.wants.length;++a)o[r[a]]=i.get(a);var l=e.listeners[n];l&&(e.C=Bt(e,o,t.outs).then((function(n){n=l(n);for(var i=0;i<t.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,o),i.delete()}function ft(e){switch(void 0===e&&(e=0),e){case 1:return"pose_landmark_full.tflite";case 2:return"pose_landmark_heavy.tflite";default:return"pose_landmark_lite.tflite"}}function Rt(e){var t=this;e=e||{},this.g=new Ut({locateFile:e.locateFile,files:function(e){return[{url:"pose_solution_packed_assets_loader.js"},{simd:!1,url:"pose_solution_wasm_bin.js"},{simd:!0,url:"pose_solution_simd_wasm_bin.js"},{data:!0,url:ft(e.modelComplexity)}]},graph:{url:"pose_web.binarypb"},listeners:[{wants:["pose_landmarks","world_landmarks","segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:ut},poseWorldLandmarks:{type:"proto",stream:"world_landmarks",transform:ut},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,i;return f((function(o){return 1==o.g?(n=ft(e),r="third_party/mediapipe/modules/pose_landmark/"+n,U(o,bt(t.g,n),2)):(i=o.h,t.g.overrideFile(r,i),o.return(!0))}))}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}}}})}(t=Ut.prototype).close=function(){return this.i&&this.i.delete(),e.resolve()},t.reset=function(){var e=this;return f((function(t){e.i&&(e.i.reset(),e.m={},e.s={}),t.g=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],o={},a=l(Object.keys(e)),c=a.next();!c.done;o={K:o.K,L:o.L},c=a.next()){var s=c.value;s in this.j&&this.j[s]===e[s]||(this.j[s]=e[s],void 0!==(c=t[s])&&(c.onChange&&(o.K=c.onChange,o.L=e[s],r.push(function(e){return function(){return f((function(t){if(1==t.g)return U(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}}(o))),c.graphOptionXref&&(s={valueNumber:1===c.type?e[s]:0,valueBoolean:0===c.type&&e[s],valueString:2===c.type?e[s]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),s),i.push(c))))}(0!==r.length||0!==i.length)&&(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.v=(void 0===this.v?[]:this.v).concat(r))}},t.initialize=function(){var e=this;return f((function(t){return 1==t.g?U(t,mt(e),2):3!=t.g?U(t,function(e){var t,n,r,i,o,a,c,s;return f((function(d){if(1==d.g)return e.g.graph&&e.g.graph.url&&e.P===e.g.graph.url?d.return():(e.o=!0,e.g.graph&&e.g.graph.url?(e.P=e.g.graph.url,U(d,bt(e,e.g.graph.url),3)):void(d.g=2));for(2!=d.g&&(t=d.h,e.i.loadGraph(t)),n=l(Object.keys(e.B)),r=n.next();!r.done;r=n.next())i=r.value,e.i.overrideFile(i,e.B[i]);if(e.B={},e.g.listeners)for(o=l(e.g.listeners),a=o.next();!a.done;a=o.next())c=a.value,Zt(e,c);s=e.j,e.j={},e.setOptions(s),d.g=0}))}(e),3):U(t,function(e){var t,n,r,i,o,a;return f((function(c){switch(c.g){case 1:if(!e.o)return c.return();if(!e.v){c.g=2;break}t=l(e.v),n=t.next();case 3:if(n.done){c.g=5;break}return U(c,(0,n.value)(),4);case 4:n=t.next(),c.g=3;break;case 5:e.v=void 0;case 2:if(e.A){for(r=new e.h.GraphOptionChangeRequestList,i=l(e.A),o=i.next();!o.done;o=i.next())a=o.value,r.push_back(a);e.i.changeOptions(r),r.delete(),e.A=void 0}e.o=!1,c.g=0}}))}(e),0)}))},t.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},t.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},t.send=function(e,t){var n,r,i,o,a,c,s,d,u,A=this;return f((function(h){switch(h.g){case 1:return A.g.inputs?(n=1e3*(null!=t?t:performance.now()),U(h,A.C,2)):h.return();case 2:return U(h,A.initialize(),3);case 3:for(r=new A.h.PacketDataList,i=l(Object.keys(e)),o=i.next();!o.done;o=i.next())if(a=o.value,c=A.g.inputs[a]){e:{var g=e[a];switch(c.type){case"video":var Q=A.m[c.stream];if(Q||(Q=new At(A.h,A.D),A.m[c.stream]=Q),0===Q.l&&(Q.l=Q.h.createTexture()),typeof HTMLVideoElement<"u"&&g instanceof HTMLVideoElement)var F=g.videoWidth,p=g.videoHeight;else typeof HTMLImageElement<"u"&&g instanceof HTMLImageElement?(F=g.naturalWidth,p=g.naturalHeight):(F=g.width,p=g.height);p={glName:Q.l,width:F,height:p},(F=Q.g).canvas.width=p.width,F.canvas.height=p.height,F.activeTexture(F.TEXTURE0),Q.h.bindTexture2d(Q.l),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,g),Q.h.bindTexture2d(0),Q=p;break e;case"detections":for((Q=A.m[c.stream])||(Q=new gt(A.h),A.m[c.stream]=Q),Q.data||(Q.data=new Q.g.DetectionListData),Q.data.reset(g.length),p=0;p<g.length;++p){F=g[p];var m=Q.data,b=m.setBoundingBox,B=p,Z=F.T,f=new ot;if(Ve(f,1,Z.Y),Ve(f,2,Z.Z),Ve(f,3,Z.height),Ve(f,4,Z.width),Ve(f,5,Z.rotation),Ve(f,6,Z.W),Z=Xe(f,at),b.call(m,B,Z),F.O)for(m=0;m<F.O.length;++m){var R=!!(f=F.O[m]).visibility;B=(b=Q.data).addNormalizedLandmark,Z=p,f=Object.assign(Object.assign({},f),{visibility:R?f.visibility:0}),Ve(R=new qe,1,f.x),Ve(R,2,f.y),Ve(R,3,f.z),f.visibility&&Ve(R,4,f.visibility),f=Xe(R,$e),B.call(b,Z,f)}if(F.M)for(m=0;m<F.M.length;++m)B=(b=Q.data).addClassification,Z=p,f=F.M[m],Ve(R=new He,2,f.X),f.index&&Ve(R,1,f.index),f.label&&Ve(R,3,f.label),f.displayName&&Ve(R,4,f.displayName),f=Xe(R,Ke),B.call(b,Z,f)}Q=Q.data;break e;default:Q={}}}switch(s=Q,d=c.stream,c.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},s),{stream:d,timestamp:n}));break;case"detections":(u=s).stream=d,u.timestamp=n,r.pushDetectionList(u);break;default:throw Error("Unknown input config type: '"+c.type+"'")}}return A.i.send(r),U(h,A.C,4);case 4:r.delete(),h.g=0}}))},t.onResults=function(e,t){this.listeners[t||"$"]=e},y("Solution",Ut),y("OptionType",{BOOL:0,NUMBER:1,$:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Rt.prototype).reset=function(){this.g.reset()},t.close=function(){return this.g.close(),e.resolve()},t.onResults=function(e){this.g.onResults(e)},t.initialize=function(){var e=this;return f((function(t){return U(t,e.g.initialize(),0)}))},t.send=function(e,t){var n=this;return f((function(r){return U(r,n.g.send(e,t),0)}))},t.setOptions=function(e){this.g.setOptions(e)},y("Pose",Rt),y("POSE_CONNECTIONS",[[0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]]),y("POSE_LANDMARKS",{NOSE:0,LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,LEFT_EAR:7,RIGHT_EAR:8,LEFT_RIGHT:9,RIGHT_LEFT:10,LEFT_SHOULDER:11,RIGHT_SHOULDER:12,LEFT_ELBOW:13,RIGHT_ELBOW:14,LEFT_WRIST:15,RIGHT_WRIST:16,LEFT_PINKY:17,RIGHT_PINKY:18,LEFT_INDEX:19,RIGHT_INDEX:20,LEFT_THUMB:21,RIGHT_THUMB:22,LEFT_HIP:23,RIGHT_HIP:24,LEFT_KNEE:25,RIGHT_KNEE:26,LEFT_ANKLE:27,RIGHT_ANKLE:28,LEFT_HEEL:29,RIGHT_HEEL:30,LEFT_FOOT_INDEX:31,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_LEFT",{LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,LEFT_EAR:7,LEFT_RIGHT:9,LEFT_SHOULDER:11,LEFT_ELBOW:13,LEFT_WRIST:15,LEFT_PINKY:17,LEFT_INDEX:19,LEFT_THUMB:21,LEFT_HIP:23,LEFT_KNEE:25,LEFT_ANKLE:27,LEFT_HEEL:29,LEFT_FOOT_INDEX:31}),y("POSE_LANDMARKS_RIGHT",{RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,RIGHT_EAR:8,RIGHT_LEFT:10,RIGHT_SHOULDER:12,RIGHT_ELBOW:14,RIGHT_WRIST:16,RIGHT_PINKY:18,RIGHT_INDEX:20,RIGHT_THUMB:22,RIGHT_HIP:24,RIGHT_KNEE:26,RIGHT_ANKLE:28,RIGHT_HEEL:30,RIGHT_FOOT_INDEX:32}),y("POSE_LANDMARKS_NEUTRAL",{NOSE:0}),y("VERSION","0.5.1635988162")}).call(xe);const Me=function(){function t(){this.mediapipeMap_=new Map}var n=t.prototype;return n.getVersion=function(e){switch(e){case"face_detection":return Ye.VERSION;case"face_mesh":return we.VERSION;case"hands":return ke.VERSION;case"holistic":return Te.VERSION;case"objectron":return De.VERSION;case"selfie_segmentation":return Xe.VERSION;case"pose":return xe.VERSION;default:return""}},n.initialize=function(n){var r=this;return new e(function(){var e=(0,c.default)(o.default.mark((function e(i,a){var l,c,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!=n.mediaPipeModelConfigArray.length){e.next=3;break}return a("no model was selected"),e.abrupt("return");case 3:l=0;case 4:if(!(l<n.mediaPipeModelConfigArray.length)){e.next=45;break}if(c=n.mediaPipeModelConfigArray[l],!r.mediapipeMap_.has(c.modelType)){e.next=9;break}return a("setting same type is not supported"),e.abrupt("return");case 9:if("function"==typeof c.listener){e.next=12;break}return a(`[${c.modelType}] ResultsListener must be provided`),e.abrupt("return");case 12:e.t0=c.modelType,e.next="face_mesh"===e.t0?15:"face_detection"===e.t0?17:"hands"===e.t0?19:"holistic"===e.t0?21:"objectron"===e.t0?23:"selfie_segmentation"===e.t0?25:"pose"===e.t0?27:29;break;case 15:return s=new we.FaceMesh({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"face_mesh/"+r.getVersion("face_mesh"))+"/"+e}),e.abrupt("break",31);case 17:return s=new Ye.FaceDetection({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"face_detection/"+r.getVersion("face_detection"))+"/"+e}),e.abrupt("break",31);case 19:return s=new ke.Hands({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"hands/"+r.getVersion("hands"))+"/"+e}),e.abrupt("break",31);case 21:return s=new Te.Holistic({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"holistic/"+r.getVersion("holistic"))+"/"+e}),e.abrupt("break",31);case 23:return s=new De.Objectron({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"objectron/"+r.getVersion("objectron"))+"/"+e}),e.abrupt("break",31);case 25:return s=new Xe.SelfieSegmentation({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"selfie_segmentation/"+r.getVersion("selfie_segmentation"))+"/"+e}),e.abrupt("break",31);case 27:return s=new xe.Pose({locateFile:(e,n)=>(c.assetsUri||t.defaultAssetsBaseUrl+"pose/"+r.getVersion("pose"))+"/"+e}),e.abrupt("break",31);case 29:return a("unknown model type"),e.abrupt("return");case 31:return s.onResults(c.listener),c.options&&s.setOptions(c.options),e.prev=32,e.next=35,s.initialize();case 35:r.mediapipeMap_.set(c.modelType,s),e.next=42;break;case 38:return e.prev=38,e.t1=e.catch(32),a(e.t1),e.abrupt("return");case 42:l++,e.next=4;break;case 45:i();case 46:case"end":return e.stop()}}),e,null,[[32,38]])})));return function(t,n){return e.apply(this,arguments)}}())},n.close=function(t){return new e((n,r)=>{let i=[];if(t){let e=this.mediapipeMap_.get(t);if(!e)return void r("model not exit");this.mediapipeMap_.delete(t),i.push(e.close())}else{for(var o,a=A(this.mediapipeMap_.entries());!(o=a()).done;){const e=o.value,t=(e[0],e[1]);i.push(t.close())}this.mediapipeMap_.clear()}e.all(i).then(()=>{n()}).catch(e=>{r(e)})})},n.send=function(t,n){return new e((r,i)=>{let o=[];if(n){let e=this.mediapipeMap_.get(n);if(!e)return void i("model not exit");o.push(e.send({image:t}))}else for(var a,l=A(this.mediapipeMap_.entries());!(a=l()).done;){const e=a.value,n=(e[0],e[1]);o.push(n.send({image:t}))}e.all(o).then(()=>{r()}).catch(e=>{i(e)})})},n.reset=function(e){if(e){let t=this.mediapipeMap_.get(e);t&&"function"==typeof t.reset&&t.reset()}else for(var t,n=A(this.mediapipeMap_.entries());!(t=n()).done;){const e=t.value,n=(e[0],e[1]);n&&"function"==typeof n.reset&&n.reset()}},t}();Me.defaultAssetsBaseUrl="https://d3opqjmqzxf057.cloudfront.net/ml/mediapipe/";let He=Me;t.MediapipeHelper=He;const Ke=new WeakMap,Le=new WeakMap,ze=new WeakMap,Oe=Symbol("anyProducer"),je=e.resolve(),Pe=Symbol("listenerAdded"),_e=Symbol("listenerRemoved");let qe=!1,$e=!1;function et(e){if("string"!=typeof e&&"symbol"!=typeof e&&"number"!=typeof e)throw new TypeError("`eventName` must be a string, symbol, or number")}function tt(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function nt(e,t){const n=Le.get(e);if(n.has(t))return n.get(t)}function rt(e,t){const n="string"==typeof t||"symbol"==typeof t||"number"==typeof t?t:Oe,r=ze.get(e);if(r.has(n))return r.get(n)}function it(t,n,r){const i=ze.get(t);if(i.has(n))for(var o,a=A(i.get(n));!(o=a()).done;){o.value.enqueue(r)}if(i.has(Oe)){const t=e.all([n,r]);for(var l,c=A(i.get(Oe));!(l=c()).done;){l.value.enqueue(t)}}}function ot(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},a=[];const l={enqueue(e){a.push(e),i()},finish(){r=!0,i()}};for(var s,d=A(n);!(s=d()).done;){const e=s.value;let n=rt(t,e);n||(n=new Set,ze.get(t).set(e,n)),n.add(l)}return{next(){var t=this;return(0,c.default)(o.default.mark((function n(){return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!a){n.next=20;break}if(0!==a.length){n.next=12;break}if(!r){n.next=6;break}n.t2=(a=void 0,t.next()),n.next=9;break;case 6:return n.next=8,new e(e=>{i=e});case 8:n.t2=t.next();case 9:n.t1=n.t2,n.next=17;break;case 12:return n.t3=!1,n.next=15,a.shift();case 15:n.t4=n.sent,n.t1={done:n.t3,value:n.t4};case 17:n.t0=n.t1,n.next=21;break;case 20:n.t0={done:!0};case 21:return n.abrupt("return",n.t0);case 22:case"end":return n.stop()}}),n)})))()},return(e){var r=arguments;return(0,c.default)(o.default.mark((function c(){var s,d,u,h;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:for(a=void 0,s=A(n);!(d=s()).done;)u=d.value,(h=rt(t,u))&&(h.delete(l),0===h.size&&ze.get(t).delete(u));if(i(),!(r.length>0)){o.next=11;break}return o.t1=!0,o.next=7,e;case 7:o.t2=o.sent,o.t0={done:o.t1,value:o.t2},o.next=12;break;case 11:o.t0={done:!0};case 12:return o.abrupt("return",o.t0);case 13:case"end":return o.stop()}}),c)})))()},[Symbol.asyncIterator](){return this}}}function at(e){if(void 0===e)return dt;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(var t,n=A(e);!(t=n()).done;){const e=t.value;if(!dt.includes(e))throw"string"!=typeof e?new TypeError("`methodNames` element must be a string"):new Error(e+" is not Emittery method")}return e}const lt=e=>e===Pe||e===_e;function ct(e,t,n){if(lt(t))try{qe=!0,e.emit(t,n)}finally{qe=!1}}let st=function(){function t(e){var t;void 0===e&&(e={}),Ke.set(this,new Set),Le.set(this,new Map),ze.set(this,new Map),ze.get(this).set(Oe,new Set),this.debug=null!=(t=e.debug)?t:{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{try{r=JSON.stringify(r)}catch(e){r="Object with the following keys failed to stringify: "+Object.keys(r).join(",")}("symbol"==typeof n||"number"==typeof n)&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}t.mixin=function(e,n){return n=at(n),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(var i,o=A(n);!(i=o()).done;){const e=i.value;if(void 0!==r.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``)}Object.defineProperty(r.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new t}),this[e]}});const a=t=>function(){return this[e][t](...arguments)};for(var l,c=A(n);!(l=c()).done;){const e=l.value;Object.defineProperty(r.prototype,e,{enumerable:!1,value:a(e)})}return r}};var n=t.prototype;return n.logIfDebugEnabled=function(e,n,r){(t.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,n,r)},n.on=function(e,t){tt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;et(e);let r=nt(this,e);r||(r=new Set,Le.get(this).set(e,r)),r.add(t),this.logIfDebugEnabled("subscribe",e,void 0),lt(e)||ct(this,Pe,{eventName:e,listener:t})}return this.off.bind(this,e,t)},n.off=function(e,t){tt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;et(e);const r=nt(this,e);r&&(r.delete(t),0===r.size&&Le.get(this).delete(e)),this.logIfDebugEnabled("unsubscribe",e,void 0),lt(e)||ct(this,_e,{eventName:e,listener:t})}},n.once=function(t){let n;const r=new e(e=>{n=this.on(t,t=>{n(),e(t)})});return r.off=n,r},n.events=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){et(t.value)}return ot(this,e)},n.emit=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i,a,l,s,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(et(n),!lt(n)||qe){t.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emit",n,r),it(this,n,r),a=null!=(i=nt(this,n))?i:new Set,l=Ke.get(this),s=[...a],d=lt(n)?[]:[...l],t.next=6,je;case 6:return t.next=8,e.all([...s.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.has(t)){e.next=2;break}return e.abrupt("return",t(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),...d.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l.has(t)){e.next=2;break}return e.abrupt("return",t(n,r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.emitSerial=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d,u,A,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(et(t),!lt(t)||qe){e.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emitSerial",t,n),i=null!=(r=nt(this,t))?r:new Set,a=Ke.get(this),l=[...i],c=[...a],e.next=6,je;case 6:s=0,d=l;case 7:if(!(s<d.length)){e.next=16;break}if(u=d[s],e.t0=i.has(u),!e.t0){e.next=13;break}return e.next=13,u(n);case 13:s++,e.next=7;break;case 16:A=0,h=c;case 17:if(!(A<h.length)){e.next=26;break}if(u=h[A],e.t1=a.has(u),!e.t1){e.next=23;break}return e.next=23,u(t,n);case 23:A++,e.next=17;break;case 26:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),n.onAny=function(e){return tt(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),Ke.get(this).add(e),ct(this,Pe,{listener:e}),this.offAny.bind(this,e)},n.anyEvent=function(){return ot(this)},n.offAny=function(e){tt(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),ct(this,_e,{listener:e}),Ke.get(this).delete(e)},n.clearListeners=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){const e=t.value;if(this.logIfDebugEnabled("clear",e,void 0),"string"==typeof e||"symbol"==typeof e||"number"==typeof e){const t=nt(this,e);t&&t.clear();const n=rt(this,e);if(n){for(var r,i=A(n);!(r=i()).done;){r.value.finish()}n.clear()}}else{Ke.get(this).clear();for(var o,a=A(Le.get(this).entries());!(o=a()).done;){const e=o.value,t=e[0];e[1].clear(),Le.get(this).delete(t)}for(var l,c=A(ze.get(this).entries());!(l=c()).done;){const e=l.value,t=e[0],n=e[1];for(var s,d=A(n);!(s=d()).done;){s.value.finish()}n.clear(),ze.get(this).delete(t)}}}},n.listenerCount=function(e){var t,n,r;let i=0;for(var o,a=A(e=Array.isArray(e)?e:[e]);!(o=a()).done;){const e=o.value;if("string"!=typeof e){typeof e<"u"&&et(e),i+=Ke.get(this).size;for(var l,c=A(Le.get(this).values());!(l=c()).done;){i+=l.value.size}for(var s,d=A(ze.get(this).values());!(s=d()).done;){i+=s.value.size}}else{var u,h,g;i+=Ke.get(this).size+(null!=(u=null==(t=nt(this,e))?void 0:t.size)?u:0)+(null!=(h=null==(n=rt(this,e))?void 0:n.size)?h:0)+(null!=(g=null==(r=rt(this))?void 0:r.size)?g:0)}}return i},n.bindMethods=function(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");for(var n,r=A(t=at(t));!(n=r()).done;){const t=n.value;if(void 0!==e[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(e,t,{enumerable:!1,value:this[t].bind(this)})}},(0,l.default)(t,null,[{key:"isDebugEnabled",get:function(){var e,t;if("object"!=typeof(null==(t=s.process)?void 0:t.env))return $e;const n=(null!=(e=s.process)?e:{env:{}}).env;return"emittery"===n.DEBUG||"*"===n.DEBUG||$e},set:function(e){$e=e}}]),t}();const dt=Object.getOwnPropertyNames(st.prototype).filter(e=>"constructor"!==e);function ut(e,t){s.vonage||(s.vonage={}),s.vonage.workerizer||(s.vonage.workerizer={});let n=s.vonage.workerizer;return n[e]||(n[e]=t),n[e]}Object.defineProperty(st,"listenerAdded",{value:Pe,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(st,"listenerRemoved",{value:_e,writable:!1,enumerable:!0,configurable:!1});const At=ut("globals",{});var ht=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e.EVENT="EVENT",e))(ht||{});function gt(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let Qt=0;function Ft(t,n,r,i,o){const a=Qt++;return t.postMessage({id:a,type:n,functionName:r,args:i},i.filter(e=>gt(e))),new e(e=>{null==o||o.set(a,e)})}function pt(e,t){const n=e.id,r=e.type,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>gt(e)))}const Ut=ut("workerized",{});function mt(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function bt(){return Bt.apply(this,arguments)}function Bt(){return(Bt=(0,c.default)(o.default.mark((function t(){var n,r,i,a,l;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!mt()){t.next=4;break}pt({type:ht.GLOBALS_SYNC},At),t.next=8;break;case 4:for(r in n=[],Ut)i=Ut[r].workerContext,a=i.worker,l=i.resolvers,a&&n.push(Ft(a,ht.GLOBALS_SYNC,"",[At],l));return t.next=8,e.all(n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zt(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],Zt(e[n],t[n])):"object"==typeof e[n]?(t[n]={},Zt(e[n],t[n])):t[n]=e[n]}function ft(e,t,n,r){return Rt.apply(this,arguments)}function Rt(){return(Rt=(0,c.default)(o.default.mark((function e(t,n,r,i){var a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a=new n).addEventListener("message",function(){var e=(0,c.default)(o.default.mark((function e(t){var n,a,l,c,s,d,u,A,h,g;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.data,e.t0=n.type,e.next=e.t0===ht.GLOBALS_SYNC?4:e.t0===ht.EVENT?12:17;break;case 4:if(!n.id){e.next=8;break}null==(l=r.get(null!=(a=n.id)?a:-1))||l(n.result),r.delete(null!=(c=n.id)?c:-1),e.next=11;break;case 8:return Zt(null!=(s=n.result)?s:{},At),e.next=11,bt();case 11:return e.abrupt("break",18);case 12:if(h=n.result,null!=(null==(g=h)?void 0:g.name)){e.next=15;break}throw"Missing event name";case 15:return i(g.name,g.data),e.abrupt("break",18);case 17:null==(u=r.get(null!=(d=n.id)?d:-1))||u(n.result),r.delete(null!=(A=n.id)?A:-1);case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=4,Ft(a,ht.INIT,"",[t.workerId,At],r);case 4:if(e.sent){e.next=6;break}throw"Failed to instantiate workerized class";case 6:return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const It=new WeakMap,yt=new WeakMap,Vt=new WeakMap,Ct=Symbol("anyProducer"),Wt=e.resolve(),Et=Symbol("listenerAdded"),St=Symbol("listenerRemoved");let vt=!1,Jt=!1;function Nt(e){if("string"!=typeof e&&"symbol"!=typeof e&&"number"!=typeof e)throw new TypeError("`eventName` must be a string, symbol, or number")}function Gt(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function Xt(e,t){const n=yt.get(e);if(n.has(t))return n.get(t)}function kt(e,t){const n="string"==typeof t||"symbol"==typeof t||"number"==typeof t?t:Ct,r=Vt.get(e);if(r.has(n))return r.get(n)}function Tt(t,n,r){const i=Vt.get(t);if(i.has(n))for(var o,a=A(i.get(n));!(o=a()).done;){o.value.enqueue(r)}if(i.has(Ct)){const t=e.all([n,r]);for(var l,c=A(i.get(Ct));!(l=c()).done;){l.value.enqueue(t)}}}function Yt(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},a=[];const l={enqueue(e){a.push(e),i()},finish(){r=!0,i()}};for(var s,d=A(n);!(s=d()).done;){const e=s.value;let n=kt(t,e);n||(n=new Set,Vt.get(t).set(e,n)),n.add(l)}return{next(){var t=this;return(0,c.default)(o.default.mark((function n(){return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!a){n.next=20;break}if(0!==a.length){n.next=12;break}if(!r){n.next=6;break}n.t2=(a=void 0,t.next()),n.next=9;break;case 6:return n.next=8,new e(e=>{i=e});case 8:n.t2=t.next();case 9:n.t1=n.t2,n.next=17;break;case 12:return n.t3=!1,n.next=15,a.shift();case 15:n.t4=n.sent,n.t1={done:n.t3,value:n.t4};case 17:n.t0=n.t1,n.next=21;break;case 20:n.t0={done:!0};case 21:return n.abrupt("return",n.t0);case 22:case"end":return n.stop()}}),n)})))()},return(e){var r=arguments;return(0,c.default)(o.default.mark((function c(){var s,d,u,h;return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:for(a=void 0,s=A(n);!(d=s()).done;)u=d.value,(h=kt(t,u))&&(h.delete(l),0===h.size&&Vt.get(t).delete(u));if(i(),!(r.length>0)){o.next=11;break}return o.t1=!0,o.next=7,e;case 7:o.t2=o.sent,o.t0={done:o.t1,value:o.t2},o.next=12;break;case 11:o.t0={done:!0};case 12:return o.abrupt("return",o.t0);case 13:case"end":return o.stop()}}),c)})))()},[Symbol.asyncIterator](){return this}}}function wt(e){if(void 0===e)return Ht;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(var t,n=A(e);!(t=n()).done;){const e=t.value;if(!Ht.includes(e))throw"string"!=typeof e?new TypeError("`methodNames` element must be a string"):new Error(e+" is not Emittery method")}return e}const Dt=e=>e===Et||e===St;function xt(e,t,n){if(Dt(t))try{vt=!0,e.emit(t,n)}finally{vt=!1}}let Mt=function(){function t(e){var t;void 0===e&&(e={}),It.set(this,new Set),yt.set(this,new Map),Vt.set(this,new Map),Vt.get(this).set(Ct,new Set),this.debug=null!=(t=e.debug)?t:{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{try{r=JSON.stringify(r)}catch(e){r="Object with the following keys failed to stringify: "+Object.keys(r).join(",")}("symbol"==typeof n||"number"==typeof n)&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}t.mixin=function(e,n){return n=wt(n),r=>{if("function"!=typeof r)throw new TypeError("`target` must be function");for(var i,o=A(n);!(i=o()).done;){const e=i.value;if(void 0!==r.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``)}Object.defineProperty(r.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new t}),this[e]}});const a=t=>function(){return this[e][t](...arguments)};for(var l,c=A(n);!(l=c()).done;){const e=l.value;Object.defineProperty(r.prototype,e,{enumerable:!1,value:a(e)})}return r}};var n=t.prototype;return n.logIfDebugEnabled=function(e,n,r){(t.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,n,r)},n.on=function(e,t){Gt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;Nt(e);let r=Xt(this,e);r||(r=new Set,yt.get(this).set(e,r)),r.add(t),this.logIfDebugEnabled("subscribe",e,void 0),Dt(e)||xt(this,Et,{eventName:e,listener:t})}return this.off.bind(this,e,t)},n.off=function(e,t){Gt(t);for(var n,r=A(e=Array.isArray(e)?e:[e]);!(n=r()).done;){const e=n.value;Nt(e);const r=Xt(this,e);r&&(r.delete(t),0===r.size&&yt.get(this).delete(e)),this.logIfDebugEnabled("unsubscribe",e,void 0),Dt(e)||xt(this,St,{eventName:e,listener:t})}},n.once=function(t){let n;const r=new e(e=>{n=this.on(t,t=>{n(),e(t)})});return r.off=n,r},n.events=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){Nt(t.value)}return Yt(this,e)},n.emit=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i,a,l,s,d;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Nt(n),!Dt(n)||vt){t.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emit",n,r),Tt(this,n,r),a=null!=(i=Xt(this,n))?i:new Set,l=It.get(this),s=[...a],d=Dt(n)?[]:[...l],t.next=6,Wt;case 6:return t.next=8,e.all([...s.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.has(t)){e.next=2;break}return e.abrupt("return",t(r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),...d.map(function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l.has(t)){e.next=2;break}return e.abrupt("return",t(n,r));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.emitSerial=function(){var e=(0,c.default)(o.default.mark((function e(t,n){var r,i,a,l,c,s,d,u,A,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Nt(t),!Dt(t)||vt){e.next=2;break}throw new TypeError("`eventName` cannot be meta event `listenerAdded` or `listenerRemoved`");case 2:return this.logIfDebugEnabled("emitSerial",t,n),i=null!=(r=Xt(this,t))?r:new Set,a=It.get(this),l=[...i],c=[...a],e.next=6,Wt;case 6:s=0,d=l;case 7:if(!(s<d.length)){e.next=16;break}if(u=d[s],e.t0=i.has(u),!e.t0){e.next=13;break}return e.next=13,u(n);case 13:s++,e.next=7;break;case 16:A=0,h=c;case 17:if(!(A<h.length)){e.next=26;break}if(u=h[A],e.t1=a.has(u),!e.t1){e.next=23;break}return e.next=23,u(t,n);case 23:A++,e.next=17;break;case 26:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),n.onAny=function(e){return Gt(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),It.get(this).add(e),xt(this,Et,{listener:e}),this.offAny.bind(this,e)},n.anyEvent=function(){return Yt(this)},n.offAny=function(e){Gt(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),xt(this,St,{listener:e}),It.get(this).delete(e)},n.clearListeners=function(e){for(var t,n=A(e=Array.isArray(e)?e:[e]);!(t=n()).done;){const e=t.value;if(this.logIfDebugEnabled("clear",e,void 0),"string"==typeof e||"symbol"==typeof e||"number"==typeof e){const t=Xt(this,e);t&&t.clear();const n=kt(this,e);if(n){for(var r,i=A(n);!(r=i()).done;){r.value.finish()}n.clear()}}else{It.get(this).clear();for(var o,a=A(yt.get(this).entries());!(o=a()).done;){const e=o.value,t=e[0];e[1].clear(),yt.get(this).delete(t)}for(var l,c=A(Vt.get(this).entries());!(l=c()).done;){const e=l.value,t=e[0],n=e[1];for(var s,d=A(n);!(s=d()).done;){s.value.finish()}n.clear(),Vt.get(this).delete(t)}}}},n.listenerCount=function(e){var t,n,r,i,o,a;let l=0;for(var c,s=A(e=Array.isArray(e)?e:[e]);!(c=s()).done;){const e=c.value;if("string"!=typeof e){typeof e<"u"&&Nt(e),l+=It.get(this).size;for(var d,u=A(yt.get(this).values());!(d=u()).done;){l+=d.value.size}for(var h,g=A(Vt.get(this).values());!(h=g()).done;){l+=h.value.size}}else l+=It.get(this).size+(null!=(n=null==(t=Xt(this,e))?void 0:t.size)?n:0)+(null!=(i=null==(r=kt(this,e))?void 0:r.size)?i:0)+(null!=(a=null==(o=kt(this))?void 0:o.size)?a:0)}return l},n.bindMethods=function(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");for(var n,r=A(t=wt(t));!(n=r()).done;){const t=n.value;if(void 0!==e[t])throw new Error(`The property \`${t}\` already exists on \`target\``);Object.defineProperty(e,t,{enumerable:!1,value:this[t].bind(this)})}},(0,l.default)(t,null,[{key:"isDebugEnabled",get:function(){var e,t;if("object"!=typeof(null==(e=s.process)?void 0:e.env))return Jt;const n=(null!=(t=s.process)?t:{env:{}}).env;return"emittery"===n.DEBUG||"*"===n.DEBUG||Jt},set:function(e){Jt=e}}]),t}();const Ht=Object.getOwnPropertyNames(Mt.prototype).filter(e=>"constructor"!==e);function Kt(e){return e.prototype.onAny&&e.prototype.emit}Object.defineProperty(Mt,"listenerAdded",{value:Et,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Mt,"listenerRemoved",{value:St,writable:!1,enumerable:!0,configurable:!1});let Lt=0;function zt(e,t,n){return Ot.apply(this,arguments)}function Ot(){return(Ot=(0,c.default)(o.default.mark((function e(t,n,r){var i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Kt(t)?new Mt:{},a=Lt++,e.abrupt("return",(Object.getOwnPropertyNames(t.prototype).forEach(e=>{i[e]=function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return Ft(n,ht.FORWARD,e,i,r)}}),i.terminate=(0,c.default)(o.default.mark((function e(){var t,l,c,s,d=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=d.length,l=new Array(t),c=0;c<t;c++)l[c]=d[c];return e.next=3,Ft(n,ht.TERMINATE,"",l,r);case 3:return s=e.sent,e.abrupt("return",(delete Ut[a],n.terminate(),i.workerContext.worker=void 0,s));case 5:case"end":return e.stop()}}),e)}))),i.workerContext={id:a,worker:n,resolvers:r},Ut[a]=i,i));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jt(e,t){return Pt.apply(this,arguments)}function Pt(){return(Pt=(0,c.default)(o.default.mark((function e(t,n){var r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Map,e.next=3,ft(t,n,r,(e,t)=>{null!=i&&i.emit&&(null==i||i.emit(e,t))});case 3:return a=e.sent,e.next=6,zt(t,a,r);case 6:return i=e.sent,e.abrupt("return",i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _t(e,t){return qt.apply(this,arguments)}function qt(){return(qt=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.functionName,i=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(r){e.next=5;break}throw"missing function name to call";case 5:if(n.instance[r]){e.next=7;break}throw`undefined function [${r}] in class ${n.instance.constructor.workerId}`;case 7:return e.t0=pt,e.t1=t,e.next=11,n.instance[r](...null!=i?i:[]);case 11:e.t2=e.sent,(0,e.t0)(e.t1,e.t2);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const $t=ut("registeredWorkers",{});function en(e,t){if(!e.args)throw"Missing className while initializing worker";const n=e.args,r=n[0],i=n[1],o=$t[r];if(!o)throw"unknown worker class "+r;t.instance=new o(e.args.slice(1)),Zt(i,At),function(e){return e.onAny&&e.emit}(t.instance)&&t.instance.onAny((e,t)=>{pt({type:ht.EVENT},{name:e,data:t})}),pt(e,void 0!==typeof t.instance)}function tn(e,t){return nn.apply(this,arguments)}function nn(){return(nn=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(e.t0=n.instance.terminate,!e.t0){e.next=8;break}return e.next=7,n.instance.terminate(...null!=r?r:[]);case 7:i=e.sent;case 8:pt(t,i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rn(e){if(!e.args)throw"Missing globals while syncing";Zt(e.args[0],At),pt(e,{})}mt()&&function(){const e={};onmessage=function(){var t=(0,c.default)(o.default.mark((function t(n){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,t.t0=r.type,t.next=t.t0===ht.INIT?4:t.t0===ht.FORWARD?6:t.t0===ht.TERMINATE?8:t.t0===ht.GLOBALS_SYNC?10:12;break;case 4:return en(r,e),t.abrupt("break",12);case 6:return _t(r,e),t.abrupt("break",12);case 8:return tn(r,e),t.abrupt("break",12);case 10:return rn(r),t.abrupt("break",12);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}();let on=function(){function t(){}return t.createVideoReadable=function(){var t=(0,c.default)(o.default.mark((function t(n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new e((e,t)=>{const r=document.createElement("video");let i=new AbortController,o=new AbortController;r.addEventListener("canplay",()=>{i.abort(),r.muted=!0,r.loop=!0,r.play().then(()=>{try{const t=r.captureStream(),n=new MediaStreamTrackProcessor(t.getVideoTracks()[0]);e(n.readable)}catch(e){t(e)}})},{once:!0,signal:o.signal}),r.addEventListener("error",e=>{o.abort(),t("loading error:"+e)},{once:!0,signal:i.signal}),r.crossOrigin="anonymous",r.src=n}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),t.createImageCanvas=function(){var e=(0,c.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return e.next=4,e.sent.blob();case 4:return n=e.sent,e.next=7,createImageBitmap(n);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t}();var an=Object.defineProperty,ln=(e,t,n)=>(((e,t,n)=>{t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,t+"",n),n);let cn;const sn=new Uint8Array(16);function dn(){if(!cn&&(cn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!cn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return cn(sn)}const un=[];for(let e=0;e<256;++e)un.push((e+256).toString(16).slice(1));const An={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hn(e,t,n){if(An.randomUUID&&!t&&!e)return An.randomUUID();const r=(e=e||{}).random||(e.rng||dn)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t){return void 0===t&&(t=0),(un[e[t+0]]+un[e[t+1]]+un[e[t+2]]+un[e[t+3]]+"-"+un[e[t+4]]+un[e[t+5]]+"-"+un[e[t+6]]+un[e[t+7]]+"-"+un[e[t+8]]+un[e[t+9]]+"-"+un[e[t+10]]+un[e[t+11]]+un[e[t+12]]+un[e[t+13]]+un[e[t+14]]+un[e[t+15]]).toLowerCase()}(r)}function gn(e,t){s.vonage||(s.vonage={}),s.vonage.workerizer||(s.vonage.workerizer={});let n=s.vonage.workerizer;return n[e]||(n[e]=t),n[e]}const Qn=gn("globals",{});var Fn=(e=>(e.INIT="INIT",e.FORWARD="FORWARD",e.TERMINATE="TERMINATE",e.GLOBALS_SYNC="GLOBALS_SYNC",e))(Fn||{});function pn(e){return[ImageBitmap,ReadableStream,WritableStream].some(t=>e instanceof t)}let Un=0;function mn(t,n,r,i,o){const a=Un++;return t.postMessage({id:a,type:n,functionName:r,args:i},i.filter(e=>pn(e))),new e(e=>{null==o||o.set(a,e)})}function bn(e,t){const n=e.id,r=e.type,i=Array.isArray(t)?t:[t];postMessage({id:n,type:r,result:t},i.filter(e=>pn(e)))}const Bn=gn("workerized",{});function Zn(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function fn(){return Rn.apply(this,arguments)}function Rn(){return(Rn=(0,c.default)(o.default.mark((function t(){var n,r,i,a,l;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Zn()){t.next=4;break}bn({type:Fn.GLOBALS_SYNC},Qn),t.next=8;break;case 4:for(r in n=[],Bn)i=Bn[r].workerContext,a=i.worker,l=i.resolvers,a&&n.push(mn(a,Fn.GLOBALS_SYNC,"",[Qn],l));return t.next=8,e.all(n);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function In(e,t){if(Array.isArray(t))t.splice(0,t.length);else if("object"==typeof t)for(const e in t)delete t[e];for(const n in e)Array.isArray(e[n])?(t[n]=[],In(e[n],t[n])):"object"==typeof e[n]?(t[n]={},In(e[n],t[n])):t[n]=e[n]}function yn(e,t){return Vn.apply(this,arguments)}function Vn(){return(Vn=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.functionName,i=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(r){e.next=5;break}throw"missing function name to call";case 5:if(n.instance[r]){e.next=7;break}throw`undefined function [${r}] in class ${n.instance.constructor.workerId}`;case 7:return e.t0=bn,e.t1=t,e.next=11,n.instance[r](...null!=i?i:[]);case 11:e.t2=e.sent,(0,e.t0)(e.t1,e.t2);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}const Cn=gn("registeredWorkers",{});function Wn(e,t){if(!e.args)throw"Missing className while initializing worker";const n=e.args,r=n[0],i=n[1],o=Cn[r];if(!o)throw"unknown worker class "+r;t.instance=new o(e.args.slice(1)),In(i,Qn),bn(e,void 0!==typeof t.instance)}function En(e,t){return Sn.apply(this,arguments)}function Sn(){return(Sn=(0,c.default)(o.default.mark((function e(t,n){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.args,n.instance){e.next=3;break}throw"instance not initialized";case 3:if(e.t0=n.instance.terminate,!e.t0){e.next=8;break}return e.next=7,n.instance.terminate(...null!=r?r:[]);case 7:i=e.sent;case 8:bn(t,i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vn(e){if(!e.args)throw"Missing globals while syncing";In(e.args[0],Qn),bn(e,{})}Zn()&&function(){const e={};onmessage=function(){var t=(0,c.default)(o.default.mark((function t(n){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.data,t.t0=r.type,t.next=t.t0===Fn.INIT?4:t.t0===Fn.FORWARD?6:t.t0===Fn.TERMINATE?8:t.t0===Fn.GLOBALS_SYNC?10:12;break;case 4:return Wn(r,e),t.abrupt("break",12);case 6:return yn(r,e),t.abrupt("break",12);case 8:return En(r,e),t.abrupt("break",12);case 10:return vn(r),t.abrupt("break",12);case 12:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}();const Jn=function(e,t){return function(e,t){return Qn[e]||(Qn[e]=t),[()=>Qn[e],function(){var t=(0,c.default)(o.default.mark((function t(n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Qn[e]=n,t.next=3,fn();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()]}(e,t)}("metadata"),Nn=Jn[0];Jn[1];function Gn(){return Nn()}let Xn=function(){function e(e){ln(this,"uuid",hn()),this.config=e}var t=e.prototype;return t.send=function(){var e=(0,c.default)(o.default.mark((function e(t){var n,r,i,a,l,c,s,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null!=(n=Gn())?n:{},l=a.appId,c=a.sourceType,l&&c){e.next=3;break}return e.abrupt("return","metadata missing");case 3:return s=new AbortController,d=setTimeout(()=>s.abort(),1e4),e.next=6,(null!=(i=null==(r=this.config)?void 0:r.fetch)?i:fetch)(this.getUrl(),{method:"POST",headers:this.getHeaders(),body:JSON.stringify(this.buildReport(t)),signal:s.signal});case 6:return clearTimeout(d),e.abrupt("return","success");case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.getUrl=function(){var e;let t=null!=(e=Gn().proxyUrl)?e:"https://";return t+=("/"===t.at(-1)?"":"/")+"hlg.tokbox.com/prod/logging/vcp_webrtc",t},t.getHeaders=function(){return{"Content-Type":"application/json"}},t.buildReport=function(e){const t=Gn();return Object.assign({guid:this.uuid},e,{applicationId:t.appId,timestamp:Date.now(),proxyUrl:t.proxyUrl,source:t.sourceType})},e}();let kn=function(){function e(){const e=new OffscreenCanvas(0,0),t=e.getContext("2d",{willReadFrequently:!0});if(!t)throw"Fail to retrieve 2d context";this.canvas=e,this.context=t}var t=e.prototype;return t.setFlickeringOptions=function(e){},t.enablePostProcessing=function(){},t.disablePostProcessing=function(){},t.profileWebgl=function(){var e=(0,c.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",[]);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.render=function(){var e=(0,c.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.canvas);case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.resizeCanvas=function(e){const t=e.width,n=e.height;this.canvas.width=t,this.canvas.height=n},t.renderSilhouette=function(e,t,n){void 0===n&&(n="none");const r=e.width,i=e.height;this.context.save(),this.context.drawImage(t,0,0,t.width,t.height,0,0,r,i),this.context.filter="blur(5px)",this.context.globalCompositeOperation="source-in",this.context.drawImage(t,0,0,t.width,t.height,0,0,r,i),this.context.globalCompositeOperation="source-in",this.context.filter=n,this.context.drawImage(e,0,0,r,i,0,0,this.canvas.width,this.canvas.height),this.context.restore()},t.destroy=function(){},e}(),Tn=function(e){function t(t){var n;return(n=e.call(this)||this).radius=t,n}return(0,a.default)(t,e),t.prototype.render=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.prototype.resizeCanvas.call(this,n),t.next=3,createImageBitmap(r);case 3:return i=t.sent,t.abrupt("return",(this.renderSilhouette(n,i),this.context.save(),this.context.filter=`blur(${this.radius}px)`,this.context.globalCompositeOperation="destination-over",this.context.drawImage(n,0,0,n.width,n.height),this.context.restore(),e.prototype.render.call(this,n,r)));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t}(kn),Yn=function(e){function t(t){var n;return(n=e.call(this)||this).radius=t,n}return(0,a.default)(t,e),t.prototype.render=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.prototype.resizeCanvas.call(this,n),t.next=3,createImageBitmap(r);case 3:return i=t.sent,t.abrupt("return",(this.renderSilhouette(n,i,`blur(${this.radius}px)`),this.context.save(),this.context.filter="none",this.context.globalCompositeOperation="destination-over",this.context.drawImage(n,0,0,n.width,n.height),this.context.restore(),e.prototype.render.call(this,n,r)));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t}(kn),wn=function(e){function t(){return e.apply(this,arguments)||this}(0,a.default)(t,e);var n=t.prototype;return n.setBackgroundImage=function(e){this.backgroundImage=e},n.render=function(){var t=(0,c.default)(o.default.mark((function t(n,r){var i;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.prototype.resizeCanvas.call(this,n),t.next=3,createImageBitmap(r);case 3:return i=t.sent,t.abrupt("return",(this.renderSilhouette(n,i),this.backgroundImage&&(this.context.save(),this.context.filter="none",this.context.globalCompositeOperation="destination-over",this.context.drawImage(this.backgroundImage,0,0,this.backgroundImage.width,this.backgroundImage.height,0,0,n.width,n.height),this.context.restore()),e.prototype.render.call(this,n,r)));case 5:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),t}(kn);
|
|
24
24
|
/* @license twgl.js 5.5.1 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
|
|
25
25
|
Available via the MIT license.
|
|
26
26
|
see: http://github.com/greggman/twgl.js for details */
|