PageSourceSearch

https://dyte-audio.netlify.app/static/js/main.48ebaacd.js

js dyte-audio.netlify.app collected 2026-10-03 10:40:22 UTC 2,369,631 bytes, 3 lines download raw bytes

1/*! For license information please see main.48ebaacd.js.LICENSE.txt */
2!function(){var e={8654:function(e,t,n){var r={"./dyte-audio-visualizer_2.entry.js":[9244,2304,9244],"./dyte-avatar.entry.js":[4816,2304,4816],"./dyte-breakout-room-manager_3.entry.js":[475,2304,475],"./dyte-breakout-rooms-manager.entry.js":[4307,2304,4307],"./dyte-breakout-rooms-toggle.entry.js":[9281,2304,9281],"./dyte-broadcast-message-modal.entry.js":[5677,2304,5677],"./dyte-button.entry.js":[6200,2304,6200],"./dyte-camera-toggle.entry.js":[1678,2304,1678],"./dyte-chat-composer-ui_4.entry.js":[813,2304,813],"./dyte-chat-message_2.entry.js":[2192,2304,2192],"./dyte-chat-toggle.entry.js":[8675,2304,8675],"./dyte-chat.entry.js":[1817,2304,1817],"./dyte-clock.entry.js":[2793,2304,2793],"./dyte-confirmation-modal.entry.js":[7298,2304,7298],"./dyte-controlbar-button.entry.js":[2427,2304,2427],"./dyte-controlbar.entry.js":[4815,2304,4815],"./dyte-dialog-manager.entry.js":[7999,2304,7999],"./dyte-dialog.entry.js":[8967,2304,8967],"./dyte-emoji-picker.entry.js":[9808,2304,9808],"./dyte-ended-screen.entry.js":[9434,2304,9434],"./dyte-file-message_3.entry.js":[3718,2304,3718],"./dyte-fullscreen-toggle.entry.js":[1068,2304,1068],"./dyte-grid-pagination.entry.js":[8719,2304,8719],"./dyte-grid.entry.js":[1485,2304,1485],"./dyte-header.entry.js":[6301,2304,6301],"./dyte-icon.entry.js":[2072,2304,2072],"./dyte-idle-screen.entry.js":[1941,2304,1941],"./dyte-image-viewer.entry.js":[35,2304,35],"./dyte-join-stage_2.entry.js":[5391,2304,5391],"./dyte-leave-button.entry.js":[8053,2304,8053],"./dyte-leave-meeting.entry.js":[8521,2304,8521],"./dyte-livestream-indicator.entry.js":[7106,2304,7106],"./dyte-livestream-player.entry.js":[8715,2304,8715],"./dyte-livestream-toggle.entry.js":[2469,2304,2469],"./dyte-logo.entry.js":[6275,2304,6275],"./dyte-meeting-title.entry.js":[2401,2304,2401],"./dyte-meeting.entry.js":[2046,2304,3058,2046],"./dyte-menu_3.entry.js":[4197,2304,2392,4197],"./dyte-mic-toggle.entry.js":[9546,2304,9546],"./dyte-mixed-grid.entry.js":[5288,2304,5288],"./dyte-more-toggle.entry.js":[7403,2304,7403],"./dyte-mute-all-button.entry.js":[3555,2304,3555],"./dyte-mute-all-confirmation.entry.js":[8684,2304,8684],"./dyte-name-tag.entry.js":[7181,2304,7181],"./dyte-network-indicator.entry.js":[7568,2304,7568],"./dyte-notification.entry.js":[6324,2304,6324],"./dyte-notifications.entry.js":[7766,2304,7766],"./dyte-participant-count.entry.js":[937,2304,937],"./dyte-participant-setup.entry.js":[8555,2304,8555],"./dyte-participant-tile.entry.js":[9361,2304,9361],"./dyte-participant.entry.js":[9225,2304,9225],"./dyte-participants-audio.entry.js":[7133,2304,7133],"./dyte-participants-stage-list.entry.js":[1529,2304,1529],"./dyte-participants-stage-queue.entry.js":[5509,2304,5509],"./dyte-participants-toggle.entry.js":[5181,2304,5181],"./dyte-participants-viewer-list.entry.js":[9080,2304,9080],"./dyte-participants-waiting-list.entry.js":[8068,2304,8068],"./dyte-participants.entry.js":[1870,2304,1870],"./dyte-permissions-message.entry.js":[290,2304,290],"./dyte-pip-toggle.entry.js":[6967,2304,6967],"./dyte-plugin-main.entry.js":[1862,2304,1862],"./dyte-plugins-toggle.entry.js":[2332,2304,2332],"./dyte-plugins.entry.js":[7205,2304,7205],"./dyte-poll_2.entry.js":[2027,2304,2027],"./dyte-polls-toggle.entry.js":[2996,2304,2996],"./dyte-polls.entry.js":[1408,2304,1408],"./dyte-recording-indicator.entry.js":[1771,2304,1771],"./dyte-recording-toggle.entry.js":[6769,2304,6769],"./dyte-remote-access-manager.entry.js":[3353,2304,3353],"./dyte-screen-share-toggle.entry.js":[7580,2304,9091],"./dyte-screenshare-view.entry.js":[874,2304,874],"./dyte-settings-audio_2.entry.js":[5729,2304,5729],"./dyte-settings-toggle.entry.js":[1376,2304,1376],"./dyte-settings.entry.js":[3012,2304,3012],"./dyte-setup-screen.entry.js":[1901,2304,1901],"./dyte-sidebar.entry.js":[1421,2304,1421],"./dyte-simple-grid.entry.js":[2249,2304,3058,2249],"./dyte-spinner.entry.js":[9716,2304,9716],"./dyte-spotlight-grid.entry.js":[7770,2304,7770],"./dyte-spotlight-indicator.entry.js":[296,2304,296],"./dyte-stage-toggle.entry.js":[2945,2304,2945],"./dyte-stage.entry.js":[4701,2304,4701],"./dyte-tab-bar.entry.js":[3586,2304,3586],"./dyte-text-field.entry.js":[3642,2304,3642],"./dyte-tooltip.entry.js":[4673,2304,2392,4673],"./dyte-viewer-count.entry.js":[2742,2304,2742],"./dyte-waiting-screen.entry.js":[424,2304,424],"./dyte-webinar-stage-toggle.entry.js":[8785,23
204,8785]};function i(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(r)},i.id=8654,e.exports=i},9666:function(e,t,n){"use strict";n.d(t,{g:function(){return a},h:function(){return o},p:function(){return i}});var r=n(7762),i=(n(4153),function(e){var t=null;try{var n=JSON.parse(e.message),r=n.target,i=n.message;t=void 0===r||void 0===i?e:Object.assign(Object.assign({},e),{targetUserIds:r,message:i})}catch(a){t=e}return t});function a(e){return e.sort((function(e,t){return e.localeCompare(t)})).join("_")}function o(e,t){if(null!=e){var n,i=(0,r.Z)(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;if("file"===a.kind){var o=a.getAsFile();a.type.startsWith("image/")?t("image",o):t("file",o)}}}catch(s){i.e(s)}finally{i.f()}}}},1252:function(e,t,n){"use strict";n.d(t,{g:function(){return ot},m:function(){return at},p:function(){return b}});var r=n(3433),i=n(7762),a=n(9439),o=n(2725),s=n(6454);e=n.hmd(e);var c=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96],u={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},l={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},d={sharp:{none:0,sm:0,md:0,lg:0}
2,rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}},p=[-2,-1,0,1,2];function h(e){var t="0",n="0",r="0";return 4==(e=e.trim()).length?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length>6&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),[+t,+n,+r]}var f=function(e,t,n){var r,i,a;if(0==t)r=i=a=n;else{var o=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*a)]},v=function(e,t,n){var r=function(e){return e.toString(16).padStart(2,"0")};return"#".concat(r(e)).concat(r(t)).concat(r(n))},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,r=[],o=h(e),s=(0,a.Z)(o,3),c=function(e,t,n){e/=255,t/=255,n/=255;var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a==o)r=i=0;else{var c=a-o;switch(i=s>.5?c/(2-a-o):c/(a+o),a){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return[r,i,s]}(s[0],s[1],s[2]),u=(0,a.Z)(c,3),l=u[0],d=u[1],m=u[2],g=Math.round(100*m);g>70?n=.8:g>60?n=.9:g<10?n=.075:g<42&&(n=.3);var y=t.findIndex((function(e){return 0===e}));if(-1===y)throw new Error("Invalid reducer provided, it must contain atleast one zero");var b,k=(100-g)/(5-y),_=g/(y+1),w=(0,i.Z)(t);try{for(w.s();!(b=w.n()).done;){var x=b.value,S=f(l,d,(x<0?g+x*_*n:x>0?g+x*k*n:g)/100),E=(0,a.Z)(S,3),T=E[0],P=E[1],C=E[2];r.push(v(T,P,C))}}catch(R){w.e(R)}finally{w.f()}return r},g=function(e){return"string"===typeof e&&7===e.length&&e.startsWith("#")},y=function(e,t){Object.keys(t).forEach((function(n){var r=t[n];if("string"===typeof r)if("text"===n||"text-on-brand"===n){var i=h(r).join(" ");e.style.setProperty("--dyte-colors-".concat(n,"-1000"),"".concat(i)),e.style.setProperty("--dyte-colors-".concat(n,"-900"),"".concat(i," / 0.88")),e.style.setProperty("--dyte-colors-".concat(n,"-800"),"".concat(i," / 0.76")),e.style.setProperty("--dyte-colors-".concat(n,"-700"),"".concat(i," / 0.64")),e.style.setProperty("--dyte-colors-".concat(n,"-600"),"".concat(i," / 0.52"))}else{var a=h(r).join(" ");e.style.setProperty("--dyte-colors-".concat(n),a)}else"object"===typeof r&&Object.keys(r).forEach((function(t){var i=h(r[t]).join(" ");e.style.setProperty("--dyte-colors-".concat(n,"-").concat(t),i)}))}))},b=function(e,t){var n=t.spacingBase,r=t.borderRadius,i=t.borderWidth,a=t.colors,o=t.fontFamily,s=t.googleFont,p=t.theme;if("object"!==typeof e)throw new Error("[dyte-ui-kit] (provideDyteDesignSystem): Passed element is not a valid HTML Element");if("string"===typeof s&&(!function(e){var t,n=[];if(null==document.querySelector("link[data-dyte-font]")){var r=document.createElement("link");r.rel="preconnect",r.setAttribute("data-dyte-font","true"),r.href="https://fonts.googleapis.com";var i=r.cloneNode(!0);i.href="https://fonts.gstatic.com",i.crossOrigin="",n.push(r,i)}var a=document.createElement("link");a.rel="stylesheet",a.setAttribute("data-dyte-font",e),a.href=encodeURI("https://fonts.googleapis.com/css2?family=".concat(e,":wght@").concat([400,500,700].join(";"),"&display=swap")),n.push(a),(t=document.head).append.apply(t,n)}(s),e.style.setProperty("--dyte-font-family",s)),"string"===typeof o&&e.style.setProperty("--dyte-font-family",o),"number"===typeof n&&function(e,t){c.forEach((function(n){e.style.setProperty("--dyte-space-".concat(n),"".concat(n*t,"px"))}))}(e,n),"string"===typeof i&&function(e,t){if(t in l){var n=l[t];Object.keys(n).forEach((function(t){e.style.setProperty("--dyte-border-width-".concat(t),"".concat(n[t],"px"))}))}}(e,i),"string"===typeof r&&function(e,t){if(t in d){var n=d[t];Object.keys(n).forEach((function(t){e.style.setProperty("--dyte-border-radius-".concat(t),"".concat(n[t],"px"))}))}}(e,r),"string"===typeof p){var h=u[p];null!=h&&y(e,h)}"object"===typeof a&&y(e,a)};function k(e,t){return e===t||e!==e&&t!==t}function _(e,t){for(var n=e.length;n--;)if(k(e[n][0],t))return n;return-1}var w=Array.prototype.splice;function x(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])}}x.prototype.clear=function(){this.__data__=[],this.size=0},x.prototype.delete=function(e){var t=this.__data__,n=_(t,e);return!(n<0)&&(n==t.length-1?t.pop():w.call(t,n,1),--this.size,!0)},x.prototype.get=function(e){var t=this.__data__,n=_(t,e);return n<0?void 0:t[n][1]},x.prototype.has=function(e){return _(this.__data__,e)>-1},x.prototype.set=function(e,t){var n=this.__data__,r=_(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var S="[object AsyncFunction]",E="[object Function]",T="[object GeneratorFunction]",P="[object Proxy]";function C(e){if(!(0,s.i)(e))return!1;var t=(0,s.b)(e);return t==E||t==T||t==S||t==P}var R=s.r["__core-js_shared__"],Z=function(){var e=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||"");
2return e?"Symbol(src)_1."+e:""}();var M=Function.prototype.toString;var A=/^\[object .+?Constructor\]$/,I=Function.prototype,O=Object.prototype,L=I.toString,D=O.hasOwnProperty,N=RegExp("^"+L.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function j(e){return!(!(0,s.i)(e)||(t=e,Z&&Z in t))&&(C(e)?N:A).test(function(e){if(null!=e){try{return M.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e));var t}function B(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return j(n)?n:void 0}var U=B(s.r,"Map"),V=B(Object,"create");var F=Object.prototype.hasOwnProperty;var z=Object.prototype.hasOwnProperty;function H(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function q(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function G(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])}}H.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},H.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},H.prototype.get=function(e){var t=this.__data__;if(V){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return F.call(t,e)?t[e]:void 0},H.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:z.call(t,e)},H.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V&&void 0===t?"__lodash_hash_undefined__":t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new H,map:new(U||x),string:new H}},G.prototype.delete=function(e){var t=q(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return q(this,e).get(e)},G.prototype.has=function(e){return q(this,e).has(e)},G.prototype.set=function(e,t){var n=q(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function W(e){var t=this.__data__=new x(e);this.size=t.size}W.prototype.clear=function(){this.__data__=new x,this.size=0},W.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},W.prototype.get=function(e){return this.__data__.get(e)},W.prototype.has=function(e){return this.__data__.has(e)},W.prototype.set=function(e,t){var n=this.__data__;if(n instanceof x){var r=n.__data__;if(!U||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(e,t),this.size=n.size,this};var J=function(){try{var e=B(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();function $(e,t,n){"__proto__"==t&&J?J(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function K(e,t,n){(void 0!==n&&!k(e[t],n)||void 0===n&&!(t in e))&&$(e,t,n)}var Q,Y=function(e,t,n){for(var r=-1,i=Object(e),a=n(e),o=a.length;o--;){var s=a[Q?o:++r];if(!1===t(i[s],s,i))break}return e},X="object"==typeof exports&&exports&&!exports.nodeType&&exports,ee=X&&e&&!e.nodeType&&e,te=ee&&ee.exports===X?s.r.Buffer:void 0,ne=te?te.allocUnsafe:void 0;var re=s.r.Uint8Array;function ie(e,t){var n=t?function(e){var t=new e.constructor(e.byteLength);return new re(t).set(new re(e)),t}(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var ae=Object.create,oe=function(){function e(){}return function(t){if(!(0,s.i)(t))return{};if(ae)return ae(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var se,ce,ue=(se=Object.getPrototypeOf,ce=Object,function(e){return se(ce(e))}),le=Object.prototype;function de(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||le)}function pe(e){return(0,s.a)(e)&&"[object Arguments]"==(0,s.b)(e)}var he=Object.prototype,fe=he.hasOwnProperty,ve=he.propertyIsEnumerable,me=pe(function(){return arguments}())?pe:function(e){return(0,s.a)(e)&&fe.call(e,"callee")&&!ve.call(e,"callee")},ge=Array.isArray,ye=9007199254740991;function be(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=ye}function ke(e){return null!=e&&be(e.length)&&!C(e)}var _e="object"==typeof exports&&exports&&!exports.nodeType&&exports,we=_e&&e&&!e.nodeType&&e,xe=we&&we.exp
2orts===_e?s.r.Buffer:void 0,Se=(xe?xe.isBuffer:void 0)||function(){return!1},Ee="[object Object]",Te=Function.prototype,Pe=Object.prototype,Ce=Te.toString,Re=Pe.hasOwnProperty,Ze=Ce.call(Object);var Me={};Me["[object Float32Array]"]=Me["[object Float64Array]"]=Me["[object Int8Array]"]=Me["[object Int16Array]"]=Me["[object Int32Array]"]=Me["[object Uint8Array]"]=Me["[object Uint8ClampedArray]"]=Me["[object Uint16Array]"]=Me["[object Uint32Array]"]=!0,Me["[object Arguments]"]=Me["[object Array]"]=Me["[object ArrayBuffer]"]=Me["[object Boolean]"]=Me["[object DataView]"]=Me["[object Date]"]=Me["[object Error]"]=Me["[object Function]"]=Me["[object Map]"]=Me["[object Number]"]=Me["[object Object]"]=Me["[object RegExp]"]=Me["[object Set]"]=Me["[object String]"]=Me["[object WeakMap]"]=!1;var Ae="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ie=Ae&&e&&!e.nodeType&&e,Oe=Ie&&Ie.exports===Ae&&s.f.process,Le=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||Oe&&Oe.binding&&Oe.binding("util")}catch(t){}}(),De=Le&&Le.isTypedArray,Ne=De?function(e){return function(t){return e(t)}}(De):function(e){return(0,s.a)(e)&&be(e.length)&&!!Me[(0,s.b)(e)]};function je(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var Be=Object.prototype.hasOwnProperty;function Ue(e,t,n){var r=e[t];Be.call(e,t)&&k(r,n)&&(void 0!==n||t in e)||$(e,t,n)}var Ve=9007199254740991,Fe=/^(?:0|[1-9]\d*)$/;function ze(e,t){var n=typeof e;return!!(t=null==t?Ve:t)&&("number"==n||"symbol"!=n&&Fe.test(e))&&e>-1&&e%1==0&&e<t}var He=Object.prototype.hasOwnProperty;function qe(e,t){var n=ge(e),r=!n&&me(e),i=!n&&!r&&Se(e),a=!n&&!r&&!i&&Ne(e),o=n||r||i||a,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var u in e)!t&&!He.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ze(u,c))||s.push(u);return s}var Ge=Object.prototype.hasOwnProperty;function We(e){if(!(0,s.i)(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=de(e),n=[];for(var r in e)("constructor"!=r||!t&&Ge.call(e,r))&&n.push(r);return n}function Je(e){return ke(e)?qe(e,!0):We(e)}function $e(e){return function(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),i?$(n,s,c):Ue(n,s,c)}return n}(e,Je(e))}function Ke(e,t,n,r,i,a,o){var c=je(e,n),u=je(t,n),l=o.get(u);if(l)K(e,n,l);else{var d,p=a?a(c,u,n+"",e,t,o):void 0,h=void 0===p;if(h){var f=ge(u),v=!f&&Se(u),m=!f&&!v&&Ne(u);p=u,f||v||m?ge(c)?p=c:(d=c,(0,s.a)(d)&&ke(d)?p=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(c):v?(h=!1,p=function(e,t){if(t)return e.slice();var n=e.length,r=ne?ne(n):new e.constructor(n);return e.copy(r),r}(u,!0)):m?(h=!1,p=ie(u,!0)):p=[]):function(e){if(!(0,s.a)(e)||(0,s.b)(e)!=Ee)return!1;var t=ue(e);if(null===t)return!0;var n=Re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ce.call(n)==Ze}(u)||me(u)?(p=c,me(c)?p=$e(c):(0,s.i)(c)&&!C(c)||(p=function(e){return"function"!=typeof e.constructor||de(e)?{}:oe(ue(e))}(u))):h=!1}h&&(o.set(u,p),i(p,u,r,a,o),o.delete(u)),K(e,n,p)}}function Qe(e,t,n,r,i){e!==t&&Y(t,(function(a,o){if(i||(i=new W),(0,s.i)(a))Ke(e,t,o,n,Qe,r,i);else{var c=r?r(je(e,o),a,o+"",e,t,i):void 0;void 0===c&&(c=a),K(e,o,c)}}),Je)}function Ye(e){return e}var Xe=Math.max;var et=J?function(e,t){return J(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ye,tt=Date.now;var nt=function(e){var t=0,n=0;return function(){var r=tt(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(et);function rt(e,t){return nt(function(e,t,n){return t=Xe(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Xe(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),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)}(e,this,s)}}(e,t,Ye),e+"")}var it,at=(it=function(e,t,n){Qe(e,t,n)},rt((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(i=it.length>3&&"function"==typeof i?(r--,i):void 0,a&&function(e,t,n){if(!(0,s.i)(n))return!1;var r=typeof t;return!!("number"==r?ke(n)&&ze(t,n.length):"string"==r&&t in n)&&k(n[t],e)}(t[0],t[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var o=t[n];o&&it(e,o,n,i)}return e}))),ot=function(e){var t,n,i,s,c,u,l,d,h,f,v,y,b,k=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{grid_pagination:!0,settings_toggle:!0},w={showSetupScreen:!0},x=["dyte-stage"],S={},E={},T=!1!==(null===_||void 0===_?void 0:_.settings_toggle),P=!1!==(null===_||void 0===_?void 0:_.grid_pagination);if(null===(t=e.controlBar)||void 0===t?void 0:t.isEnabled){x.push("dyte-controlbar");var C=e.controlBar.elements,R=["dyte-breakout-rooms-toggle","dyte-livestream-toggle"],Z=[],M=["dyte-mic-toggle","dyte-camera-toggle","dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-mute-all-button"].concat((0,r.Z)(T?["dyte-settings-toggle"]:[]),["dyte-leave-button"]);C.fullscreen&&R.push("dyte-fullscreen-toggle"),C.screenshare&&R.push("dyte-screen-share-toggle"),R.push("dyte-recording-toggle"),R.push("dyte-pip-toggle"),C.chat&&Z.push("dyte-chat-toggle"),C.polls&&Z.push("dyte-polls-toggle"),C.participants&&Z.push("dyte-participants-toggle"),C.plugins&&Z.push("dyte-plugins-toggle");var A=R.concat(["dyte-mute-all-button"]).concat(Z);T&&A.push("dyte-settings-toggle");var I=!1;A.length>0&&(I=!0),E={"dyte-controlbar":{states:["activeMoreMenu"],children:["div#controlbar-left","div#controlbar-center","div#controlbar-right"]},"div#controlbar-left":R,"div#controlbar-center":M,"div#controlbar-right":Z,"dyte-controlbar.sm":["div#controlbar-mobile"],"dyte-controlbar.md":["div#controlbar-mobile"],"dyte-controlbar.activeMoreMenu.sm":{add:["div#more-menu"]},"dyte-controlbar.activeMoreMenu.md":{add:["div#more-menu"]},"div#controlbar-mobile":["dyte-mic-toggle","dyte-camera-toggle","dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-leave-button"].concat([I&&"dyte-more-toggle"]),"div#more-menu":A.map((function(e){return[e,{variant:"horizontal"}]}))}}if(null===(n=e.header)||void 0===n?void 0:n.isEnabled){x.unshift("dyte-header");var O=e.header.elements,L=["dyte-recording-indicator","dyte-livestream-indicator"],D=[],N=[];P&&N.push("dyte-grid-pagination"),O.title&&D.push("dyte-meeting-title"),"string"===typeof O.logo&&O.logo.length>0&&(b=O.logo,L.unshift("dyte-logo")),O.participantCount&&N.push("dyte-participant-count","dyte-viewer-count"),O.timer&&N.push("dyte-clock"),S={"dyte-header":["div#header-left","div#header-center","div#header-right"],"dyte-header.sm":{remove:["div#header-center"]},"div#header-left":L,"div#header-center":D,"div#header-right":N,"div#header-left.sm":{remove:["dyte-logo"],prepend:["dyte-meeting-title"]}}}x.push("dyte-participants-audio","dyte-dialog-manager");var j={logo:b};!0===e.isV2?(j=e.designTokens,g(null===(s=null===(i=null===e||void 0===e?void 0:e.designTokens)||void 0===i?void 0:i.colors)||void 0===s?void 0:s.textOnBrand)&&(j.colors["text-on-brand"]=null===(u=null===(c=null===e||void 0===e?void 0:e.designTokens)||void 0===c?void 0:c.colors)||void 0===u?void 0:u.textOnBrand),g(null===(d=null===(l=null===e||void 0===e?void 0:e.designTokens)||void 0===l?void 0:l.colors)||void 0===d?void 0:d.videoBg)&&(j.colors["video-bg"]=null===(f=null===(h=null===e||void 0===e?void 0:e.designTokens)||void 0===h?void 0:h.colors)||void 0===f?void 0:f.videoBg)):null!=e.colors&&(j.colors={},g(e.colors.primary)?j.colors.brand=function(e){var t=m(e,p),n=(0,a.Z)(t,5);return{300:n[0],400:n[1],500:n[2],600:n[3],700:n[4]}}(e.colors.primary):"object"===typeof e.colors.primary&&(j.colors.brand=e.colors.primary),g(e.colors.secondary)?j.colors.background=function(e){var t=m(e,p),n=(0,a.Z)(t,5);return{1e3:n[0],900:n[1],800:n[2],700:n[3],600:n[4]}}(e.colors.secondary):"object"===typeof e.colors.secondary&&(j.colors.background=e.colors.secondary),g(e.colors.text)&&(j.colors.text=e.colors.text),g(e.colors.textPrimary)&&(j.colors["text-on-brand"]=e.colors.textPrimary),g(e.colors.videoBackgroun
2d)&&(j.colors["video-bg"]=e.colors.videoBackground));var B={designTokens:j,styles:{"dyte-header":{display:"grid",height:"48px",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"dyte-header.sm":{display:"grid",gridArea:"header",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"div#header-left":{display:"flex",alignItems:"center",height:"48px",wordBreak:"break-all"},"dyte-logo":{height:"26px"},"div#header-center":{display:"flex",alignItems:"center",justifyContent:"center",wordBreak:"break-all"},"div#header-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-stage":{display:"flex",flex:"1"},"dyte-grid":{flex:"1",height:"auto"},"dyte-controlbar":{display:"grid",height:"76px",gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"1fr",alignItems:"center",padding:"8px"},"dyte-controlbar.sm":{display:"flex",position:"relative",backgroundColor:"var(--dyte-colors-background-1000, #000)"},"dyte-controlbar.md":{display:"flex",position:"relative",backgroundColor:"var(--dyte-colors-background-1000, #000)"},"div#controlbar-left":{display:"flex",alignItems:"center"},"div#controlbar-center":{display:"flex",alignItems:"center",justifyContent:"center"},"div#controlbar-mobile":{display:"flex",flex:"1",alignItems:"center",justifyContent:"center",zIndex:"10000"},"div#controlbar-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-settings":{width:"720px",height:"480px"},"div#more-menu":{position:"absolute",boxSizing:"border-box",top:"0",left:"0",width:"100%",transform:"translateY(-100%)",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))",padding:"16px 12px",borderRadius:"18px 18px 0 0",zIndex:"400"},"div#setupcontrols-media":{position:"absolute",bottom:"8px",right:"8px",display:"flex"},"div#setupcontrols-settings":{position:"absolute",top:"8px",right:"8px"},"dyte-meeting-title.sm":{marginLeft:"0"},"dyte-clock":{marginRight:"0"}},root:Object.assign(Object.assign(Object.assign({"dyte-meeting":{state:"meeting",states:["activeSidebar"]},"dyte-meeting[meeting=idle]":["dyte-idle-screen"],"dyte-meeting[meeting=waiting]":["dyte-waiting-screen"],"dyte-meeting[meeting=setup]":["dyte-setup-screen","dyte-dialog-manager"],"dyte-meeting[meeting=joined]":x,"dyte-meeting[meeting=joined].activeSidebar.sm":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=joined].activeSidebar.md":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=ended]":["dyte-ended-screen"]},S),E),{"dyte-stage":{states:["activeSidebar"],children:["dyte-grid","dyte-notifications"]},"dyte-stage.activeSidebar":{add:[["dyte-sidebar",{view:"sidebar"}]]},"dyte-stage.activeSidebar.sm":{remove:["dyte-sidebar"]},"dyte-grid":{states:["activeScreenShare","activePlugin","activeSpotlight"],children:["dyte-simple-grid"]},"dyte-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-grid.activeScreenShare":["dyte-mixed-grid"],"dyte-grid.activePlugin":["dyte-mixed-grid"],"dyte-grid.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-mixed-grid":{states:["activeSpotlight"],children:["dyte-simple-grid"]},"dyte-mixed-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-participant-tile":{state:"meeting",children:["dyte-name-tag","dyte-avatar","dyte-network-indicator"]},"dyte-participant-setup":["dyte-avatar","div#setupcontrols-media"],"dyte-participant-tile[meeting=setup]":["dyte-avatar","div#setupcontrols-media"].concat((0,r.Z)(T?["div#setupcontrols-settings"]:[])),"div#setupcontrols-media":[["dyte-mic-toggle",{size:"sm"}],["dyte-camera-toggle",{size:"sm"}]],"div#setupcontrols-settings":[["dyte-settings-toggle",{size:"sm"}]],"dyte-screenshare-view":["dyte-name-tag","dyte-network-indicator"],"dyte-name-tag":[["dyte-audio-visualizer",{slot:"start"}]]}),config:{notification_sounds:{participant_left:!1},participant_joined_sound_notification_limit:3,participant_chat_message_sound_notification_limit:10,videoFit:"cover"}};return B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.d,n=Object.assign({},t);return at(n,e),n}(k,B),w.showSetupScreen=null===(y=null===(v=e.setupScreen)||void 0===v?void 0:v.isEnabled)||void 0===y||y,{config:B,data:w}}},5855:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});var r
vendor: 34,486 bytes, line 2
2={people:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 13.999 13 14a2 2 0 0 1 1.995 1.85L15 16v1.5C14.999 21 11.284 22 8.5 22c-2.722 0-6.335-.956-6.495-4.27L2 17.5v-1.501c0-1.054.816-1.918 1.85-1.995L4 14ZM15.22 14H20c1.054 0 1.918.816 1.994 1.85L22 16v1c-.001 3.062-2.858 4-5 4a7.16 7.16 0 0 1-2.14-.322c.336-.386.607-.827.802-1.327A6.19 6.19 0 0 0 17 19.5l.267-.006c.985-.043 3.086-.363 3.226-2.289L20.5 17v-1a.501.501 0 0 0-.41-.492L20 15.5h-4.051a2.957 2.957 0 0 0-.595-1.34L15.22 14H20h-4.78ZM4 15.499l-.1.01a.51.51 0 0 0-.254.136.506.506 0 0 0-.136.253l-.01.101V17.5c0 1.009.45 1.722 1.417 2.242.826.445 2.003.714 3.266.753l.317.005.317-.005c1.263-.039 2.439-.308 3.266-.753.906-.488 1.359-1.145 1.412-2.057l.005-.186V16a.501.501 0 0 0-.41-.492L13 15.5l-9-.001ZM8.5 3a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm9 2a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm-9-.5c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3Zm9 2c-1.103 0-2 .897-2 2s.897 2 2 2 2-.897 2-2-.897-2-2-2Z" fill="currentColor"/></svg>',people_checked:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 29"><path fill="currentColor" d="M14.58 15.333H2.833a2.667 2.667 0 0 0-2.666 2.666v2l.006.307c.214 4.419 5.031 5.693 8.66 5.693 1.374 0 2.92-.182 4.32-.649a8.53 8.53 0 0 1-.717-1.87c-.93.298-2.027.478-3.18.513l-.423.006-.422-.006c-1.684-.052-3.254-.411-4.355-1.004-1.29-.694-1.89-1.644-1.89-2.99v-2.001l.014-.135a.675.675 0 0 1 .181-.337.68.68 0 0 1 .338-.181l.134-.014h10.31a8.71 8.71 0 0 1 1.436-1.998h.001Zm.253-8.667a6 6 0 1 0-12 0 6 6 0 0 0 12 0Zm-10 0c0-2.205 1.795-4 4-4 2.206 0 4 1.795 4 4s-1.794 4-4 4c-2.205 0-4-1.795-4-4ZM25.5 7.999a4.667 4.667 0 1 0-9.333 0A4.667 4.667 0 0 0 25.5 8Zm-7.333 0a2.67 2.67 0 0 1 2.666-2.666A2.67 2.67 0 0 1 23.5 7.999a2.67 2.67 0 0 1-2.667 2.667 2.67 2.67 0 0 1-2.666-2.667Zm10 13.334a7.333 7.333 0 1 1-14.667 0 7.333 7.333 0 0 1 14.667 0Zm-2.862-3.139a.666.666 0 0 0-.944 0l-4.86 4.863-2.196-2.196a.667.667 0 1 0-.944.944l2.667 2.666a.666.666 0 0 0 .944 0l5.333-5.333a.666.666 0 0 0 0-.944Z"/></svg>',chat:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10a9.96 9.96 0 0 1-4.587-1.112l-3.826 1.067a1.25 1.25 0 0 1-1.54-1.54l1.068-3.823A9.96 9.96 0 0 1 2 12C2 6.477 6.477 2 12 2Zm0 1.5A8.5 8.5 0 0 0 3.5 12c0 1.47.373 2.883 1.073 4.137l.15.27-1.112 3.984 3.987-1.112.27.15A8.5 8.5 0 1 0 12 3.5ZM8.75 13h4.498a.75.75 0 0 1 .102 1.493l-.102.007H8.75a.75.75 0 0 1-.102-1.493L8.75 13h4.498H8.75Zm0-3.5h6.505a.75.75 0 0 1 .101 1.493l-.101.007H8.75a.75.75 0 0 1-.102-1.493L8.75 9.5h6.505H8.75Z" fill="currentColor"/></svg>',poll:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.752 2a2.752 2.752 0 0 1 2.752 2.751V19.25a2.752 2.752 0 1 1-5.504 0V4.75A2.752 2.752 0 0 1 11.752 2Zm7 5a2.752 2.752 0 0 1 2.752 2.751v9.499a2.752 2.752 0 1 1-5.504 0V9.75A2.752 2.752 0 0 1 18.752 7Zm-14 5a2.752 2.752 0 0 1 2.752 2.751v4.499a2.752 2.752 0 0 1-5.504 0V14.75A2.752 2.752 0 0 1 4.752 12Zm7-8.5c-.692 0-1.252.56-1.252 1.251V19.25a1.252 1.252 0 0 0 2.504 0V4.75c0-.691-.56-1.251-1.252-1.251Zm7 5c-.691 0-1.252.56-1.252 1.251v9.499a1.252 1.252 0 0 0 2.504 0V9.75c0-.691-.56-1.251-1.252-1.251Zm-14 5c-.692 0-1.252.56-1.252 1.251v4.499a1.252 1.252 0 1 0 2.504 0V14.75c0-.691-.56-1.252-1.252-1.252Z" fill="currentColor"/></svg>',participants:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.754 10c.966 0 1.75.784 1.75 1.75v4.749a4.501 4.501 0 0 1-9.002 0V11.75c0-.966.783-1.75 1.75-1.75h5.502Zm0 1.5H9.252a.25.25 0 0 0-.25.25v4.749a3.001 3.001 0 0 0 6.002 0V11.75a.25.25 0 0 0-.25-.25ZM3.75 10h3.381a2.738 2.738 0 0 0-.618 1.5H3.75a.25.25 0 0 0-.25.25v3.249a2.501 2.501 0 0 0 3.082 2.433c.085.504.24.985.453 1.432A4.001 4.001 0 0 1 2 14.999V11.75c0-.966.784-1.75 1.75-1.75Zm13.125 0h3.375c.966 0 1.75.784 1.75 1.75V15a4 4 0 0 1-5.03 3.866c.214-.448.369-.929.455-1.433A2.5 2.5 0 0 0 20.5 15v-3.25a.25.25 0 0 0-.25-.25h-2.757a2.738 2.738 0 0 0-.618-1.5ZM12 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm6.5 1a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm-13 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm6.5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm6.5 1a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-13 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" fill="currentColor"/></svg>',rocket:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M9.35 20.45 14.65 22.7Q15.55 20.9 16.575 19.15Q17.6 17.4 18.75 15.8L14.8 15Q14.8 15 14.8 15Q14.8 15 14.8 15ZM17.05 24.5 23.7 31.15Q26.55 29.85 29.05 28.2Q31.55 26.55 33.1 25Q37.15 20.95 39.05 16.7Q40.95 12.45 41.1 7.1Q35.75 7.25 31.5 9.15Q27.25 11.05 23.2 15.1Q21.65 16.65 20 19.15Q18.35 21.65 17.05 24.5ZM28.5 19.7Q27.5 18.7 27.5 17.225Q27.5 15.75 28.5 14.75Q29.5 13.75 30.975 13.75Q32.45 13.75 33.45 14.75Q34.45 15.75 34.45 17.225Q34.45 18.7 33.45 19.7Q32.45 20.7 30.975 20.7Q29.5 20.7 28.5 19.7ZM27.75 38.85 33.2 33.4Q33.2 33.4 33.2 33.4Q33.2 33.4 33.2 33.4L32.4 29.45Q30.8 30.6 29.05 31.625Q27.3 32.65 25.5 33.55ZM44.05 4.15Q44.5 10.95 42.35 16.55Q40.2 22.15 35.25 27.1Q35.2 27.15 35.15 27.2Q35.1 27.25 35.05 27.3L36.15 32.8Q36.3 33.55 36.075 34.25Q35.85 34.95 35.3 35.5L26.75 44.1L22.5 34.2L14 25.7L4.1 21.45L12.7 12.9Q13.25 12.35 13.95 12.125Q14.65 11.9 15.4 12.05L20.9 13.15Q20.95 13.1 21 13.075Q21.05 13.05 21.1 13Q26.05 8.05 31.65 5.875Q37.25 3.7 44.05 4.15ZM7.45 31.75Q9.2 30 11.725 29.975Q14.25 29.95 16 31.7Q17.75 33.45 17.725 35.975Q17.7 38.5 15.95 40.25Q14.65 41.55 11.925 42.4Q9.2 43.25 3.75 44Q4.5 38.55 5.325 35.8Q6.15 33.05 7.45 31.75ZM9.55 33.9Q8.85 34.65 8.3 36.25Q7.75 37.85 7.35 40.35Q9.85 39.95 11.45 39.4Q13.05 38.85 13.8 38.15Q14.75 37.3 14.775 36.025Q14.8 34.75 13.9 33.8Q12.95 32.9 11.675 32.925Q10.4 32.95 9.55 33.9Z" fill="currentColor" /></svg>',call_end:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m21.903 13.202-.191.816a2.75 2.75 0 0 1-2.955 2.107l-1.755-.178A2.75 2.75 0 0 1 14.6 13.83l-.389-1.686a.25.25 0 0 0-.113-.157c-.321-.197-1.034-.32-2.098-.32-.786 0-1.386.067-1.786.189-.14.043-.238.085-.301.116l-.09.048-.015.04-.409 1.77A2.75 2.75 0 0 1 7 15.948l-1.746.177A2.75 2.75 0 0 1 2.3 14.03l-.196-.817a3.75 3.75 0 0 1 1.13-3.651C5.134 7.839 8.064 7 12 7c3.943 0 6.875.842 8.776 2.57a3.75 3.75 0 0 1 1.172 3.41l-.045.222Zm-1.426-.514a2.25 2.25 0 0 0-.71-2.009C18.184 9.241 15.602 8.5 12 8.5c-3.598 0-6.177.739-7.76 2.172a2.25 2.25 0 0 0-.677 2.19l.196.818a1.25 1.25 0 0 0 1.342.953l1.746-.178a1.25 1.25 0 0 0 1.09-.962l.423-1.82.043-.136c.376-.998 1.591-1.37 3.597-1.37 1.318 0 2.265.164 2.88.54.401.245.687.642.793 1.1l.389 1.685c.12.522.56.909 1.092.963l1.754.178a1.25 1.25 0 0 0 1.343-.958l.192-.816.034-.171Z" fill="currentColor"/></svg>',share:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 2.498a3.502 3.502 0 1 1-2.597 5.851l-4.558 2.604a3.5 3.5 0 0 1 0 2.093l4.557 2.606a3.502 3.502 0 1 1-.745 1.302L9.1 14.347a3.502 3.502 0 1 1 0-4.698l4.557-2.604A3.502 3.502 0 0 1 17 2.498Zm0 13.5a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Zm-10.498-6a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Zm10.498-6a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Z" fill="currentColor"/></svg>',mic_on:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 11a.75.75 0 0 1 .743.648l.007.102v.5a6.75 6.75 0 0 1-6.249 6.732l-.001 2.268a.75.75 0 0 1-1.493.102l-.007-.102v-2.268a6.75 6.75 0 0 1-6.246-6.496L5 12.25v-.5a.75.75 0 0 1 1.493-.102l.007.102v.5a5.25 5.25 0 0 0 5.034 5.246l.216.004h.5a5.25 5.25 0 0 0 5.246-5.034l.004-.216v-.5a.75.75 0 0 1 .75-.75ZM12 2a4 4 0 0 1 4 4v6a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4Zm0 1.5A2.5 2.5 0 0 0 9.5 6v6a2.5 2.5 0 0 0 5 0V6A2.5 2.5 0 0 0 12 3.5Z" fill="currentColor"/></svg>',mic_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06L8 9.06V12a4 4 0 0 0 6.248 3.309l1.146 1.146A5.227 5.227 0 0 1 12.25 17.5h-.5l-.216-.004A5.25 5.25 0 0 1 6.5 12.25v-.5l-.007-.102A.75.75 0 0 0 5 11.75v.5l.004.236a6.75 6.75 0 0 0 6.246 6.496v2.268l.007.102a.75.75 0 0 0 1.493-.102l.001-2.268a6.718 6.718 0 0 0 3.712-1.458l4.256 4.256a.75.75 0 0 0 1.061-1.06L3.28 2.22Zm9.876 11.997A2.5 2.5 0 0 1 9.5 12v-1.44l3.656 3.657ZM14.5 6v5.318l1.43 1.43c.046-.242.07-.492.07-.748V6a4 4 0 0 0-7.862-1.044L9.5 6.318V6a2.5 2.5 0 0 1 5 0ZM17.196 14.014l1.146 1.146A6.725 6.725 0 0 0 19 12.25v-.5l-.007-.102a.75.75 0 0 0-1.493.102v.5l-.004.216a5.233 5.233 0 0 1-.3 1.548Z" fill="currentColor"/></svg>',video_on:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.75 4.5A3.25 3.25 0 0 1 17 7.75v.173l3.864-2.318A.75.75 0 0 1 22 6.248V17.75a.75.75 0 0 1-1.136.643L17 16.075v.175a3.25 3.25 0 0 1-3.25 3.25h-8.5A3.25 3.25 0 0 1 2 16.25v-8.5A3.25 3.25 0 0 1 5.25 4.5h8.5Zm0 1.5h-8.5A1.75 1.75 0 0 0 3.5 7.75v8.5c0 .966.784 1.75 1.75 1.75h8.5a1.75 1.75 0 0 0 1.75-1.75v-8.5A1.75 1.75 0 0 0 13.75 6Zm6.75 1.573L17 9.674v4.651l3.5 2.1V7.573Z" fill="currentColor"/></svg>',video_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06l1.567 1.567A3.25 3.25 0 0 0 2 7.75v8.5a3.25 3.25 0 0 0 3.25 3.25h8.5a3.25 3.25 0 0 0 2.903-1.786l4.066 4.067a.75.75 0 0 0 1.061-1.061L3.28 2.22Zm12.196 14.317A1.75 1.75 0 0 1 13.75 18h-8.5a1.75 1.75 0 0 1-1.75-1.75v-8.5c0-.869.633-1.59 1.463-1.727l10.514 10.514ZM15.5 12.318V7.75A1.75 1.75 0 0 0 13.75 6H9.182l-1.5-1.5h6.068A3.25 3.25 0 0 1 17 7.75v.173l3.864-2.318A.75.75 0 0 1 22 6.248V17.75c0 .301-.17.543-.403.665L20.5 17.318V7.573L17 9.674v4.144l-1.5-1.5Z" fill="currentColor"/></svg>',share_screen_start:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 6.25A2.25 2.25 0 0 1 4.25 4h15.5A2.25 2.25 0 0 1 22 6.25v11.5A2.25 2.25 0 0 1 19.75 20H4.25A2.25 2.25 0 0 1 2 17.75V6.25Zm2.25-.75a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h15.5a.75.75 0 0 0 .75-.75V6.25a.75.75 0 0 0-.75-.75H4.25Z"/><path d="M12 7.245a.75.75 0 0 1 .53.22l3.255 3.255a.75.75 0 1 1-1.06 1.06L12.75 9.806v6.447a.75.75 0 0 1-1.5 0V9.808L9.28 11.78a.75.75 0 1 1-1.06-1.06l3.25-3.254a.75.75 0 0 1 .53-.22Z"/></svg>',share_screen_stop:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 6.25A2.25 2.25 0 0 1 4.25 4h15.5A2.25 2.25 0 0 1 22 6.25v11.5A2.25 2.25 0 0 1 19.75 20H4.25A2.25 2.25 0 0 1 2 17.75V6.25Zm2.25-.75a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h15.5a.75.75 0 0 0 .75-.75V6.25a.75.75 0 0 0-.75-.75H4.25Z"/><path d="M8.22 8.215a.75.75 0 0 1 1.06 0l2.72 2.72 2.725-2.716a.75.75 0 0 1 1.06 1.062l-2.724 2.715 2.724 2.724a.75.75 0 1 1-1.06 1.06L12 13.057 9.28 15.78a.75.75 0 0 1-1.06-1.06l2.72-2.724-2.72-2.72a.75.75 0 0 1 0-1.06Z"/></svg>',share_screen_person:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 7.25A3.25 3.25 0 0 1 5.25 4h13.5A3.25 3.25 0 0 1 22 7.25V13h-.258a3.74 3.74 0 0 0-1.242-2.545V7.25a1.75 1.75 0 0 0-1.75-1.75H5.25A1.75 1.75 0 0 0 3.5 7.25v9.5c0 .966.784 1.75 1.75 1.75H12v.5c0 .34.04.674.118 1H5.25A3.25 3.25 0 0 1 2 16.75v-9.5ZM21.5 17a1.5 1.5 0 0 1 1.5 1.5v.5c0 1.971-1.86 4-5 4-3.14 0-5-2.029-5-4v-.5a1.5 1.5 0 0 1 1.5-1.5h7ZM18 10.5a2.75 2.75 0 1 1 0 5.5 2.75 2.75 0 0 1 0-5.5Z" fill="currentColor"/></svg>',clock:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2Zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333ZM11.25 6a.75.75 0 0 1 .743.648L12 6.75V12h3.25a.75.75 0 0 1 .102 1.493l-.102.007h-4a.75.75 0 0 1-.743-.648l-.007-.102v-6a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',dismiss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z" fill="currentColor"/></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.694 12 2.299 3.272c-.236-.607.356-1.188.942-.982l.093.04 18 9a.75.75 0 0 1 .097 1.283l-.097.058-18 9a.75.75 0 0 1-1.065-.847l.03-.096L5.694 12 2.299 3.272 5.694 12ZM4.402 4.54l2.61 6.71h6.627a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.649.743l-.101.007H7.01l-2.609 6.71L19.322 12 4.401 4.54Z" fill="currentColor"/></svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 2.75a7.25 7.25 0 0 1 5.63 11.819l4.9 4.9a.75.75 0 0 1-.976 1.134l-.084-.073-4.901-4.9A7.25 7.25 0 1 1 10 2.75Zm0 1.5a5.75 5.75 0 1 0 0 11.5 5.75 5.75 0 0 0 0-11.5Z" fill="currentColor"/</svg>',more_vertical:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7.75a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM12 13.75a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM10.25 18a1.75 1.75 0 1 0 3.5 0 1.75 1.75 0 0 0-3.5 0Z" fill="currentColor"/></svg>',chevron_down:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.22 8.47a.75.75 0 0 1 1.06 0L12 15.19l6.72-6.72a.75.75 0 1 1 1.06 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L4.22 9.53a.75.75 0 0 1 0-1.06Z" fill="currentColor"/></svg>',chevron_up:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.22 15.53a.75.75 0 0 0 1.06 0L12 8.81l6.72 6.72a.75.75 0 1 0 1.06-1.06l-7.25-7.25a.75.75 0 0 0-1.06 0l-7.25 7.25a.75.75 0 0 0 0 1.06Z" fill="currentColor"/></svg>',chevron_left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.53 4.22a.75.75 0 0 1 0 1.06L8.81 12l6.72 6.72a.75.75 0 1 1-1.06 1.06l-7.25-7.25a.75.75 0 0 1 0-1.06l7.25-7.25a.75.75 0 0 1 1.06 0Z" fill="currentColor"/></svg>',chevron_right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.47 4.22a.75.75 0 0 0 0 1.06L15.19 12l-6.72 6.72a.75.75 0 1 0 1.06 1.06l7.25-7.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0Z" fill="currentColor"/></svg>',settings:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.012 2.25c.734.008 1.465.093 2.182.253a.75.75 0 0 1 .582.649l.17 1.527a1.384 1.384 0 0 0 1.927 1.116l1.401-.615a.75.75 0 0 1 .85.174 9.792 9.792 0 0 1 2.204 3.792.75.75 0 0 1-.271.825l-1.242.916a1.381 1.381 0 0 0 0 2.226l1.243.915a.75.75 0 0 1 .272.826 9.797 9.797 0 0 1-2.204 3.792.75.75 0 0 1-.848.175l-1.407-.617a1.38 1.38 0 0 0-1.926 1.114l-.169 1.526a.75.75 0 0 1-.572.647 9.518 9.518 0 0 1-4.406 0 .75.75 0 0 1-.572-.647l-.168-1.524a1.382 1.382 0 0 0-1.926-1.11l-1.406.616a.75.75 0 0 1-.849-.175 9.798 9.798 0 0 1-2.204-3.796.75.75 0 0 1 .272-.826l1.243-.916a1.38 1.38 0 0 0 0-2.226l-1.243-.914a.75.75 0 0 1-.271-.826 9.793 9.793 0 0 1 2.204-3.792.75.75 0 0 1 .85-.174l1.4.615a1.387 1.387 0 0 0 1.93-1.118l.17-1.526a.75.75 0 0 1 .583-.65c.717-.159 1.45-.243 2.201-.252Zm0 1.5a9.135 9.135 0 0 0-1.354.117l-.109.977A2.886 2.886 0 0 1 6.525 7.17l-.898-.394a8.293 8.293 0 0 0-1.348 2.317l.798.587a2.881 2.881 0 0 1 0 4.643l-.799.588c.32.842.776 1.626 1.348 2.322l.905-.397a2.882 2.882 0 0 1 4.017 2.318l.11.984c.889.15 1.798.15 2.687 0l.11-.984a2.881 2.881 0 0 1 4.018-2.322l.905.396a8.296 8.296 0 0 0 1.347-2.318l-.798-.588a2.881 2.881 0 0 1 0-4.643l.796-.587a8.293 8.293 0 0 0-1.348-2.317l-.896.393a2.884 2.884 0 0 1-4.023-2.324l-.11-.976a8.988 8.988 0 0 0-1.333-.117ZM12 8.25a3.75 3.75 0 1 1 0 7.5 3.75 3.75 0 0 1 0-7.5Zm0 1.5a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Z" fill="currentColor"/></svg>',wifi:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.745 10.75a8.291 8.291 0 0 1 1.492 2.07.75.75 0 1 1-1.335.683 6.798 6.798 0 0 0-1.218-1.692 6.562 6.562 0 0 0-10.493 1.673.75.75 0 1 1-1.339-.677 8.062 8.062 0 0 1 12.893-2.057Zm-2.102 3.07c.448.447.816.997 1.072 1.582a.75.75 0 1 1-1.373.602 3.72 3.72 0 0 0-.76-1.124 3.592 3.592 0 0 0-5.08 0c-.31.31-.562.689-.746 1.11a.75.75 0 1 1-1.375-.6 5.11 5.11 0 0 1 1.061-1.57 5.092 5.092 0 0 1 7.201 0Zm4.805-5.541c.51.509.99 1.09 1.409 1.697a.75.75 0 0 1-1.235.852 10.822 10.822 0 0 0-1.234-1.489c-4.08-4.08-10.695-4.08-14.776 0-.421.422-.84.934-1.222 1.484a.75.75 0 0 1-1.232-.855c.43-.62.905-1.2 1.394-1.69 4.666-4.665 12.23-4.665 16.896 0Zm-7.387 8.16a1.5 1.5 0 1 1-2.122 2.122 1.5 1.5 0 0 1 2.122-2.122Z" fill="currentColor"/></svg>',speaker:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 4.25c0-1.079-1.274-1.65-2.08-.934L8.427 7.309a.75.75 0 0 1-.498.19H4.25A2.25 2.25 0 0 0 2 9.749v4.497a2.25 2.25 0 0 0 2.25 2.25h3.68a.75.75 0 0 1 .498.19l4.491 3.994c.806.716 2.081.144 2.081-.934V4.25ZM9.425 8.43 13.5 4.807v14.382l-4.075-3.624a2.25 2.25 0 0 0-1.495-.569H4.25a.75.75 0 0 1-.75-.75V9.75a.75.75 0 0 1 .75-.75h3.68a2.25 2.25 0 0 0 1.495-.569ZM18.992 5.897a.75.75 0 0 1 1.049.157A9.959 9.959 0 0 1 22 12a9.96 9.96 0 0 1-1.96 5.946.75.75 0 0 1-1.205-.892A8.459 8.459 0 0 0 20.5 12a8.459 8.459 0 0 0-1.665-5.054.75.75 0 0 1 .157-1.049Z" /><path d="M17.143 8.37a.75.75 0 0 1 1.017.302c.536.99.84 2.125.84 3.328a6.973 6.973 0 0 1-.84 3.328.75.75 0 0 1-1.32-.714c.42-.777.66-1.666.66-2.614s-.24-1.837-.66-2.614a.75.75 0 0 1 .303-1.017Z"/></svg>',speaker_off:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06L6.438 7.5H4.25A2.25 2.25 0 0 0 2 9.749v4.497a2.25 2.25 0 0 0 2.25 2.25h3.68a.75.75 0 0 1 .498.19l4.491 3.994c.806.716 2.081.144 2.081-.934V16.06l5.72 5.72a.75.75 0 0 0 1.06-1.061L3.28 2.22ZM13.5 14.56v4.629l-4.075-3.624a2.25 2.25 0 0 0-1.495-.569H4.25a.75.75 0 0 1-.75-.75V9.75a.75.75 0 0 1 .75-.75h3.688L13.5 14.56ZM13.5 4.807v5.511l1.5 1.5V4.25c0-1.079-1.274-1.65-2.08-.934l-3.4 3.022 1.063 1.063L13.5 4.807ZM17.141 13.96l1.138 1.137A6.974 6.974 0 0 0 19 12a6.973 6.973 0 0 0-.84-3.328.75.75 0 0 0-1.32.714c.42.777.66 1.666.66 2.614 0 .691-.127 1.351-.359 1.96ZM19.388 16.206l1.093 1.094A9.955 9.955 0 0 0 22 12a9.959 9.959 0 0 0-1.96-5.946.75.75 0 0 0-1.205.892A8.46 8.46 0 0 1 20.5 12a8.458 8.458 0 0 1-1.112 4.206Z"/></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 20.5a.75.75 0 1 1 0 1.5l-13 .004a.75.75 0 1 1 0-1.5l13-.004ZM11.648 2.012l.102-.007a.75.75 0 0 1 .743.648l.007.102-.001 13.685 3.722-3.72a.75.75 0 0 1 .976-.073l.085.073a.75.75 0 0 1 .072.976l-.073.084-4.997 4.997a.75.75 0 0 1-.976.073l-.085-.073-5.003-4.996a.75.75 0 0 1 .976-1.134l.084.072 3.719 3.714L11 2.755a.75.75 0 0 1 .648-.743l.102-.007-.102.007Z" fill="currentColor"/></svg>',full_screen_maximize:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.5 5.75c0-.69.56-1.25 1.25-1.25h2a.75.75 0 0 0 0-1.5h-2A2.75 2.75 0 0 0 3 5.75v2a.75.75 0 0 0 1.5 0v-2ZM4.5 18.25c0 .69.56 1.25 1.25 1.25h2a.75.75 0 0 1 0 1.5h-2A2.75 2.75 0 0 1 3 18.25v-2a.75.75 0 0 1 1.5 0v2ZM18.25 4.5c.69 0 1.25.56 1.25 1.25v2a.75.75 0 0 0 1.5 0v-2A2.75 2.75 0 0 0 18.25 3h-2a.75.75 0 0 0 0 1.5h2ZM19.5 18.25c0 .69-.56 1.25-1.25 1.25h-2a.75.75 0 0 0 0 1.5h2A2.75 2.75 0 0 0 21 18.25v-2a.75.75 0 0 0-1.5 0v2Z" fill="currentColor"/></svg>',full_screen_minimize:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.5 3.75a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 0 0 1.5h2.5A2.25 2.25 0 0 0 8.5 6.25v-2.5ZM8.5 20.25a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 0-.75-.75h-2.5a.75.75 0 0 1 0-1.5h2.5a2.25 2.25 0 0 1 2.25 2.25v2.5ZM16.25 3a.75.75 0 0 0-.75.75v2.5a2.25 2.25 0 0 0 2.25 2.25h2.5a.75.75 0 0 0 0-1.5h-2.5a.75.75 0 0 1-.75-.75v-2.5a.75.75 0 0 0-.75-.75ZM15.5 20.25a.75.75 0 0 0 1.5 0v-2.5a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 0 0-1.5h-2.5a2.25 2.25 0 0 0-2.25 2.25v2.5Z" fill="currentColor"/></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.503 4.627 5.5 6.75v10.504a3.25 3.25 0 0 0 3.25 3.25h8.616a2.251 2.251 0 0 1-2.122 1.5H8.75A4.75 4.75 0 0 1 4 17.254V6.75c0-.98.627-1.815 1.503-2.123ZM17.75 2A2.25 2.25 0 0 1 20 4.25v13a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-13A2.25 2.25 0 0 1 8.75 2h9Zm0 1.5h-9a.75.75 0 0 0-.75.75v13c0 .414.336.75.75.75h9a.75.75 0 0 0 .75-.75v-13a.75.75 0 0 0-.75-.75Z" fill="currentColor"/></svg>',attach:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.772 3.743a6 6 0 0 1 8.66 8.302l-.19.197-8.8 8.798-.036.03a3.723 3.723 0 0 1-5.489-4.973.764.764 0 0 1 .085-.13l.054-.06.086-.088.142-.148.002.003 7.436-7.454a.75.75 0 0 1 .977-.074l.084.073a.75.75 0 0 1 .074.976l-.073.084-7.594 7.613a2.23 2.23 0 0 0 3.174 3.106l8.832-8.83A4.502 4.502 0 0 0 13 4.644l-.168.16-.013.014-9.536 9.536a.75.75 0 0 1-1.133-.977l.072-.084 9.549-9.55h.002Z" fill="currentColor"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.75 3A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3h11.5Zm.58 16.401-5.805-5.686a.75.75 0 0 0-.966-.071l-.084.07-5.807 5.687c.182.064.378.099.582.099h11.5c.203 0 .399-.035.58-.099l-5.805-5.686L18.33 19.4ZM17.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v11.5c0 .208.036.408.103.594l5.823-5.701a2.25 2.25 0 0 1 3.02-.116l.128.116 5.822 5.702c.067-.186.104-.386.104-.595V6.25a1.75 1.75 0 0 0-1.75-1.75Zm-2.498 2a2.252 2.252 0 1 1 0 4.504 2.252 2.252 0 0 1 0-4.504Zm0 1.5a.752.752 0 1 0 0 1.504.752.752 0 0 0 0-1.504Z" fill="currentColor"/></svg>',emoji_multiple:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.5 2a6.503 6.503 0 0 1 6.312 4.943c-.515.01-1.02.068-1.506.171a5 5 0 1 0-6.191 6.191 8.053 8.053 0 0 0-.172 1.507A6.5 6.5 0 0 1 8.5 2Zm.16 8.006c.355-.451.759-.864 1.202-1.23a3.5 3.5 0 0 0-4.022.95.75.75 0 1 0 1.14.974 2 2 0 0 1 1.68-.694ZM7.5 6.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm5.458 2.042a.75.75 0 0 1 .082 1.058 4 4 0 0 1-6.075.005.75.75 0 0 1 1.138-.977 2.499 2.499 0 0 0 3.797-.003.75.75 0 0 1 1.058-.083ZM17.5 14.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM15 22a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0-1.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11Z" fill="currentColor"/></svg>',image_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06l1.263 1.264A3.235 3.235 0 0 0 3 6.25v11.5A3.25 3.25 0 0 0 6.25 21h11.5c.626 0 1.21-.177 1.706-.483l1.263 1.264a.75.75 0 0 0 1.061-1.061L3.28 2.22Zm8.788 10.909 6.206 6.206.056.066a1.746 1.746 0 0 1-.58.099H6.25c-.204 0-.4-.035-.582-.099l5.807-5.686.593-.586Zm-.95-.95a2.245 2.245 0 0 0-.692.464l-5.823 5.7a1.747 1.747 0 0 1-.103-.593V6.25c0-.206.036-.404.101-.588l6.518 6.518ZM19.5 16.318V6.25a1.75 1.75 0 0 0-1.75-1.75H7.682L6.182 3H17.75A3.25 3.25 0 0 1 21 6.25v11.568l-1.5-1.5Z" fill="currentColor"/><path d="M15.252 6.5a2.252 2.252 0 1 1 0 4.504 2.252 2.252 0 0 1 0-4.504Zm0 1.5a.752.752 0 1 0 0 1.504.752.752 0 0 0 0-1.504Z" fill="currentColor"/></svg>',disconnected:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l3.364 3.365a11.99 11.99 0 0 0-2.033 1.634c-.49.489-.964 1.069-1.394 1.689a.75.75 0 1 0 1.233.855c.381-.55.8-1.062 1.222-1.484a10.468 10.468 0 0 1 2.063-1.604l1.591 1.592a8.062 8.062 0 0 0-1.923 1.424c-.61.61-1.109 1.3-1.491 2.056a.75.75 0 1 0 1.338.677 6.51 6.51 0 0 1 1.214-1.673 6.546 6.546 0 0 1 1.984-1.362l1.93 1.93a5.07 5.07 0 0 0-2.876 1.44 5.11 5.11 0 0 0-1.061 1.57.75.75 0 0 0 1.374.602c.185-.422.437-.8.747-1.111a3.59 3.59 0 0 1 3.36-.958l7.858 7.858a.75.75 0 0 0 1.06-1.06L3.28 2.22Zm8.304 6.182 1.584 1.584a6.532 6.532 0 0 1 3.516 1.825 6.798 6.798 0 0 1 1.217 1.692.75.75 0 1 0 1.336-.683 8.292 8.292 0 0 0-1.492-2.07 8.042 8.042 0 0 0-6.16-2.348ZM8.487 5.305 9.713 6.53a10.44 10.44 0 0 1 10.908 4.297.75.75 0 1 0 1.235-.852 11.946 11.946 0 0 0-13.369-4.67Zm4.573 11.134a1.5 1.5 0 1 1-2.121 2.122 1.5 1.5 0 0 1 2.121-2.122Z" fill="currentColor"/></svg>',wand:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m13.314 7.565-.136.126-10.48 10.488a2.27 2.27 0 0 0 3.211 3.208L16.388 10.9a2.251 2.251 0 0 0-.001-3.182l-.157-.146a2.25 2.25 0 0 0-2.916-.007Zm-.848 2.961 1.088 1.088-8.706 8.713a.77.77 0 1 1-1.089-1.088l8.707-8.713Zm4.386 4.48L16.75 15a.75.75 0 0 0-.743.648L16 15.75v.75h-.75a.75.75 0 0 0-.743.648l-.007.102c0 .38.282.694.648.743l.102.007H16v.75c0 .38.282.694.648.743l.102.007a.75.75 0 0 0 .743-.648l.007-.102V18h.75a.75.75 0 0 0 .743-.648L19 17.25a.75.75 0 0 0-.648-.743l-.102-.007h-.75v-.75a.75.75 0 0 0-.648-.743L16.75 15l.102.007Zm-1.553-6.254.027.027a.751.751 0 0 1 0 1.061l-.711.713-1.089-1.089.73-.73a.75.75 0 0 1 1.043.018ZM6.852 5.007 6.75 5a.75.75 0 0 0-.743.648L6 5.75v.75h-.75a.75.75 0 0 0-.743.648L4.5 7.25c0 .38.282.693.648.743L5.25 8H6v.75c0 .38.282.693.648.743l.102.007a.75.75 0 0 0 .743-.648L7.5 8.75V8h.75a.75.75 0 0 0 .743-.648L9 7.25a.75.75 0 0 0-.648-.743L8.25 6.5H7.5v-.75a.75.75 0 0 0-.648-.743L6.75 5l.102.007Zm12-2L18.75 3a.75.75 0 0 0-.743.648L18 3.75v.75h-.75a.75.75 0 0 0-.743.648l-.007.102c0 .38.282.693.648.743L17.25 6H18v.75c0 .38.282.693.648.743l.102.007a.75.75 0 0 0 .743-.648l.007-.102V6h.75a.75.75 0 0 0 .743-.648L21 5.25a.75.75 0 0 0-.648-.743L20.25 4.5h-.75v-.75a.75.75 0 0 0-.648-.743L18.75 3l.102.007Z" fill="currentColor"/></svg>',recording:'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"/><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM3.5 12a8.5 8.5 0 1 1 17 0 8.5 8.5 0 0 1-17 0Z"/></svg>',subtract:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.755 12.5h16.492a.75.75 0 0 0 0-1.5H3.755a.75.75 0 0 0 0 1.5Z" fill="currentColor"/></svg>',stop_recording:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.5C9.74566 3.5 7.58365 4.39553 5.98959 5.98959C4.39553 7.58365 3.5 9.74566 3.5 12C3.5 14.2543 4.39553 16.4163 5.98959 18.0104C7.58365 19.6045 9.74566 20.5 12 20.5C14.2543 20.5 16.4163 19.6045 18.0104 18.0104C19.6045 16.4163 20.5 14.2543 20.5 12C20.5 9.74566 19.6045 7.58365 18.0104 5.98959C16.4163 4.39553 14.2543 3.5 12 3.5ZM2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22C6.477 22 2 17.523 2 12ZM8 9.5C8 9.10218 8.15804 8.72064 8.43934 8.43934C8.72064 8.15804 9.10218 8 9.5 8H14.5C14.8978 8 15.2794 8.15804 15.5607 8.43934C15.842 8.72064 16 9.10218 16 9.5V14.5C16 14.8978 15.842 15.2794 15.5607 15.5607C15.2794 15.842 14.8978 16 14.5 16H9.5C9.10218 16 8.72064 15.842 8.43934 15.5607C8.15804 15.2794 8 14.8978 8 14.5V9.5Z" fill="currentColor"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138 7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878Zm9.505 15.613-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086-7.76-14.008 7.76 14.008ZM12 16.002a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997ZM11.995 8.5a.75.75 0 0 1 .744.647l.007.102.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102-.004-4.502a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m16.242 2.932 4.826 4.826a2.75 2.75 0 0 1-.715 4.404l-4.87 2.435a.75.75 0 0 0-.374.426l-1.44 4.166a1.25 1.25 0 0 1-2.065.476L8.5 16.561 4.06 21H3v-1.06l4.44-4.44-3.105-3.104a1.25 1.25 0 0 1 .476-2.066l4.166-1.44a.75.75 0 0 0 .426-.373l2.435-4.87a2.75 2.75 0 0 1 4.405-.715Zm3.766 5.886-4.826-4.826a1.25 1.25 0 0 0-2.002.325l-2.435 4.871a2.25 2.25 0 0 1-1.278 1.12l-3.789 1.31 6.705 6.704 1.308-3.789a2.25 2.25 0 0 1 1.12-1.277l4.872-2.436a1.25 1.25 0 0 0 .325-2.002Z" fill="currentColor"/></svg>',pin_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l5.905 5.905L4.81 10.33a1.25 1.25 0 0 0-.476 2.065L7.439 15.5 3 19.94V21h1.06l4.44-4.44 3.105 3.105a1.25 1.25 0 0 0 2.065-.476l1.145-3.313 5.905 5.904a.75.75 0 0 0 1.06-1.06L3.28 2.22Zm10.355 12.476-1.252 3.626-6.705-6.705 3.626-1.252 4.331 4.331Zm6.048-3.876-3.787 1.894 1.118 1.118 3.34-1.67a2.75 2.75 0 0 0 .714-4.404l-4.825-4.826a2.75 2.75 0 0 0-4.405.715l-1.67 3.34 1.118 1.117 1.894-3.787a1.25 1.25 0 0 1 2.002-.325l4.826 4.826a1.25 1.25 0 0 1-.325 2.002Z" fill="currentColor"/></svg>',spinner:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke-width="2" stroke="currentColor" stroke-opacity="0.2" vector-effect="non-scaling-stroke"/><path d="M22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke"/></svg>',breakout_rooms:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.5 3a2.25 2.25 0 0 1 2.25 2.25v6h6A2.25 2.25 0 0 1 21 13.5v5.25A2.25 2.25 0 0 1 18.75 21H5.25A2.25 2.25 0 0 1 3 18.75V5.25A2.25 2.25 0 0 1 5.25 3h5.25Zm.75 9.75H4.5v6c0 .414.336.75.75.75h5.999l.001-6.75Zm7.5 0h-6.001v6.75h6.001a.75.75 0 0 0 .75-.75V13.5a.75.75 0 0 0-.75-.75ZM10.5 4.5H5.25a.75.75 0 0 0-.75.75v6h6.75v-6a.75.75 0 0 0-.75-.75Zm7.398-2.493L18 2a.75.75 0 0 1 .743.648l.007.102v2.5h2.5a.75.75 0 0 1 .743.648L22 6a.75.75 0 0 1-.648.743l-.102.007h-2.5v2.5a.75.75 0 0 1-.648.743L18 10a.75.75 0 0 1-.743-.648l-.007-.102v-2.5h-2.5a.75.75 0 0 1-.743-.648L14 6a.75.75 0 0 1 .648-.743l.102-.007h2.5v-2.5a.75.75 0 0 1 .648-.743Z" fill="currentColor"/></svg>',add:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.75 3a.75.75 0 0 1 .743.648l.007.102.001 7.25h7.253a.75.75 0 0 1 .102 1.493l-.102.007h-7.253l.002 7.25a.75.75 0 0 1-1.493.101l-.007-.102-.002-7.249H3.752a.75.75 0 0 1-.102-1.493L3.752 11h7.25L11 3.75a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',shuffle:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M14.0058 8.11111H18.7947L16.9613 9.94444C16.9095 9.99587 16.8684 10.057 16.8402 10.1243C16.812 10.1917 16.7974 10.2639 16.7971 10.3369C16.7966 10.4843 16.8547 10.6259 16.9586 10.7306C17.01 10.7823 17.0711 10.8235 17.1385 10.8517C17.2058 10.8799 17.278 10.8945 17.351 10.8947C17.4985 10.8953 17.64 10.8372 17.7447 10.7333L20.8891 7.59999L20.4947 7.20555L17.7447 4.46111C17.64 4.35723 17.4985 4.29917 17.351 4.29969C17.2036 4.30021 17.0624 4.35927 16.9586 4.46388C16.8547 4.5685 16.7966 4.71009 16.7971 4.85751C16.7977 5.00494 16.8567 5.14612 16.9613 5.24999L18.728 6.99999H13.6669C13.5699 7.00058 13.4748 7.02653 13.391 7.07526C13.3072 7.12399 13.2376 7.19381 13.1891 7.27777L11.7224 9.82777L12.3669 10.9389L14.0058 8.11111Z" fill="currentColor"/><path d="M8.15022 15.9278H3.66688C3.51954 15.9278 3.37823 15.9863 3.27405 16.0905C3.16986 16.1947 3.11133 16.336 3.11133 16.4833C3.11133 16.6307 3.16986 16.772 3.27405 16.8762C3.37823 16.9804 3.51954 17.0389 3.66688 17.0389H8.47244C8.56939 17.0383 8.6645 17.0124 8.74832 16.9636C8.83214 16.9149 8.90174 16.8451 8.95022 16.7611L10.4335 14.2222L9.77799 13.1111L8.15022 15.9278Z"/><path d="M17.7447 13.2056C17.64 13.1017 17.4985 13.0436 17.351 13.0441C17.2036 13.0447 17.0624 13.1037 16.9586 13.2083C16.8547 13.3129 16.7966 13.4545 16.7971 13.602C16.7977 13.7494 16.8567 13.8906 16.9613 13.9944L18.9058 15.9389H14.0058L8.95022 7.29444C8.90174 7.21047 8.83214 7.14066 8.74832 7.09193C8.6645 7.04319 8.56939 7.01725 8.47244 7.01666H3.66688C3.51954 7.01666 3.37823 7.07519 3.27405 7.17938C3.16986 7.28357 3.11133 7.42487 3.11133 7.57222C3.11133 7.71956 3.16986 7.86087 3.27405 7.96505C3.37823 8.06924 3.51954 8.12777 3.66688 8.12777H8.15022L13.2058 16.7667C13.2542 16.8506 13.3239 16.9204 13.4077 16.9692C13.4915 17.0179 13.5866 17.0439 13.6836 17.0444H18.6113L16.9447 18.7111C16.8929 18.7625 16.8517 18.8237 16.8235 18.891C16.7954 18.9584 16.7807 19.0306 16.7805 19.1036C16.7802 19.1766 16.7943 19.2489 16.822 19.3165C16.8497 19.384 16.8905 19.4454 16.9419 19.4972C16.9933 19.549 17.0545 19.5902 17.1218 19.6184C17.1891 19.6465 17.2614 19.6612 17.3344 19.6614C17.4074 19.6617 17.4797 19.6476 17.5472 19.6199C17.6148 19.5922 17.6762 19.5514 17.728 19.5L20.478 16.7556L20.8724 16.3611L17.7447 13.2056Z"/></svg>',edit:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21.03 2.97a3.578 3.578 0 0 1 0 5.06L9.062 20a2.25 2.25 0 0 1-.999.58l-5.116 1.395a.75.75 0 0 1-.92-.921l1.395-5.116a2.25 2.25 0 0 1 .58-.999L15.97 2.97a3.578 3.578 0 0 1 5.06 0ZM15 6.06 5.062 16a.75.75 0 0 0-.193.333l-1.05 3.85 3.85-1.05A.75.75 0 0 0 8 18.938L17.94 9 15 6.06Zm2.03-2.03-.97.97L19 7.94l.97-.97a2.079 2.079 0 0 0-2.94-2.94Z" fill="currentColor"/></svg>',delete:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75Zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5ZM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75Zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75Zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25Z" fill="currentColor"/></svg>',back:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.75 2a.75.75 0 0 1 .743.648l.007.102v5.69l4.574-4.56a6.41 6.41 0 0 1 8.879-.179l.186.18a6.41 6.41 0 0 1 0 9.063l-8.846 8.84a.75.75 0 0 1-1.06-1.062l8.845-8.838a4.91 4.91 0 0 0-6.766-7.112l-.178.17L6.562 9.5h5.688a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.648.743L12.25 11h-7.5a.75.75 0 0 1-.743-.648L4 10.25v-7.5A.75.75 0 0 1 4.75 2Z" fill="currentColor"/></svg>',save:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5.75A2.75 2.75 0 0 1 5.75 3h9.964a3.25 3.25 0 0 1 2.299.952l2.035 2.035c.61.61.952 1.437.952 2.299v9.964A2.75 2.75 0 0 1 18.25 21H5.75A2.75 2.75 0 0 1 3 18.25V5.75ZM5.75 4.5c-.69 0-1.25.56-1.25 1.25v12.5c0 .69.56 1.25 1.25 1.25H6v-5.25A2.25 2.25 0 0 1 8.25 12h7.5A2.25 2.25 0 0 1 18 14.25v5.25h.25c.69 0 1.25-.56 1.25-1.25V8.286c0-.465-.184-.91-.513-1.238l-2.035-2.035a1.75 1.75 0 0 0-.952-.49V7.25a2.25 2.25 0 0 1-2.25 2.25h-4.5A2.25 2.25 0 0 1 7 7.25V4.5H5.75Zm10.75 15v-5.25a.75.75 0 0 0-.75-.75h-7.5a.75.75 0 0 0-.75.75v5.25h9Zm-8-15v2.75c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75V4.5h-6Z" fill="currentColor"/></svg>',web:'<svg 
2xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9.99906 2.16577C14.6024 2.16577 18.3341 5.89744 18.3341 10.5008C18.3341 15.1033 14.6024 18.8349 9.99906 18.8349C5.39573 18.8349 1.66406 15.1033 1.66406 10.5008C1.66406 5.89744 5.39573 2.16577 9.99906 2.16577ZM12.4482 14.2499H7.54906C8.0924 16.2616 9.0374 17.5849 9.99823 17.5849C10.9591 17.5849 11.9041 16.2616 12.4474 14.2499H12.4482ZM6.25656 14.2499H3.98656C4.79114 15.5374 5.9867 16.5335 7.39823 17.0924C6.96323 16.4091 6.60406 15.5541 6.3399 14.5799L6.2549 14.2508L6.25656 14.2499ZM16.0107 14.2499H13.7424C13.4724 15.3624 13.0824 16.3333 12.5982 17.0924C13.9206 16.5694 15.0556 15.6617 15.8566 14.4866L16.0107 14.2508V14.2499ZM5.91073 8.83327H3.11156L3.1074 8.84744C2.9781 9.38904 2.91293 9.94396 2.91323 10.5008C2.91323 11.3808 3.07406 12.2233 3.3674 13.0008H6.01156C5.81031 11.621 5.77589 10.2221 5.90906 8.83411L5.91073 8.83327ZM12.8299 8.83327H7.16823C7.02162 10.221 7.05945 11.6221 7.28073 12.9999H12.7174C12.9386 11.6221 12.9764 10.221 12.8299 8.83327ZM16.8866 8.83327H14.0882C14.1399 9.37244 14.1674 9.93077 14.1674 10.4999C14.1687 11.3366 14.108 12.1722 13.9857 12.9999H16.6299C16.9308 12.2008 17.0844 11.3538 17.0832 10.4999C17.0832 9.92577 17.0149 9.3666 16.8866 8.83327ZM7.39906 3.90827L7.3799 3.91494C5.67441 4.59596 4.29862 5.91053 3.54073 7.58327H6.08073C6.3424 6.12327 6.7974 4.8516 7.3999 3.90827H7.39906ZM9.99906 3.41577L9.9024 3.41994C8.84906 3.5166 7.82906 5.18494 7.3574 7.58327H12.6424C12.1707 5.1916 11.1566 3.52577 10.1049 3.42077L9.99906 3.4166V3.41577ZM12.5991 3.90744L12.6882 4.05327C13.2457 4.97994 13.6691 6.19661 13.9174 7.58411H16.4574C15.7339 5.98751 14.4463 4.71438 12.8416 4.0091L12.5991 3.90827V3.90744Z"/></svg>',checkmark:'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="m18 6.7-8.48 8.48-3.54-3.54a.996.996 0 1 0-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 0 0-.01-1.42c-.37-.38-1-.38-1.39.01z"/></svg>',spotlight:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19.745 4C20.3417 4 20.914 4.23705 21.336 4.65901C21.7579 5.08097 21.995 5.65326 21.995 6.25V12.805C21.5485 12.3774 21.0434 12.0154 20.495 11.73V6.25C20.495 6.05109 20.416 5.86032 20.2753 5.71967C20.1347 5.57902 19.9439 5.5 19.745 5.5H4.25C4.05109 5.5 3.86032 5.57902 3.71967 5.71967C3.57902 5.86032 3.5 6.05109 3.5 6.25V17.755C3.5 18.169 3.836 18.505 4.25 18.505L6.999 18.504L7 15.75C7.00002 15.3108 7.16517 14.8877 7.46268 14.5646C7.76019 14.2415 8.1683 14.0421 8.606 14.006L8.75 14H12.022C11.7223 14.4675 11.484 14.9716 11.313 15.5H8.75C8.69368 15.5001 8.63904 15.5192 8.59493 15.5542C8.55083 15.5893 8.51984 15.6382 8.507 15.693L8.5 15.75L8.499 18.504H11.077C11.1569 19.0193 11.2989 19.5229 11.5 20.004H4.25C3.65344 20.004 3.08129 19.7671 2.65936 19.3453C2.23744 18.9236 2.00027 18.3516 2 17.755V6.25C2 5.65326 2.23705 5.08097 2.65901 4.65901C3.08097 4.23705 3.65326 4 4.25 4H19.745Z"/><path d="M12 7C12.7956 7 13.5587 7.31607 14.1213 7.87868C14.6839 8.44129 15 9.20435 15 10C15 10.7956 14.6839 11.5587 14.1213 12.1213C13.5587 12.6839 12.7956 13 12 13C11.2044 13 10.4413 12.6839 9.87868 12.1213C9.31607 11.5587 9 10.7956 9 10C9 9.20435 9.31607 8.44129 9.87868 7.87868C10.4413 7.31607 11.2044 7 12 7ZM12 8.5C11.6022 8.5 11.2206 8.65804 10.9393 8.93934C10.658 9.22064 10.5 9.60218 10.5 10C10.5 10.3978 10.658 10.7794 10.9393 11.0607C11.2206 11.342 11.6022 11.5 12 11.5C12.3978 11.5 12.7794 11.342 13.0607 11.0607C13.342 10.7794 13.5 10.3978 13.5 10C13.5 9.60218 13.342 9.22064 13.0607 8.93934C12.7794 8.65804 12.3978 8.5 12 8.5Z"/><path d="M23 17.5C23 18.9587 22.4205 20.3576 21.3891 21.3891C20.3576 22.4205 18.9587 23 17.5 23C16.0413 23 14.6424 22.4205 13.6109 21.3891C12.5795 20.3576 12 18.9587 12 17.5C12 16.0413 12.5795 14.6424 13.6109 13.6109C14.6424 12.5795 16.0413 12 17.5 12C18.9587 12 20.3576 12.5795 21.3891 13.6109C22.4205 14.6424 23 16.0413 23 17.5ZM18.055 14.42C18.0207 14.2993 17.9479 14.193 17.8478 14.1174C17.7476 14.0417 17.6255 14.0008 17.5 14.0008C17.3745 14.0008 17.2524 14.0417 17.1522 14.1174C17.0521 14.193 16.9793 14.2993 16.945 14.42L16.388 16.208H14.585C14.019 16.208 13.785 16.962 14.242 17.308L15.7 18.413L15.143 20.2C14.968 20.761 15.584 21.228 16.042 20.881L17.5 19.777L18.958 20.881C19.416 21.228 20.032 20.761 19.857 20.201L19.3 18.413L20.758 17.309C21.216 16.962 20.981 16.208 20.415 16.208H18.612L18.055 14.421V14.42Z"/></svg>',join_stage:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M17.5 22C14.4618 22 12 19.5376 12 16.5C12 13.4623 14.4618 11 17.5 11C20.5371 11 23 13.4624 23 16.5C23 19.5376 20.5371 22 17.5 22ZM17.0704 18.992L17.1167 19.0322C17.1868 19.0841 17.2716 19.1125 17.3588 19.1132C17.4461 19.1139 17.5314 19.0869 17.6023 19.036L17.654 18.992L17.6936 18.9458C17.7455 18.8757 17.7739 18.7909 17.7746 18.7037C17.7753 18.6164 17.7483 18.5311 17.6975 18.4602L17.6535 18.4085L16.158 16.9125H19.8375L19.8936 16.9092C19.9829 16.8969 20.0657 16.8558 20.1293 16.792C20.193 16.7282 20.234 16.6454 20.2462 16.5561L20.25 16.5005L20.2462 16.4444C20.2339 16.3553 20.1928 16.2725 20.1292 16.2089C20.0655 16.1452 19.9828 16.1041 19.8936 16.0919L19.8375 16.088H16.158L17.654 14.592L17.6941 14.5453C17.7537 14.4659 17.7827 14.3676 17.7756 14.2686C17.7686 14.1695 17.726 14.0763 17.6558 14.0061C17.5856 13.9359 17.4924 13.8934 17.3934 13.8863C17.2943 13.8793 17.1961 13.9082 17.1167 13.9678L17.071 14.0079L14.8699 16.2079L14.8303 16.2547C14.7784 16.3247 14.75 16.4094 14.7493 16.4965C14.7485 16.5837 14.7753 16.6688 14.8259 16.7398L14.8699 16.7915L17.0704 18.992Z"/><path d="M2.80546 3.80546C2.28973 4.32118 2 5.02065 2 5.75V16.25C2 16.6111 2.07113 16.9687 2.20933 17.3024C2.34753 17.636 2.5501 17.9392 2.80546 18.1945C3.06082 18.4499 3.36398 18.6525 3.69762 18.7907C4.03127 18.9289 4.38886 19 4.75 19H11.498C11.3 18.526 11.157 18.023 11.076 17.5H9.002V14.75C9.002 14.6837 9.02834 14.6201 9.07522 14.5732C9.12211 14.5263 9.1857 14.5 9.252 14.5H11.3135C11.4858 13.9665 11.7253 13.4632 12.0218 13H9.252C8.285 13 7.502 13.784 7.502 14.75V16H7.5V17.5
2H4.75C4.06 17.5 3.5 16.94 3.5 16.25V5.75C3.5 5.06 4.06 4.5 4.75 4.5H19.25C19.94 4.5 20.5 5.06 20.5 5.75V10.732C20.6457 10.808 20.7884 10.8895 20.9277 10.9762C20.9687 11.0017 21.0093 11.0276 21.0497 11.054C21.3899 11.2762 21.708 11.5294 22 11.8096V5.75C22 5.02065 21.7103 4.32118 21.1945 3.80546C20.6788 3.28973 19.9793 3 19.25 3H4.75C4.02065 3 3.32118 3.28973 2.80546 3.80546Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4181 10.7757C14.7938 10.264 15 9.64262 15 9C15 8.20435 14.6839 7.44129 14.1213 6.87868C13.5587 6.31607 12.7956 6 12 6C11.2044 6 10.4413 6.31607 9.87868 6.87868C9.31607 7.44129 9 8.20435 9 9C9 9.79565 9.31607 10.5587 9.87868 11.1213C10.4413 11.6839 11.2044 12 12 12C12.333 12 12.6602 11.9446 12.9695 11.839C13.3992 11.4213 13.8864 11.0625 14.4181 10.7757ZM10.9393 7.93934C11.2206 7.65804 11.6022 7.5 12 7.5C12.3978 7.5 12.7794 7.65804 13.0607 7.93934C13.342 8.22064 13.5 8.60218 13.5 9C13.5 9.39782 13.342 9.77936 13.0607 10.0607C12.7794 10.342 12.3978 10.5 12 10.5C11.6022 10.5 11.2206 10.342 10.9393 10.0607C10.658 9.77936 10.5 9.39782 10.5 9C10.5 8.60218 10.658 8.22064 10.9393 7.93934Z"></svg>',leave_stage:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M2.80546 3.80546C2.28973 4.32118 2 5.02065 2 5.75V16.25C2 16.6111 2.07113 16.9687 2.20933 17.3024C2.34753 17.636 2.5501 17.9392 2.80546 18.1945C3.06082 18.4499 3.36398 18.6525 3.69762 18.7907C4.03127 18.9289 4.38886 19 4.75 19H11.498C11.3 18.526 11.157 18.023 11.076 17.5H9.002V14.75C9.002 14.6837 9.02834 14.6201 9.07522 14.5732C9.12211 14.5263 9.1857 14.5 9.252 14.5H11.3135C11.4858 13.9665 11.7253 13.4632 12.0218 13H9.252C8.285 13 7.502 13.784 7.502 14.75V16H7.5V17.5H4.75C4.06 17.5 3.5 16.94 3.5 16.25V5.75C3.5 5.06 4.06 4.5 4.75 4.5H19.25C19.94 4.5 20.5 5.06 20.5 5.75V10.732C20.6457 10.808 20.7884 10.8895 20.9277 10.9762C20.9687 11.0017 21.0093 11.0276 21.0497 11.054C21.3899 11.2762 21.708 11.5294 22 11.8096V5.75C22 5.02065 21.7103 4.32118 21.1945 3.80546C20.6788 3.28973 19.9793 3 19.25 3H4.75C4.02065 3 3.32118 3.28973 2.80546 3.80546Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4181 10.7757C14.7938 10.264 15 9.64262 15 9C15 8.20435 14.6839 7.44129 14.1213 6.87868C13.5587 6.31607 12.7956 6 12 6C11.2044 6 10.4413 6.31607 9.87868 6.87868C9.31607 7.44129 9 8.20435 9 9C9 9.79565 9.31607 10.5587 9.87868 11.1213C10.4413 11.6839 11.2044 12 12 12C12.333 12 12.6602 11.9446 12.9695 11.839C13.3992 11.4213 13.8864 11.0625 14.4181 10.7757ZM10.9393 7.93934C11.2206 7.65804 11.6022 7.5 12 7.5C12.3978 7.5 12.7794 7.65804 13.0607 7.93934C13.342 8.22064 13.5 8.60218 13.5 9C13.5 9.39782 13.342 9.77936 13.0607 10.0607C12.7794 10.342 12.3978 10.5 12 10.5C11.6022 10.5 11.2206 10.342 10.9393 10.0607C10.658 9.77936 10.5 9.39782 10.5 9C10.5 8.60218 10.658 8.22064 10.9393 7.93934Z"/><path d="M17.5 11C20.5382 11 23 13.4624 23 16.5C23 19.5377 20.5382 22 17.5 22C14.4629 22 12 19.5377 12 16.5C12 13.4624 14.4629 11 17.5 11V11ZM17.9296 14.0079L17.8833 13.9678C17.8132 13.9159 17.7284 13.8875 17.6412 13.8868C17.5539 13.8861 17.4686 13.9131 17.3977 13.964L17.346 14.0079L17.3064 14.0542C17.2545 14.1243 17.2261 14.2091 17.2254 14.2963C17.2247 14.3836 17.2517 14.4689 17.3026 14.5398L17.3465 14.5915L18.842 16.0875H15.1625L15.1064 16.0908C15.0171 16.1031 14.9343 16.1442 14.8707 16.208C14.807 16.2718 14.766 16.3546 14.7539 16.4439L14.75 16.4995L14.7539 16.5556C14.7661 16.6447 14.8072 16.7275 14.8708 16.7911C14.9345 16.8548 15.0172 16.8959 15.1064 16.9081L15.1625 16.912H18.842L17.346 18.408L17.3059 18.4547C17.2463 18.5341 17.2173 18.6324 17.2244 18.7314C17.2314 18.8305 17.274 18.9237 17.3442 18.9939C17.4144 19.0641 17.5076 19.1066 17.6066 19.1137C17.7057 19.1207 17.8039 19.0918 17.8833 19.0322L17.929 18.9921L20.1301 16.7921L20.1697 16.7453C20.2216 16.6753 20.25 16.5906 20.2507 16.5035C20.2515 16.4163 20.2247 16.3312 20.1741 16.2602L20.1301 16.2085L17.9301 14.0079L17.8833 13.9678L17.9296 14.0079V14.0079Z"/></svg>',pip_off:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.8666 12.3058C11.0731 12.3058 11.2404 12.1385 11.2404 11.932V8.56753C11.2404 8.36107 11.0731 8.1937 10.8666 8.1937C10.6601 8.1937 10.4928 8.36107 10.4928 8.56753V11.0295L6.45393 6.99066C6.30794 6.84467 6.07124 6.84467 5.92525 6.99066C5.77926 7.13665 5.77926 7.37335 5.92525 7.51934L9.9641 11.5582L7.50212 11.5582C7.29566 11.5582 7.12829 11.7256 7.12829 11.932C7.12829 12.1385 7.29566 12.3058 7.50212 12.3058L10.8666 12.3058ZM5.73832 19.8879C3.6737 19.8879 2 18.2141 2 16.1495V7.73832C2 5.6737 3.6737 4 5.73832 4H18.2617C20.3263 4 22 5.6737 22 7.73832L22 13.0269C22 12.2687 21.6002 11.6038 21 11.2316C20.8468 11.1366 20.6806 11.0607 20.5047 11.0071V7.73832C20.5047 6.49955 19.5005 5.49533 18.2617 5.49533H5.73832C4.49955 5.49533 3.49533 6.49955 3.49533 7.73832V16.1495C3.49533 17.3883 4.49955 18.3925 5.73832 18.3925H10.7971C10.8506 18.5685 10.9266 18.7347 11.0216 18.8879C11.3938 19.4881 12.0587 19.8879 12.8169 19.8879H5.73832Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.7265 12.5H13.3911C12.899 12.5 12.5 12.899 12.5 13.3911V17.6462C12.5 18.1384 12.899 18.5374 13.3911 18.5374H19.7265C20.2187 18.5374 20.6176 18.1384 20.6176 17.6462V13.3911C20.6176 12.899 20.2187 12.5 19.7265 12.5ZM13.3911 11.5C12.3467 11.5 11.5 12.3467 11.5 13.3911V17.6462C11.5 18.6907 12.3467 19.5374 13.3911 19.5374H19.7265C20.771 19.5374 21.61
276 18.6907 21.6176 17.6462V13.3911C21.6176 12.3467 20.771 11.5 19.7265 11.5H13.3911Z"/></svg>',pip_on:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.73832 19.8879C3.6737 19.8879 2 18.2141 2 16.1495V7.73832C2 5.6737 3.6737 4 5.73832 4H18.2617C20.3263 4 22 5.6737 22 7.73832L22 13.0269C22 12.2687 21.6002 11.6038 21 11.2316C20.8468 11.1366 20.6806 11.0607 20.5047 11.0071V7.73832C20.5047 6.49955 19.5005 5.49533 18.2617 5.49533H5.73832C4.49955 5.49533 3.49533 6.49955 3.49533 7.73832V16.1495C3.49533 17.3883 4.49955 18.3925 5.73832 18.3925H10.7971C10.8506 18.5685 10.9266 18.7347 11.0216 18.8879C11.3938 19.4881 12.0587 19.8879 12.8169 19.8879H5.73832Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.7265 12.5H13.3911C12.899 12.5 12.5 12.899 12.5 13.3911V17.6462C12.5 18.1384 12.899 18.5374 13.3911 18.5374H19.7265C20.2187 18.5374 20.6176 18.1384 20.6176 17.6462V13.3911C20.6176 12.899 20.2187 12.5 19.7265 12.5ZM13.3911 11.5C12.3467 11.5 11.5 12.3467 11.5 13.3911V17.6462C11.5 18.6907 12.3467 19.5374 13.3911 19.5374H19.7265C20.771 19.5374 21.6176 18.6907 21.6176 17.6462V13.3911C21.6176 12.3467 20.771 11.5 19.7265 11.5H13.3911Z"/><path d="M6.18951 6.88123C5.98304 6.88123 5.81567 7.0486 5.81567 7.25506V10.6195C5.81567 10.826 5.98304 10.9934 6.18951 10.9934C6.39597 10.9934 6.56334 10.826 6.56334 10.6195V8.15757L10.6022 12.1964C10.7482 12.3424 10.9849 12.3424 11.1309 12.1964C11.2769 12.0504 11.2769 11.8137 11.1309 11.6677L7.09202 7.62889L9.55399 7.62889C9.76045 7.62889 9.92782 7.46152 9.92782 7.25506C9.92782 7.0486 9.76045 6.88123 9.55399 6.88123L6.18951 6.88123Z"/></svg>',signal_1:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3z"></path></svg>',signal_2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7z"></path></svg>',signal_3:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2z"></path></svg>',signal_4:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2zm4-3h2v14h-2z"></path></svg>',signal_5:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2zm4-3h2v14h-2zm4-3h2v17h-2z"></path></svg>',start_livestream:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M6.343 4.938a1 1 0 0 1 0 1.415a8.003 8.003 0 0 0 0 11.317a1 1 0 1 1-1.415 1.414c-3.906-3.906-3.906-10.24 0-14.146a1 1 0 0 1 1.415 0Zm12.731 0c3.906 3.907 3.906 10.24 0 14.146a1 1 0 0 1-1.414-1.414a8.003 8.003 0 0 0 0-11.317a1 1 0 0 1 1.414-1.415ZM9.31 7.812a1 1 0 0 1 0 1.414a3.92 3.92 0 0 0 0 5.544a1 1 0 1 1-1.414 1.414a5.92 5.92 0 0 1 0-8.372a1 1 0 0 1 1.414 0Zm6.959 0a5.92 5.92 0 0 1 0 8.372a1 1 0 0 1-1.415-1.414a3.92 3.92 0 0 0 0-5.544a1 1 0 0 1 1.415-1.414Zm-4.187 2.77a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3Z"/></svg>',stop_livestream:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M2.854 2.146a.5.5 0 1 0-.708.708l1.811 1.81A8.218 8.218 0 0 0 2 10a8.228 8.228 0 0 0 2.604 6.015a.725.725 0 0 0 1.01-.025c.316-.316.277-.819-.027-1.11A6.73 6.73 0 0 1 3.5 10c0-1.62.57-3.107 1.522-4.27l.712.71A5.726 5.726 0 0 0 4.5 10c0 1.691.73 3.213 1.893 4.264a.713.713 0 0 0 .983-.037c.328-.328.267-.844-.041-1.134A4.238 4.238 0 0 1 6 10c0-.93.298-1.789.804-2.489l1.842 1.842a1.5 1.5 0 0 0 2 2l6.5 6.5a.5.5 0 0 0 .708-.707l-1.811-1.81l-1.065-1.066l-.712-.71l-1.07-1.072l-1.842-1.841l-2-2L7.4 6.693l-.942-.942l-.82-.82l-.944-.944l-1.841-1.842Zm13.794 12.38A8.212 8.212 0 0 0 18 10c0-2.283-.928-4.35-2.426-5.843a.726.726 0 0 0-1.027.01c-.31.31-.28.8.01 1.095A6.727 6.727 0 0 1 16.5 10a6.718 6.718 0 0 1-.94 3.438l1.088 1.089Zm-1.822-1.822A5.73 5.73 0 0 0 15.5 10a5.733 5.733 0 0 0-1.706-4.087a.714.714 0 0 0-1.008.016c-.319.318-.272.816.014 1.111A4.235 4.235 0 0 1 14 10c0 .557-.107 1.09-.302 1.577l1.128 1.127Z"/></svg>',viewers:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 13">
2<path fill="currentColor" d="M10.0309 4.00462C12.24 4.00462 14.0309 5.79549 14.0309 8.00462C14.0309 10.2138 12.24 12.0046 10.0309 12.0046C7.82174 12.0046 6.03088 10.2138 6.03088 8.00462C6.03088 5.79549 7.82174 4.00462 10.0309 4.00462ZM10.0309 5.50462C8.65017 5.50462 7.53088 6.62391 7.53088 8.00462C7.53088 9.38534 8.65017 10.5046 10.0309 10.5046C11.4116 10.5046 12.5309 9.38534 12.5309 8.00462C12.5309 6.62391 11.4116 5.50462 10.0309 5.50462ZM10.0309 0.5C14.6444 0.5 18.627 3.65001 19.732 8.06439C19.8326 8.4662 19.5884 8.87348 19.1866 8.97406C18.7848 9.07465 18.3775 8.83045 18.2769 8.42863C17.338 4.67796 13.9522 2 10.0309 2C6.10781 2 2.72098 4.68026 1.78374 8.43315C1.68337 8.83502 1.27623 9.07944 0.874363 8.97908C0.472492 8.87872 0.228071 8.47158 0.328434 8.06971C1.43153 3.65272 5.41536 0.5 10.0309 0.5Z"/></svg>'}},2725:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});var r={designTokens:{spacingBase:4,googleFont:"Inter"},styles:{"dyte-header":{display:"grid",height:"48px",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"dyte-header.sm":{display:"grid",gridArea:"header",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"div#header-left":{display:"flex",alignItems:"center",height:"48px",wordBreak:"break-all"},"dyte-logo":{height:"26px"},"div#header-center":{display:"flex",alignItems:"center",justifyContent:"center",wordBreak:"break-all"},"div#header-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-stage":{display:"flex",flex:"1"},"dyte-grid":{flex:"1",height:"auto"},"dyte-controlbar":{display:"grid",height:"76px",gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"1fr",alignItems:"center",padding:"8px"},"dyte-controlbar.sm":{display:"flex",position:"relative",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))"},"dyte-controlbar.md":{display:"flex",position:"relative",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))"},"div#controlbar-left":{display:"flex",alignItems:"center"},"div#controlbar-center":{display:"flex",alignItems:"center",justifyContent:"center"},"div#controlbar-mobile":{display:"flex",flex:"1",alignItems:"center",justifyContent:"center"},"div#controlbar-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-settings":{width:"720px",height:"480px"}
2,"dyte-breakout-rooms-manager":{minHeight:"400px",minWidth:"500px",maxWidth:"80%",maxHeight:"480px"},"div#more-menu":{position:"absolute",boxSizing:"border-box",top:"0",left:"0",width:"100%",transform:"translateY(-100%)",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))",padding:"16px 12px",borderRadius:"18px 18px 0 0"},"div#setupcontrols-media":{position:"absolute",bottom:"8px",right:"8px",display:"flex"},"div#setupcontrols-settings":{position:"absolute",top:"8px",right:"8px"},"dyte-meeting-title.sm":{marginLeft:"0"},"dyte-clock":{marginRight:"0"}},root:{"dyte-meeting":{state:"meeting",states:["activeSidebar"]},"dyte-meeting[meeting=waiting]":["dyte-waiting-screen"],"dyte-meeting[meeting=idle]":["dyte-idle-screen"],"dyte-meeting[meeting=setup]":["dyte-setup-screen","dyte-dialog-manager"],"dyte-meeting[meeting=joined]":["dyte-header","dyte-stage","dyte-controlbar","dyte-participants-audio","dyte-dialog-manager"],"dyte-meeting[meeting=joined].activeSidebar.sm":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=joined].activeSidebar.md":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=ended]":["dyte-ended-screen"],"dyte-header":["div#header-left","div#header-center","div#header-right"],"dyte-header.sm":{remove:["div#header-center"]},"div#header-left":["dyte-logo","dyte-recording-indicator","dyte-livestream-indicator"],"div#header-center":["dyte-meeting-title"],"div#header-right":["dyte-grid-pagination","dyte-clock","dyte-participant-count","dyte-viewer-count"],"div#header-left.sm":["dyte-meeting-title","dyte-recording-indicator","dyte-livestream-indicator"],"dyte-stage":{states:["activeSidebar"],children:["dyte-grid","dyte-notifications"]},"dyte-stage.activeSidebar":{add:[["dyte-sidebar",{view:"sidebar"}]]},"dyte-stage.activeSidebar.sm":{remove:["dyte-sidebar"]},"dyte-grid":{states:["activeScreenShare","activePlugin","activeSpotlight"],children:["dyte-simple-grid"]},"dyte-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-grid.activeScreenShare":["dyte-mixed-grid"],"dyte-grid.activePlugin":["dyte-mixed-grid"],"dyte-grid.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-mixed-grid":{states:["activeSpotlight"],children:["dyte-simple-grid"]},"dyte-mixed-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-participant-tile":{state:"meeting",children:["dyte-name-tag","dyte-avatar","dyte-network-indicator"]},"dyte-participant-setup":["dyte-avatar","div#setupcontrols-media"],"dyte-participant-tile[meeting=setup]":["dyte-avatar","div#setupcontrols-settings","div#setupcontrols-media"],"div#setupcontrols-media":[["dyte-mic-toggle",{size:"sm"}],["dyte-camera-toggle",{size:"sm"}]],"div#setupcontrols-settings":[["dyte-settings-toggle",{size:"sm"}]],"dyte-screenshare-view":["dyte-name-tag","dyte-network-indicator"],"dyte-name-tag":[["dyte-audio-visualizer",{slot:"start"}]],"dyte-controlbar":{states:["activeMoreMenu"],props:{variant:"solid"},children:["div#controlbar-left","div#controlbar-center","div#controlbar-right"]},"dyte-controlbar.sm":["div#controlbar-mobile"],"dyte-controlbar.md":["div#controlbar-mobile"],"dyte-controlbar.activeMoreMenu.sm":{add:["div#more-menu"]},"dyte-controlbar.activeMoreMenu.md":{add:["div#more-menu"]},"div#controlbar-mobile":["dyte-mic-toggle","dyte-camera-toggle","dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-leave-button","dyte-more-toggle"],"div#more-menu":[["dyte-chat-toggle",{variant:"horizontal"}],["dyte-participants-toggle",{variant:"horizontal"}],["dyte-polls-toggle",{variant:"horizontal"}],["dyte-plugins-toggle",{variant:"horizontal"}],["dyte-fullscreen-toggle",{variant:"horizontal"}],["dyte-screen-share-toggle",{variant:"horizontal"}],["dyte-pip-toggle",{variant:"horizontal"}],["dyte-mute-all-button",{variant:"horizontal"}],["dyte-breakout-rooms-toggle",{variant:"horizontal"}],["dyte-settings-toggle",{variant:"horizontal"}]],"div#controlbar-left":["dyte-screen-share-toggle","dyte-fullscreen-toggle","dyte-pip-toggle","dyte-recording-toggle","dyte-breakout-rooms-toggle","dyte-livestream-toggle"],"div#controlbar-center":["dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-mic-toggle","dyte-camera-toggle","dyte-mute-all-button","dyte-settings-toggle","dyte-leave-button"],"div#controlbar-right":["dyte-chat-toggle","dyte-polls-toggle","dyte-participants-toggle","dyte-plugins-toggle"]},config:{notification_sounds:{participant_left:!1},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10,videoFit:"cover"}}},4130:function(e,t,n){"use strict";n.d(t,{g:function(){return a}});var r,i={get:function(e,t,n){return function(){try{for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return Reflect.get(e,t,n).apply(e,i)}catch(o){return null}}}};try{r=new Proxy(localStorage,i)}catch(o){r=new Proxy({},i)}var a=r},7622:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r={chat:"Chat","chat.new":"New",participants:"Participants",polls:"Polls",plugins:"Plugins",mic_off:"Mic Off",mic_on:"Mic On",video_off:"Video Off",video_on:"Video On",left_meeting:"You left the meeting",share_screen_start:"Share Screen",share_screen_stop:"Stop Sharing",leave:"Leave",dismiss:"Dismiss",page:"Page",settings:"Settings",audio:"Audio",video:"Video",connection:"Connection",leave_confirmation:"Are you sure you want to leave the call?",end_meeting_for_all:"End meeting for all",cancel:"Cancel",
2yes:"Yes",you:"you",mute:"Mute",kick:"Kick","participant.turn_off_video":"Turn off video",perm_browser_denied:"Permission denied by browser","perm.sys_denied.message":"To enable system permission, go to Mac's System Preferences -> Security & Privacy ->  Privacy -> Select Microphone, Camera or 'Screen Recording' and allow permission for your specific browser","perm_sys_denied.audio":"Mic permission denied by system","perm_sys_denied.video":"Camera permission denied by system","perm_sys_denied.screenshare":"Screenshare permission denied by system","perm_denied_title.video":"Camera permission denied","perm_denied_title.audio":"Mic permission denied","perm_denied_title.screenshare":"Screenshare permission denied","perm_denied_text.audio":"It seems like your browser or system has blocked permission for us to access microphone. Please allow this permission and reload for a smoother experience.","perm_denied_text.video":"It seems like your browser or system has blocked permission for us to access camera. Please allow this permission and reload for a smoother experience.","perm_denied_text.screenshare":"It seems like your browser or system has blocked permission for us to screenshare. Please allow this permission and reload for a smoother experience.",full_screen:"Full Screen","full_screen.exit":"Exit Full Screen","waitlist.header_title":"Waiting","waitlist.body_text":"You are in the waiting room, the host will let you in soon.","waitlist.deny_request":"Deny request","waitlist.accept_request":"Accept request","waitlist.accept_all":"Accept all","stage_request.header_title":"Join Stage Requests","stage_request.deny_request":"Deny request","stage_request.accept_request":"Accept request","stage_request.accept_all":"Accept all","stage_request.deny_all":"Deny all","stage_request.approval_pending":"Pending","stage_request.denied":"Denied","stage_request.request":"Join stage","stage_request.cancel_request":"Cancel request","stage_request.leave_stage":"Leave stage","stage_request.request_tip":"Request to join the discussion","stage_request.leave_tip":"Leave the stage","stage_request.pending_tip":"Request pending","stage_request.denied_tip":"Rejected request","stage.empty_host":"The stage is empty","stage.empty_host_summary":"To begin the webinar, please join the stage or accept a join stage request from the participants tab.","stage.empty_viewer":"Webinar has not yet been started","stage.remove_from_stage":"Remove from stage","stage.add_to_stage":"Add to stage","stage.join_title":"Join Stage","stage.join_summary":"You are about to join the stage, your video & audio as shown above will be visible to all participants.","stage.join_cancel":"Cancel","stage.join_confirm":"Join","setup_screen.join_in_as":"Join in as","setup_screen.joining_as":"Joining as","setup_screen.your_name":"Your name","stage.reconnecting":"Reconnecting...",pip_on:"Show PiP",pip_off:"Hide PiP","recording.started":"This meeting is being recorded.","recording.stopped":"Recording for this meeting has been stopped.",mute_all:"Mute all","mute_all.description":"Everyone in the meeting will be muted","mute_all.header":"Are you sure?","mute_all.allow_unmute":"Allow others to unmute","participants.empty_search_results":"Couldn't find a participant with the specified name or ID.","participants.empty_list":"It looks like nobody is here.",audio_playback:"Play Audio","audio_playback.title":"Allow Audio Playback","audio_playback.description":"In order to play audio properly on your device, click the button below.",join:"Join",joined:"Joined",create:"Create",close:"Close","confirmation_modal.header":"Are you sure?",breakout_rooms:"Breakout Rooms","breakout_rooms.room_config_header":"Create Breakout","breakout_rooms.join_breakout_header":"Join Breakout","breakout_rooms.empty":"Nobody here yet.","breakout_rooms.switch":"Switch","breakout_rooms.main_room":"Main Room","breakout_rooms.shuffle_participants":"Shuffle Participants","breakout_rooms.deselect":"Deselect","breakout_rooms.selected":"selected","breakout_rooms.num_of_rooms":"No. of Rooms","breakout_rooms.approx":"Approx.","breakout_rooms.participants_per_room":"participants/room","breakout_rooms.division_text":"when equally divi
2ded.","breakout_rooms.start_breakout":"Start Breakout","breakout_rooms.close_breakout":"Close Breakout","breakout_rooms.update_breakout":"Update Breakout","breakout_rooms.discard_changes":"Discard Changes","breakout_rooms.room":"Room","breakout_rooms.rooms":"Rooms","breakout_rooms.room_name":"Room Name","breakout_rooms.edit_room_name":"Edit Room Name","breakout_rooms.save_room_name":"Save Room Name","breakout_rooms.add_room":"Add","breakout_rooms.add_room_brief":"Add Room","breakout_rooms.select_all":"Select all","breakout_rooms.unassign_all":"Unassign all","breakout_rooms.assign":"Assign","breakout_rooms.assign_participants":"Assign Participants","breakout_rooms.none_assigned":"No participants assigned yet","breakout_rooms.drag_drop_participants":"Drag and drop participants","breakout_rooms.click_drop_participants":"Click here to assign","breakout_rooms.status.assign_multiple":"Assign multiple participants at once by clicking and selecting them","breakout_rooms.status.select_room":"Select a room to assign","breakout_rooms.ephemeral_status.participants_assigned":"Participants assigned","breakout_rooms.ephemeral_status.participants_assigned_randomly":"Participants assigned randomly","breakout_rooms.ephemeral_status.changes_discarded":"Changes discarded","breakout_rooms.confirm_modal.start_breakout.header":"Start breakout rooms?","breakout_rooms.confirm_modal.start_breakout.content":"Once started, all participants will be moved to their assigned rooms.","breakout_rooms.confirm_modal.start_breakout.cancelText":"No, go back","breakout_rooms.confirm_modal.start_breakout.ctaText":"Yes, start","breakout_rooms.confirm_modal.close_breakout.header":"Close breakout rooms?","breakout_rooms.confirm_modal.close_breakout.content":"All breakout rooms will be closed & participants will be moved back to the main room.","breakout_rooms.confirm_modal.close_breakout.ctaText":"Yes, close breakout","breakout_rooms.move_reason.started_msg":"Starting breakout rooms...","breakout_rooms.move_reason.started_desc":"You are being moved to your assigned room","breakout_rooms.move_reason.closed_msg":"Closing Breakout rooms...","breakout_rooms.move_reason.closed_desc":"You are being moved back to the main room","breakout_rooms.move_reason.switch_room":"Joining Breakout Room...","breakout_rooms.move_reason.switch_main_room":"Joining Main Room...","breakout_rooms.all_assigned":"All participants have been assigned","breakout_rooms.empty_main_room":"No more participants in the main room.","breakout_rooms.leave_confirmation":"Are you sure you want to leave the call? You are in a breakout room, you can join the main room too.","breakout_rooms.leave_confirmation.main_room_btn":"Go back to main room"},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;return function(t){var n;return null!==(n=e[t])&&void 0!==n?n:t}}},6454:function(e,t,n){"use strict";n.d(t,{a:function(){return g},b:function(){return v},f:function(){return r},i:function(){return m},r:function(){return a}});var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")(),o=a.Symbol,s=Object.prototype,c=s.hasOwnProperty,u=s.toString,l=o?o.toStringTag:void 0;var d=Object.prototype.toString;var p="[object Null]",h="[object Undefined]",f=o?o.toStringTag:void 0;function v(e){return null==e?void 0===e?h:p:f&&f in Object(e)?function(e){var t=c.call(e,l),n=e[l];try{e[l]=void 0;var r=!0}catch(a){}var i=u.call(e);return r&&(t?e[l]=n:delete e[l]),i}(e):function(e){return d.call(e)}(e)}function m(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function g(e){return null!=e&&"object"==typeof e}},4313:function(e,t,n){"use strict";n.d(t,{q:function(){return Be}});var r=n(4925),i=n(1413),a=n(4942),o=n(7762),s=n(5671),c=n(3144),u=n(7326),l=n(136),d=n(7277),p=n(8664),h=n(4165),f=n(5861),v=n(9439),m=n(3433);e=n.hmd(e);var g,y,b=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],k=["mainAxis","crossAxis","limiter"],_=null,w=!1,x="http://www.w3.org/1999/xlink",S={},E=function(e){return"object"===(e=typeof e)||"function"===e},T=function(e,t){for(var n=null,r=null,i=!1,a=!1,o=[],s=arguments.length,c=new Array(s>2?s-2:0),u=2;u<s;u++)c[u-2]=arguments[u];if(function t(r){for(var s=0;s<r.length;s++)n=r[s],Array.isArray(n)?t(n):null!=n&&"boolean"!==typeof n&&((i="function"!==typeof e&&!E(n))&&(n=String(n)),i&&a?o[o.length-1].$text$+=n:o.push(i?P(null,n):n),a=i)}(c),t){t.key&&(r=t.key);var l=t.className||t.class;l&&(t.class="object"!==typeof l?l:Object.keys(l).filter((function(e){return l[e]})).join(" "))}if("function"===typeof e)return e(null===t?{}:t,o,R);var d=P(e,null);return d.$attrs$=t,o.length>0&&(d.$children$=o),d.$key$=r,d},P=function(e,t){var n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null};return n},C={}
2,R={forEach:function(e,t){return e.map(Z).forEach(t)},map:function(e,t){return e.map(Z).map(t).map(M)}},Z=function(e){return{vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}},M=function(e){if("function"===typeof e.vtag){var t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),T.apply(void 0,[e.vtag,t].concat((0,m.Z)(e.vchildren||[])))}var n=P(e.vtag,e.vtext);return n.$attrs$=e.vattrs,n.$children$=e.vchildren,n.$key$=e.vkey,n.$name$=e.vname,n},A=function(e){return be(e).$hostElement$},I=function(e,t,n){var r=A(e);return{emit:function(e){return O(r,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}}},O=function(e,t,n){var r=Re.ce(t,n);return e.dispatchEvent(r),r},L=new WeakMap,D=function(e,t,n){var r=Te.get(e);Me&&n?"string"===typeof(r=r||new CSSStyleSheet)?r=t:r.replaceSync(t):r=t,Te.set(e,r)},N=function(e){var t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$,i=(t.$tagName$,function(){}),a=function(e,t,n,r){var i=j(t),a=Te.get(i);if(e=11===e.nodeType?e:Ce,a)if("string"===typeof a){e=e.head||e;var o,s=L.get(e);s||L.set(e,s=new Set),s.has(i)||((o=Ce.createElement("style")).innerHTML=a,e.insertBefore(o,e.querySelector("link")),s&&s.add(i))}else e.adoptedStyleSheets.includes(a)||(e.adoptedStyleSheets=[].concat((0,m.Z)(e.adoptedStyleSheets),[a]));return i}(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&r&&(n["s-sc"]=a,n.classList.add(a+"-h")),i()},j=function(e,t){return"sc-"+e.$tagName$},B=function(e,t,n,r,i,a){if(n!==r){var o=we(e,t),s=t.toLowerCase();if("class"===t){var c=e.classList,u=V(n),l=V(r);c.remove.apply(c,(0,m.Z)(u.filter((function(e){return e&&!l.includes(e)})))),c.add.apply(c,(0,m.Z)(l.filter((function(e){return e&&!u.includes(e)}))))}else if("style"===t){for(var d in n)r&&null!=r[d]||(d.includes("-")?e.style.removeProperty(d):e.style[d]="");for(var p in r)n&&r[p]===n[p]||(p.includes("-")?e.style.setProperty(p,r[p]):e.style[p]=r[p])}else if("key"===t);else if("ref"===t)r&&r(e);else if(o||"o"!==t[0]||"n"!==t[1]){var h=E(r);if((o||h&&null!==r)&&!i)try{if(e.tagName.includes("-"))e[t]=r;else{var f=null==r?"":r;"list"===t?o=!1:null!=n&&e[t]==f||(e[t]=f)}}catch(g){}var v=!1;s!==(s=s.replace(/^xlink\:?/,""))&&(t=s,v=!0),null==r||!1===r?!1===r&&""!==e.getAttribute(t)||(v?e.removeAttributeNS(x,t):e.removeAttribute(t)):(!o||4&a||i)&&!h&&(r=!0===r?"":r,v?e.setAttributeNS(x,t,r):e.setAttribute(t,r))}else t="-"===t[2]?t.slice(3):we(Pe,s)?s.slice(2):s[2]+t.slice(3),n&&Re.rel(e,t,n,!1),r&&Re.ael(e,t,r,!1)}},U=/\s/,V=function(e){return e?e.split(U):[]},F=function(e,t,n,r){var i=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,a=e&&e.$attrs$||S,o=t.$attrs$||S;for(r in a)r in o||B(i,r,a[r],void 0,n,t.$flags$);for(r in o)B(i,r,a[r],o[r],n,t.$flags$)},z=function e(t,n,r,i){var a,o,s=n.$children$[r],c=0;if(null!==s.$text$)a=s.$elm$=Ce.createTextNode(s.$text$);else if(a=s.$elm$=Ce.createElement(s.$tag$),F(null,s,false),null!=g&&a["s-si"]!==g&&a.classList.add(a["s-si"]=g),s.$children$)for(c=0;c<s.$children$.length;++c)(o=e(t,s,c))&&a.appendChild(o);return a},H=function(e,t,n,r,i,a){var o,s=e;for(s.shadowRoot&&s.tagName===y&&(s=s.shadowRoot);i<=a;++i)r[i]&&(o=z(null,n,i))&&(r[i].$elm$=o,s.insertBefore(o,t))},q=function(e,t,n,r,i){for(;t<=n;++t)(r=e[t])&&(i=r.$elm$,$(r),i.remove())},G=function(e,t,n,r){for(var i,a,o=0,s=0,c=0,u=0,l=t.length-1,d=t[0],p=t[l],h=r.length-1,f=r[0],v=r[h];o<=l&&s<=h;)if(null==d)d=t[++o];else if(null==p)p=t[--l];else if(null==f)f=r[++s];else if(null==v)v=r[--h];else if(W(d,f))J(d,f),d=t[++o],f=r[++s];else if(W(p,v))J(p,v),p=t[--l],v=r[--h];else if(W(d,v))J(d,v),e.insertBefore(d.$elm$,p.$elm$.nextSibling),d=t[++o],v=r[--h];else if(W(p,f))J(p,f),e.insertBefore(p.$elm$,d.$elm$),p=t[--l],f=r[++s];else{for(c=-1,u=o;u<=l;++u)if(t[u]&&null!==t[u].$key$&&t[u].$key$===f.$key$){c=u;break}c>=0?((a=t[c]).$tag$!==f.$tag$?i=z(t&&t[s],n,c):(J(a,f),t[c]=void 0,i=a.$elm$),f=r[++s]):(i=z(t&&t[s],n,s),f=r[++s]),i&&d.$elm$.parentNode.insertBefore(i,d.$elm$)}o>l?H(e,null==r[h+1]?null:r[h+1].$elm$,n,r,s,h):s>h&&q(t,o,l)},W=function(e,t){return e.$tag$===t.$tag$&&e.$key$===t.$key$},J=function(e,t){var n=t.$elm$=e.$elm$,r=e.$children$,i=t.$children$,a=t.$tag$,o=t.$text$;null===o?("slot"===a||F(e,t,false),null!==r&&null!==i?G(n,r,t,i):null!==i?(null!==e.$text$&&(n.textContent=""),H(n,null,t,i,0,i.length-1)):null!==r&&q(r,0,r.length-1)):e.$text$!==o&&(n.data=o)},$=function e(t){t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(e)},K=function(e,t){var n,r=e.$hostElement$,i=e.$cmpMeta$,a=e.$vnode$||P(null,null),o=(n=t)&&n.$tag$===C?t:T(null,null,t);y=r.tagName,i.$attrsToReflect$&&(o.$attrs$=o.$attrs$||{},i.$attrsToReflect$.map((function(e){var t=(0,v.Z)(e,2),n=t[0],i=t[1];return o.$attrs$[i]=r[n]}
2))),o.$tag$=null,o.$flags$|=4,e.$vnode$=o,o.$elm$=a.$elm$=r.shadowRoot||r,g=r["s-sc"],J(a,o)},Q=function(e,t){t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise((function(t){return e.$onRenderResolve$=t})))},Y=function(e,t){if(e.$flags$|=16,!(4&e.$flags$)){Q(e,e.$ancestorComponent$);return je((function(){return X(e,t)}))}e.$flags$|=512},X=function(e,t){var n,r=(e.$cmpMeta$.$tagName$,function(){}),i=e.$lazyInstance$;return t&&(e.$flags$|=256,e.$queuedListeners$&&(e.$queuedListeners$.map((function(e){var t=(0,v.Z)(e,2),n=t[0],r=t[1];return oe(i,n,r)})),e.$queuedListeners$=null),n=oe(i,"componentWillLoad")),r(),se(n,(function(){return ee(e,i,t)}))},ee=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t,n,r){var i,a,o,s,c,u;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.$hostElement$,t.$cmpMeta$.$tagName$,a=function(){},o=i["s-rc"],r&&N(t),t.$cmpMeta$.$tagName$,s=function(){},te(t,n),o&&(o.map((function(e){return e()})),i["s-rc"]=void 0),s(),a(),c=i["s-p"],u=function(){return re(t)},0===c.length?u():(Promise.all(c).then(u),t.$flags$|=4,c.length=0);case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),te=function(e,t,n){try{_=t,t=t.render(),e.$flags$&=-17,e.$flags$|=2,K(e,t)}catch(r){xe(r,e.$hostElement$)}return _=null,null},ne=function(){return _},re=function(e){e.$cmpMeta$.$tagName$;var t=e.$hostElement$,n=function(){},r=e.$lazyInstance$,i=e.$ancestorComponent$;oe(r,"componentDidRender"),64&e.$flags$?n():(e.$flags$|=64,ce(t),oe(r,"componentDidLoad"),n(),e.$onReadyResolve$(t),i||ae()),e.$onInstanceResolve$(t),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&Ne((function(){return Y(e,!1)})),e.$flags$&=-517},ie=function(e){var t=be(e),n=t.$hostElement$.isConnected;return n&&2===(18&t.$flags$)&&Y(t,!1),n},ae=function(e){ce(Ce.documentElement),Ne((function(){return O(Pe,"appload",{detail:{namespace:"dyte-ui-kit"}})}))},oe=function(e,t,n){if(e&&e[t])try{return e[t](n)}catch(r){xe(r)}},se=function(e,t){return e&&e.then?e.then(t):t()},ce=function(e){return e.classList.add("hydrated")},ue=function(e,t,n,r){var i,a,o=be(e),s=o.$hostElement$,c=o.$instanceValues$.get(t),u=o.$flags$,l=o.$lazyInstance$;i=n,a=r.$members$[t][0],n=null==i||E(i)?i:4&a?"false"!==i&&(""===i||!!i):2&a?parseFloat(i):1&a?String(i):i;var d=Number.isNaN(c)&&Number.isNaN(n);if((!(8&u)||void 0===c)&&(n!==c&&!d)&&(o.$instanceValues$.set(t,n),l)){if(r.$watchers$&&128&u){var p=r.$watchers$[t];p&&p.map((function(e){try{l[e](n,c,t)}catch(r){xe(r,s)}}))}2===(18&u)&&Y(o,!1)}},le=function(e,t,n){if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);var r=Object.entries(t.$members$),i=e.prototype;if(r.map((function(e){var r=(0,v.Z)(e,2),a=r[0],o=(0,v.Z)(r[1],1)[0];31&o||2&n&&32&o?Object.defineProperty(i,a,{get:function(){return e=a,be(this).$instanceValues$.get(e);var e},set:function(e){ue(this,a,e,t)},configurable:!0,enumerable:!0}):1&n&&64&o&&Object.defineProperty(i,a,{value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=be(this);return r.$onInstancePromise$.then((function(){var e;return(e=r.$lazyInstance$)[a].apply(e,t)}))}})})),1&n){var a=new Map;i.attributeChangedCallback=function(e,t,n){var r=this;Re.jmp((function(){var t=a.get(e);if(r.hasOwnProperty(t))n=r[t],delete r[t];else if(i.hasOwnProperty(t)&&"number"===typeof r[t]&&r[t]==n)return;r[t]=(null!==n||"boolean"!==typeof r[t])&&n}))},e.observedAttributes=r.filter((function(e){var t=(0,v.Z)(e,2);t[0];return 15&t[1][0]})).map((function(e){var n=(0,v.Z)(e,2),r=n[0],i=n[1],o=i[1]||r;return a.set(o,r),512&i[0]&&t.$attrsToReflect$.push([r,o]),o}))}}return e},de=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t,n,r,i,a){var o,s,c,u,l,d,p;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==(32&n.$flags$)){e.next=18;break}if(n.$flags$|=32,!(a=Ee(r)).then){e.next=9;break}return o=function(){},e.next=7,a;case 7:a=e.sent,o();case 9:a.isProxied||(r.$watchers$=a.watchers,le(a,r,2),a.isProxied=!0),r.$tagName$,s=function(){},n.$flags$|=8;try{new a(n)}catch(t){xe(t)}
2n.$flags$&=-9,n.$flags$|=128,s(),pe(n.$lazyInstance$),a.style&&(c=a.style,u=j(r),Te.has(u)||(r.$tagName$,l=function(){},D(u,c,!!(1&r.$flags$)),l()));case 18:d=n.$ancestorComponent$,p=function(){return Y(n,!0)},d&&d["s-rc"]?d["s-rc"].push(p):p();case 21:case"end":return e.stop()}}),e)})));return function(t,n,r,i,a){return e.apply(this,arguments)}}(),pe=function(e){oe(e,"connectedCallback")},he=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(){},i=[],a=n.exclude||[],o=Pe.customElements,h=Ce.head,f=h.querySelector("meta[charset]"),m=Ce.createElement("style"),g=[],y=!0;Object.assign(Re,n),Re.$resourcesUrl$=new URL(n.resourcesUrl||"./",Ce.baseURI).href,e.map((function(e){e[1].map((function(n){var r={$flags$:n[0],$tagName$:n[1],$members$:n[2],$listeners$:n[3]};r.$members$=n[2],r.$listeners$=n[3],r.$attrsToReflect$=[],r.$watchers$={};var h=r.$tagName$,f=function(e){(0,l.Z)(i,e);var n=(0,d.Z)(i);function i(e){var t;return(0,s.Z)(this,i),t=n.call(this,e),e=(0,u.Z)(t),_e(e,r),1&r.$flags$&&e.attachShadow({mode:"open"}),t}return(0,c.Z)(i,[{key:"connectedCallback",value:function(){var e=this;t&&(clearTimeout(t),t=null),y?g.push(this):Re.jmp((function(){return function(e){if(0===(1&Re.$flags$)){var t=be(e),n=t.$cmpMeta$,r=(n.$tagName$,function(){});if(1&t.$flags$)fe(e,t,n.$listeners$),pe(t.$lazyInstance$);else{t.$flags$|=1;for(var i=e;i=i.parentNode||i.host;)if(i["s-p"]){Q(t,t.$ancestorComponent$=i);break}n.$members$&&Object.entries(n.$members$).map((function(t){var n=(0,v.Z)(t,2),r=n[0];if(31&(0,v.Z)(n[1],1)[0]&&e.hasOwnProperty(r)){var i=e[r];delete e[r],e[r]=i}})),de(e,t,n)}r()}}(e)}))}},{key:"disconnectedCallback",value:function(){var e=this;Re.jmp((function(){return function(e){if(0===(1&Re.$flags$)){var t=be(e),n=t.$lazyInstance$;t.$rmListeners$&&(t.$rmListeners$.map((function(e){return e()})),t.$rmListeners$=void 0),oe(n,"disconnectedCallback")}}(e)}))}},{key:"componentOnReady",value:function(){return be(this).$onReadyPromise$}}]),i}((0,p.Z)(HTMLElement));r.$lazyBundleId$=e[0],a.includes(h)||o.get(h)||(i.push(h),o.define(h,le(f,r,1)))}))})),m.innerHTML=i+"{visibility:hidden}.hydrated{visibility:inherit}",m.setAttribute("data-styles",""),h.insertBefore(m,f?f.nextSibling:h.firstChild),y=!1,g.length?g.map((function(e){return e.connectedCallback()})):Re.jmp((function(){return t=setTimeout(ae,30)})),r()},fe=function(e,t,n,r){n&&n.map((function(n){var r=(0,v.Z)(n,3),i=r[0],a=r[1],o=r[2],s=me(e,i),c=ve(t,o),u=ge(i);Re.ael(s,a,c,u),(t.$rmListeners$=t.$rmListeners$||[]).push((function(){return Re.rel(s,a,c,u)}))}))},ve=function(e,t){return function(n){try{256&e.$flags$?e.$lazyInstance$[t](n):(e.$queuedListeners$=e.$queuedListeners$||[]).push([t,n])}catch(r){xe(r)}}},me=function(e,t){return 8&t?Pe:e},ge=function(e){return 0!==(2&e)},ye=new WeakMap,be=function(e){return ye.get(e)},ke=function(e,t){return ye.set(t.$lazyInstance$=e,t)},_e=function(e,t){var n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return n.$onInstancePromise$=new Promise((function(e){return n.$onInstanceResolve$=e})),n.$onReadyPromise$=new Promise((function(e){return n.$onReadyResolve$=e})),e["s-p"]=[],e["s-rc"]=[],fe(e,n,t.$listeners$),ye.set(e,n)},we=function(e,t){return t in e},xe=function(e,t){return(0,console.error)(e,t)},Se=new Map,Ee=function(e,t,r){var i=e.$tagName$.replace(/-/g,"_"),a=e.$lazyBundleId$,o=Se.get(a);if(o)return o[i];if(!r||!BUILD.hotModuleReplacement){var s=function(e){return Se.set(a,e),e[i]};switch(a){case"dyte-meeting":return Promise.resolve().then((function(){return ei})).then(s,xe);case"dyte-breakout-rooms-manager":return Promise.resolve().then((function(){return Ei})).then(s,xe);case"dyte-breakout-rooms-toggle":return Promise.resolve().then((function(){return Mi})).then(s,xe);case"dyte-broadcast-message-modal":return Promise.resolve().then((function(){return Ii})).then(s,xe);case"dyte-camera-toggle":return Promise.resolve().then((function(){return Li})).then(s,xe);case"dyte-chat":return Promise.resolve().then((function(){return Ui})).then(s,xe);case"dyte-chat-toggle":return Promise.resolve().then((function(){return Gi})).then(s,xe);case"dyte-clock":return Promise.resolve().then((function(){return $i})).then(s,xe);case"dyte-confirmation-modal":return Promise.resolve().then((function(){return Qi})).then(s,xe);case"dyte-controlbar":return Promise.resolve().then((function(){return Xi})).then(s,xe);
2case"dyte-dialog-manager":return Promise.resolve().then((function(){return ta})).then(s,xe);case"dyte-ended-screen":return Promise.resolve().then((function(){return ra})).then(s,xe);case"dyte-fullscreen-toggle":return Promise.resolve().then((function(){return la})).then(s,xe);case"dyte-grid":return Promise.resolve().then((function(){return ka})).then(s,xe);case"dyte-grid-pagination":return Promise.resolve().then((function(){return wa})).then(s,xe);case"dyte-header":return Promise.resolve().then((function(){return Sa})).then(s,xe);case"dyte-idle-screen":return Promise.resolve().then((function(){return Ta})).then(s,xe);case"dyte-image-viewer":return Promise.resolve().then((function(){return Oa})).then(s,xe);case"dyte-leave-button":return Promise.resolve().then((function(){return Da})).then(s,xe);case"dyte-leave-meeting":return Promise.resolve().then((function(){return ja})).then(s,xe);case"dyte-livestream-indicator":return Promise.resolve().then((function(){return Ua})).then(s,xe);case"dyte-livestream-toggle":return Promise.resolve().then((function(){return Fa})).then(s,xe);case"dyte-meeting-title":return Promise.resolve().then((function(){return Ha})).then(s,xe);case"dyte-mic-toggle":return Promise.resolve().then((function(){return Ga})).then(s,xe);case"dyte-mixed-grid":return Promise.resolve().then((function(){return Ja})).then(s,xe);case"dyte-more-toggle":return Promise.resolve().then((function(){return Ka})).then(s,xe);case"dyte-mute-all-button":return Promise.resolve().then((function(){return Ya})).then(s,xe);case"dyte-mute-all-confirmation":return Promise.resolve().then((function(){return eo})).then(s,xe);case"dyte-name-tag":return Promise.resolve().then((function(){return no})).then(s,xe);case"dyte-network-indicator":return Promise.resolve().then((function(){return ao})).then(s,xe);case"dyte-notifications":return Promise.resolve().then((function(){return fo})).then(s,xe);case"dyte-participant-count":return Promise.resolve().then((function(){return mo})).then(s,xe);case"dyte-participant-setup":return Promise.resolve().then((function(){return yo})).then(s,xe);case"dyte-participants":return Promise.resolve().then((function(){return ko})).then(s,xe);case"dyte-participants-audio":return Promise.resolve().then((function(){return xo})).then(s,xe);case"dyte-participants-stage-list":return Promise.resolve().then((function(){return Eo})).then(s,xe);case"dyte-participants-stage-queue":return Promise.resolve().then((function(){return Po})).then(s,xe);case"dyte-participants-toggle":return Promise.resolve().then((function(){return Ro})).then(s,xe);case"dyte-participants-viewer-list":return Promise.resolve().then((function(){return Mo})).then(s,xe);case"dyte-participants-waiting-list":return Promise.resolve().then((function(){return Io})).then(s,xe);case"dyte-permissions-message":return Promise.resolve().then((function(){return Lo})).then(s,xe);case"dyte-pip-toggle":return Promise.resolve().then((function(){return No})).then(s,xe);case"dyte-plugin-main":return Promise.resolve().then((function(){return Bo})).then(s,xe);case"dyte-plugins":return Promise.resolve().then((function(){return Vo})).then(s,xe);case"dyte-plugins-toggle":return Promise.resolve().then((function(){return zo})).then(s,xe);case"dyte-polls":return Promise.resolve().then((function(){return Go})).then(s,xe);case"dyte-polls-toggle":return Promise.resolve().then((function(){return Jo})).then(s,xe);case"dyte-recording-indicator":return Promise.resolve().then((function(){return Ko})).then(s,xe);case"dyte-recording-toggle":return Promise.resolve().then((function(){return Yo})).then(s,xe);case"dyte-remote-access-manager":return Promise.resolve().then((function(){return es})).then(s,xe);case"dyte-screen-share-toggle":return Promise.resolve().then((function(){return rs})).then(s,xe);case"dyte-screenshare-view":return Promise.resolve().then((function(){return as})).then(s,xe);case"dyte-settings":return Promise.resolve().then((function(){return ss})).then(s,xe);case"dyte-settings-toggle":return Promise.resolve().then((function(){return us})).then(s,xe);case"dyte-setup-screen":return Promise.resolve().then((function(){return ds})).then(s,xe);case"dyte-sidebar":return Promise.resolve().then((function(){return hs}
2)).then(s,xe);case"dyte-simple-grid":return Promise.resolve().then((function(){return vs})).then(s,xe);case"dyte-spotlight-grid":return Promise.resolve().then((function(){return gs})).then(s,xe);case"dyte-stage":return Promise.resolve().then((function(){return bs})).then(s,xe);case"dyte-stage-toggle":return Promise.resolve().then((function(){return _s})).then(s,xe);case"dyte-text-field":return Promise.resolve().then((function(){return xs})).then(s,xe);case"dyte-viewer-count":return Promise.resolve().then((function(){return Es})).then(s,xe);case"dyte-waiting-screen":return Promise.resolve().then((function(){return Ps})).then(s,xe);case"dyte-webinar-stage-toggle":return Promise.resolve().then((function(){return Rs})).then(s,xe);case"dyte-breakout-room-manager_3":return Promise.resolve().then((function(){return Is})).then(s,xe);case"dyte-chat-composer-ui_4":return Promise.resolve().then((function(){return Bs})).then(s,xe);case"dyte-join-stage_2":return Promise.resolve().then((function(){return Fs})).then(s,xe);case"dyte-livestream-player":return Promise.resolve().then((function(){return Hs})).then(s,xe);case"dyte-notification":return Promise.resolve().then((function(){return Gs})).then(s,xe);case"dyte-poll_2":return Promise.resolve().then((function(){return $s})).then(s,xe);case"dyte-settings-audio_2":return Promise.resolve().then((function(){return Ys})).then(s,xe);case"dyte-tab-bar":return Promise.resolve().then((function(){return tc})).then(s,xe);case"dyte-audio-visualizer_2":return Promise.resolve().then((function(){return cc})).then(s,xe);case"dyte-chat-message_2":return Promise.resolve().then((function(){return Ec})).then(s,xe);case"dyte-dialog":return Promise.resolve().then((function(){return Pc})).then(s,xe);case"dyte-emoji-picker":return Promise.resolve().then((function(){return Zc})).then(s,xe);case"dyte-participant":return Promise.resolve().then((function(){return Ac})).then(s,xe);case"dyte-participant-tile":return Promise.resolve().then((function(){return Oc})).then(s,xe);case"dyte-spotlight-indicator":return Promise.resolve().then((function(){return Dc})).then(s,xe);case"dyte-logo":return Promise.resolve().then((function(){return jc})).then(s,xe);case"dyte-file-message_3":return Promise.resolve().then((function(){return qc})).then(s,xe);case"dyte-menu_3":return Promise.resolve().then((function(){return Xu})).then(s,xe);case"dyte-avatar":return Promise.resolve().then((function(){return tl})).then(s,xe);case"dyte-controlbar-button":return Promise.resolve().then((function(){return rl})).then(s,xe);case"dyte-tooltip":return Promise.resolve().then((function(){return al})).then(s,xe);case"dyte-spinner":return Promise.resolve().then((function(){return sl})).then(s,xe);case"dyte-button":return Promise.resolve().then((function(){return ul})).then(s,xe);case"dyte-icon":return Promise.resolve().then((function(){return pl})).then(s,xe)}}return n(8654)("./".concat(a,".entry.js")).then((function(e){return Se.set(a,e),e[i]}),xe)},Te=new Map,Pe="undefined"!==typeof window?window:{},Ce=Pe.document||{head:{}},Re={$flags$:0,$resourcesUrl$:"",jmp:function(e){return e()},raf:function(e){return requestAnimationFrame(e)},ael:function(e,t,n,r){return e.addEventListener(t,n,r)},rel:function(e,t,n,r){return e.removeEventListener(t,n,r)},ce:function(e,t){return new CustomEvent(e,t)}},Ze=function(e){return Promise.resolve(e)},Me=function(){try{return new CSSStyleSheet,"function"===typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1}(),Ae=[],Ie=[],Oe=function(e,t){return function(n){e.push(n),w||(w=!0,t&&4&Re.$flags$?Ne(De):Re.raf(De))}},Le=function(e){for(var t=0;t<e.length;t++)try{e[t](performance.now())}catch(n){xe(n)}e.length=0},De=function e(){Le(Ae),Le(Ie),(w=Ae.length>0)&&Re.raf(e)},Ne=function(e){return Ze().then(e)},je=Oe(Ie,!0),Be=function(e,t){return"undefined"===typeof window?Promise.resolve():Ze().then((function(){return he(JSON.parse('[["dyte-chat",[[1,"dyte-chat",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"t":[16],"disablePrivateChat":[4,"disable-private-chat"],"privatePresetFilter":[16],"unreadCountGroups":[32],"chatGroups":[32],"selectedGroup":[32],"now":[32],"dropzoneActivated":[32],"showLatestMessageButton":[32],"canSend":[32],"canSendTextMessage":[32],"canSendFiles":[32],"canPrivateMessage":[32],"canSendPrivateTexts":[32],"canSendPrivateFiles":[32],"emojiPickerEnabled":[32],"chatRecipientId":[32],"participants":[32],"selectedParticipant":[32]}]]],["dyte-breakout-rooms-manager",[[1,"dyte-breakout-rooms-manager",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"loading":[32],"roomConfig":[32],"draftState":[32],"assigningParticipants":[32],"selectedParticipants":[32],"ephemeralStatusText":[32],"isDragMode":[32]},[[0,"participantDelete","onParticipantDelete"],[0,"participantsDragging","toggleDragMode"],[0,"selectedParticipantsUpdate","updateSelectedParticipants"],[0,"allParticipantsToggleUpdate","updateAllParticipants"]]]]],["dyte-participants-stage-list",[[1,"dyte-participants-stage-list",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"view":[1],"t":[16],"search":[1],"participants":[32],"showStageList":[32]}]]],["dyte-participants-viewer-list",[[1,"dyte-participants-viewer-list",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"view":[1],"search":[1],"t":[16],"stageViewers":[32]}]]],["dyte-settings",[[1,"dyte-settings",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"activeTab":[32],"isMobileMainVisible":[32],"networkStatus":[32],"canProduceVideo":[32]}]]],["dyte-screenshare-view",[[1,"dyte-screenshare-view",{"hideFullScreenButton":[4,"hide-full-screen-button"],"nameTagPosition":[513,"name-tag-position"],"participant":[16],"meeting":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"videoExpanded":[32],"screenShareEnabled":[32],"isFullScreen":[32],"remoteControlInfo":[32]}]]],["dyte-dialog-manager",[[1,"dyte-dialog-manager",{"meeting":[16],"config":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16]}]]],["dyte-mixed-grid",[[1,"dyte-mixed-grid",{"layout":[513],"participants":[16],"pinnedParticipants":[16],"screenShareParticipants":[16],"plugins":[16],"aspectRatio":[1,"aspect-ratio"],"gap":[2],"size":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"gridSize":[16],"activeTab":[32],"initialised":[32]}]]],["dyte-participants-stage-queue",[[1,"dyte-participants-stage-queue",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"view":[1],"t":[16],"stageRequestedParticipants":[32]}]]],["dyte-participants-waiting-list",[[1,"dyte-participants-waiting-list",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"view":[1],"t":[16],"w
2aitlistedParticipants":[32]}]]],["dyte-polls",[[1,"dyte-polls",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"t":[16],"create":[32],"polls":[32]}]]],["dyte-camera-toggle",[[1,"dyte-camera-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"videoEnabled":[32],"canProduceVideo":[32],"cameraPermission":[32]}]]],["dyte-grid",[[1,"dyte-grid",{"layout":[513],"aspectRatio":[513,"aspect-ratio"],"meeting":[16],"gap":[514],"size":[513],"states":[16],"config":[16],"iconPack":[16],"t":[16],"gridSize":[16],"overrides":[8],"participants":[32],"pinnedParticipants":[32],"screenShareParticipants":[32],"plugins":[32],"showWebinarStage":[32],"showLiveStreamPlayer":[32],"canCurrentPeerHost":[32],"connected":[32],"pipSupported":[32],"pipEnabled":[32]}]]],["dyte-mic-toggle",[[1,"dyte-mic-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"audioEnabled":[32],"canProduceAudio":[32],"micPermission":[32]}]]],["dyte-mute-all-button",[[1,"dyte-mute-all-button",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16]}]]],["dyte-remote-access-manager",[[1,"dyte-remote-access-manager",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"acceptedRequestId":[32]}]]],["dyte-screen-share-toggle",[[1,"dyte-screen-share-toggle",{"states":[16],"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"maxScreenShareCount":[32],"screenShareCount":[32],"screenShareEnabled":[32],"canScreenShare":[32],"shareScreenPermission":[32],"screenShareState":[32]}]]],["dyte-stage-toggle",[[1,"dyte-stage-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"stageStatus":[32],"state":[32]}]]],["dyte-webinar-stage-toggle",[[1,"dyte-webinar-stage-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"stageStatus":[32],"canPresent":[32],"requestProduce":[32]}]]],["dyte-breakout-rooms-toggle",[[1,"dyte-breakout-rooms-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16]}]]],["dyte-chat-toggle",[[1,"dyte-chat-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"unreadMessageCount":[32],"chatActive":[32],"canViewChat":[32],"hasNewMessages":[32]}]]],["dyte-fullscreen-toggle",[[1,"dyte-fullscreen-toggle",{"states":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"fullScreenActive":[32],"isFullScreenSupported":[32]}]]],["dyte-grid-pagination",[[1,"dyte-grid-pagination",{"meeting":[16],"states":[16],"size":[513],"variant":[513],"iconPack":[16],"t":[16],"page":[32],"pageCount":[32],"activeCount":[32],"activeComputedCount":[32],"showPagination":[32]}]]],["dyte-idle-screen",[[1,"dyte-idle-screen",{"meeting":[16],"config":[16],"iconPack":[16],"t":[16]}]]],["dyte-leave-button",[[1,"dyte-leave-button",{"variant":[513],"size":[513],"iconPack":[16],"t":[16]}]]],["dyte-livestream-toggle",[[1,"dyte-livestream-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"livestreamState":[32]}]]],["dyte-more-toggle",[[1,"dyte-more-toggle",{"states":[16],"size":[513],"iconPack":[16],"t":[16]}]]],["dyte-notifications",[[1,"dyte-notifications",{"meeting":[16],"states":[16],"config":[16],"t":[16],"size":[513],"iconPack":[16],"notifications":[32]},[[8,"dyteAPIError","apiErrorListener"]]]]],["dyte-participants-audio",[[1,"dyte-participants-audio",{"meeting":[16],"iconPack":[16],"t":[16],"showPlayDialog":[32]}]]],["dyte-participants-toggle",[[1,"dyte-participants-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"participantsActive":[32],"waitlistedParticipants":[32],"stageRequestedParticipants":[32],"canViewParticipants":[32]}]]],["dyte-pip-toggle",[[1,"dyte-pip-toggle",{"variant":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"size":[513],"t":[16],"pipEnabled":[32],"pipSupported":[32]}]]],["dyte-plugins-toggle",[[1,"dyte-plugins-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"pluginsActive":[32],"canViewPlugins":[32]}]]],["dyte-polls-toggle",[[1,"dyte-polls-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"pollsActive":[32],"unreadPollsCount":[32],"canViewPolls":[32]}]]],["dyte-recording-toggle",[[1,"dyte-recording-toggle",{"variant":[513],"meeting":[16],"t":[16],"iconPack":[16],"size":[513],"disabled":[4],"recordingState":[32],"canRecord":[32]}]]],["dyte-settings-toggle",[[1,"dyte-settings-toggle",{"variant":[513],"states":[16],"size":[513],"iconPack":[16],"t":[16]}]]],["dyte-setup-screen",[[1,"dyte-setup-screen",{"meeting":[16],"size":[513],"config":[16],"iconPack":[16],"t":[16],"displayName":[32],"isJoining":[32],"canEditName":[32]}]]],["dyte-broadcast-message-modal",[[1,"dyte-broadcast-message-modal",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"messagePayload":[32],"successMessage":[32]}]]],["dyte-ended-screen",[[1,"dyte-ended-screen",{"config":[16],"size":[513],"states":[16],"t":[16],"iconPack":[16],"meeting":[16],"icon":[32],"message":[32]}]]],["dyte-image-viewer",[[1,"dyte-image-viewer",{"image":[16],"size":[513],"t":[16],"iconPack":[16]}]]],["dyte-permissions-message",[[1,"dyte-permissions-message",{"meeting":[16],"t":[16],"iconPack":[16],"device":[32]}]]],["dyte-plugin-main",[[1,"dyte-plugin-main",{"meeting":[16],"plugin":[16],"iconPack":[16],"t":[16],"canClosePlugin":[32],"canControl":[32],"viewModeEnabled":[32]}]]],["dyte-plugins",[[1,"dyte-plugins",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"t":[16],"plugins":[32],"canStartPlugins":[32],"canClosePlugin":[32],"activatedPluginsId":[32]}]]],["dyte-sidebar",[[1,"dyte-sidebar",{"enabledSections":[16],"defaultSection":[1,"default-section"],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"size":[513],"view":[513],"tab":[32]}]]],["dyte-clock",[[1,"dyte-clock",{"meeting":[16],"iconPack":[16],"t":[16],"startedTime":[32],"timeDiff":[32]}]]],["dyte-confirmation-modal",[[1,"dyte-confirmation-modal",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16]}]]],["dyte-leave-meeting",[[1,"dyte-leave-meeting",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"canEndMeeting":[32]}]]],["dyte-livestream-indicator",[[1,"dyte-livestream-indicator",{"meeting":[16],"size":[513],"t":[16],"iconPack":[16],"isLivestreaming":[32]}]]],["dyte-meeting-title",[[1,"dyte-meeting-title",{"meeting":[16],"iconPack":[16],"t":[16]}]]],["dyte-mute-all-confirmation",[[1,"dyte-mute-all-confirmation",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"allowUnmute":[32]}]]],["dyte-network-indicator",[[1,"dyte-network-indicator",{"participant":[16],"meeting":[16],"iconPack":[16],"t":[16],"isScreenShare":[4,"is-screen-share"],"score":[32]}]]],["dyte-participant-count",[[1,"dyte-participant-count",{"meeting":[16],"iconPack":[16],"t":[16],"participantCount":[32]}]]],["dyte-participant-setup",[[1,"dyte-participant-setup",{"nameTagPosition":[513,"name-tag-position"],"isPreview":[4,"is-preview"],"participant":[16],"states":[16],"config":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"videoState":[32],"isPinned":[32]}]]],["dyte-participants",[[1,"dyte-participants",{"meeting":[16],"states":[16],"config":[16],"size":[513],"iconPack":[16],"t":[16],"search":[32]}]]],["dyte-recording-indicator",[[1,"dyte-recording-indicator",{"meeting":[16],"size":[513],"t":[16],"iconPack":[16],"isRecording":[32]}]]],["dyte-viewer-count",[[1,"dyte-viewer-count",{"meeting":[16],"iconPack":[16],"t":[16],"viewerCount":[32]}]]],["dyte-waiting-screen",[[1,"dyte-waiting-screen",{"meeting":[16],"config":[16],"iconPack":[16],"t":[16]}]]],["dyte-controlbar",[[1,"dyte-controlbar",{"variant":[513],"disableRender":[4,"disable-render"],"meeting":[16],"config":[16],"states":[16],"iconPack":[16],"t":[16],"size":[513]}]]],["dyte-header",[[1,"dyte-header",{"variant":[513],"disableRender":[4,"disable-render"],"meeting":[16],"config":[16],"states":[16],"iconPack":[16],"t":[16],"size":[513]}]]],["dyte-meeting",[[1,"dyte-meeting",{"loadConfigFromPreset":[4,"load-config-from-preset"],"applyDesignSystem":[4,"apply-design-system"],"mode":[513],"leaveOnUnmount":[4,"leave-on-unmount"],"meeting":[16],"showSetupScreen":[1028,"show-setup-screen"],"t":[16],"config":[1040],"iconPackUrl":[513,"icon-pack-url"],"size":[1537],"gridLayout":[1,"grid-layout"],"states":[32],"newMeeting":[32],"iconPack":[32]},[[0,"dyteStateUpdate","listenState"]]]]],["dyte-name-tag",[[1,"dyte-name-tag",{"participant":[16],"meeting":[16],"size":[513],"maxLength":[2,"max-length"],"isScreenShare":[4,"is-screen-share"],"iconPack":[16],"t":[16],"length":[32]}]]],["dyte-simple-grid",[[1,"dyte-simple-grid",{"participants":[16],"aspectRatio":[1,"aspect-ratio"],"gap":[2],"size":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"dimensions":[32]}]]],["dyte-spotlight-grid",[[1,"dyte-spotlight-grid",{"layout":[513],"participants":[16],"pinnedParticipants":[16],"aspectRatio":[1,"aspect-ratio"],"gap":[2],"size":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"gridSize":[16]}]]],["dyte-stage",[[1,"dyte-stage",{"iconPack":[16],"t":[16]}]]],["dyte-text-field",[[1,"dyte-text-field",{"type":[1],"placeholder":[1],"disabled":[4],"iconPack":[16],"t":[16]}]]],["dyte-tooltip",[[1,"dyte-tooltip",{"label":[1],"variant":[513],"disabled":[516],"open":[516],"kind":[513],"size":[513],"placement":[1],"delay":[2],"iconPack":[16],"t":[16],"isInFocus":[32]}]]],["dyte-button",[[1,"dyte-button",{"size":[513],"variant":[513],"kind":[513],"reverse":[516],"disabled":[516],"iconPack":[16],"t":[16]}]]],["dyte-icon",[[1,"dyte-icon",{"icon":[1],"iconPack":[16],"t":[16]}]]],["dyte-tab-bar",[[1,"dyte-tab-bar",{"size":[513],"meeting":[16],"states":[16],"config":[16],"layout":[513],"iconPack":[16],"t":[16],"activeTab":[16],"tabs":[16]}]]],["dyte-livestream-player",[[1,"dyte-livestream-player",{"meeting":[16],"size":[513],"t":[16],"iconPack":[16],"playbackUrl":[32],"isSupported":[32],"playerState":[32],"livestreamState":[32],"playerError":[32],"latency":[32],"audioPlaybackError":[32]}]]],["dyte-notification",[[1,"dyte-notification",{"notification":[16],"size":[513],"iconPack":[16],"t":[16],"imageState":[32]}]]],["dyte-settings-audio_2",[[1,"dyte-settings-audio",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"audioDevices":[32],"speakerDevices":[32],"canProduceAudio":[32]}],[1,"dyte-settings-video",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"videoDevices":[32],"currentDevice":[32],"videoEnabled":[32]}]]],["dyte-participant",[[1,"dyte-participant",{"meeting":[16],"view":[1],"participant":[16],"iconPack":[16],"t":[16],"audioEnabled":[32],"videoEnabled":[32],"isPinned":[32],"isOnStage":[32],"canDisableParticipantAudio":[32],"canDisableParticipantVideo":[32],"canKickParticipant":[32],"canPinParticipant":[32],"canAllowParticipantOnStage":[32]}]]],["dyte-poll_2",[[1,"dyte-poll-form",{"iconPack":[16],"t":[16],"options":[32],"anonymous":[32],"hideVotes":[32],"error":[32]}],[1,"dyte-poll",{"poll":[16],"self":[1],"permissions":[16],"iconPack":[16],"t":[16]}]]],["dyte-emoji-picker",[[1,"dyte-emoji-picker",{"iconPack":[16],"t":[16],"emojiList":[32],"filterVal":[32],"filteredEmojis":[32]}]]],["dyte-join-stage_2",[[1,"dyte-join-stage",{"meeting":[16],"config":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"dataConfig":[16]}],[1,"dyte-overlay-modal",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16]}]]],["dyte-dialog",[[1,"dyte-dialog",{"hideCloseButton":[4,"hide-close-button"],"meeting":[16],"config":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"open":[1540]}]]],["dyte-spotlight-indicator",[[1,"dyte-spotlight-indicator",{"meeting":[16],"iconPack":[16],"t":[16],"size":[513],"canSpotlight":[32],"isSpotlighted":[32]}]]],["dyte-participant-tile",[[1,"dyte-participant-tile",{"nameTagPosition":[513,"name-tag-position"],"isPreview":[4,"is-preview"],"participant":[16],"meeting":[16],"states":[16],"config":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"videoState":[32],"isPinned":[32]}]]],["dyte-breakout-room-manager_3",[[1,"dyte-breakout-room-manager",{"meeting":[16],"assigningParticipants":[4,"assigning-participants"],"mode":[1],"states":[16],"allowDelete":[4,"allow-delete"],"iconPack":[16],"t":[16],"isDragMode":[4,"is-drag-mode"],"room":[16],"defaultExpanded":[4,"default-expanded"],"editingTitleRoomId":[32],"newTitle":[32],"showExpandedCard":[32],"glowingCard":[32]}],[1,"dyte-breakout-room-participants",{"meeting":[16],"participantIds":[16],"iconPack":[16],"t":[16],"selectedParticipantIds":[16],"search":[32],"participantsToShow":[32],"isDragging":[32]}],[1,"dyte-counter",{"size":[513],"value":[2],"minValue":[2,"min-value"],"iconPack":[16],"t":[16],"input":[32]}]]],["dyte-logo",[[1,"dyte-logo",{"logoUrl":[1025,"logo-url"],"config":[16],"meeting":[16],"t":[16]}]]],["dyte-spinner",[[1,"dyte-spinner",{"iconPack":[16],"size":[513],"t":[16]}]]],["dyte-file-message_3",[[0,"dyte-image-message",{"message":[16],"now":[16],"isContinued":[516,"is-continued"],"iconPack":[16],"t":[16],"status":[32]}],[0,"dyte-file-message",{"message":[16],"now":[16],"isContinued":[516,"is-continued"],"iconPack":[16],"t":[16]}],[0,"dyte-text-message",{"message":[16],"now":[16],"isContinued":[516,"is-continued"],"iconPack":[16],"t":[16]}]]],["dyte-chat-message_2",[[1,"dyte-chat-message",{"messageItem":[16],"isContinued":[4,"is-continued"],"isUnread":[4,"is-unread"],"observeMessage":[16],"size":[513],"iconPack":[16],"t":[16],"now":[32]}],[1,"dyte-paginated-list",{"pageSize":[2,"page-size"],"pagesAllowed":[2,"pages-allowed"],"fetchData":[16],"createNodes":[16],"iconPack":[16],"t":[16],"rerenderBoolean":[32],"shouldRenderNewNodes":[32],"hasNewNodesToRender":[32],"pagesToRender":[32],"onNewNode":[64]}]]],["dyte-chat-composer-ui_4",[[1,"dyte-chat-messages-ui-paginated",{"meeting":[16],"size":[513],"iconPack":[16],"t":[16]}],[1,"dyte-chat-messages-ui",{"selectedGroup":[1,"selected-group"],"messages":[16],"selfUserId":[1,"self-user-id"],"size":[513],"iconPack":[16],"t":[16],"now":[32],"showLatestMessageButton":[32]}],[1,"dyte-chat-composer-ui",{"canSendTextMessage":[4,"can-send-text-message"],"canSendFiles":[4,"can-send-files"],"size":[513],"iconPack":[16],"t":[16],"disableEmojiPicker":[4,"disable-emoji-picker"],"emojiPickerActive":[32]}],[1,"dyte-chat-selector-ui",{"selfUserId":[1,"self-user-id"],"selectedGroupId":[1,"selected-group-id"],"unreadCounts":[16],"groups":[16],"iconPack":[16],"t":[16],"showParticipantsPanel":[32],"query":[32]}]]],["dyte-audio-visualizer_2",[[1,"dyte-audio-visualizer",{"variant":[513],"participant":[16],"size":[513],"iconPack":[16],"t":[16],"isScreenShare":[4,"is-screen-share"],"audioEnabled":[32],"volume":[32]}],[1,"dyte-switch",{"checked":[1028],"readonly":[4],"disabled":[516],"iconPack":[16],"t":[16]}]]],["dyte-avatar",[[1,"dyte-avatar",{"participant":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"imageState":[32]}]]],["dyte-menu_3",[[1,"dyte-menu",{"size":[513],"placement":[1],"iconPack":[16],"t":[16]}],[1,"dyte-menu-item",{"size":[513],"iconPack":[16],"t":[16]}],[1,"dyte-menu-list",{"iconPack":[16],"t":[16]}]]],["dyte-controlbar-button",[[1,"dyte-controlbar-button",{"variant":[513],"showWarning":[4,"show-warning"],"size":[513],"label":[1],"icon":[1],"isLoading":[4,"is-loading"],"disabled":[516],"iconPack":[16],"t":[16]}]]]]'),t)}))},Ue={designTokens:{spacingBase:4,googleFont:"Inter"},styles:{"dyte-header":{display:"grid",height:"48px",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"dyte-header.sm":{display:"grid",gridArea:"header",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"div#header-left":{display:"flex",alignItems:"center",height:"48px",wordBreak:"break-all"},"dyte-logo":{height:"26px"},"div#header-center":{display:"flex",alignItems:"center",justifyContent:"center",wordBreak:"break-all"},"div#header-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-stage":{display:"flex",flex:"1"},"dyte-grid":{flex:"1",height:"auto"},"dyte-controlbar":{display:"grid",height:"76px",gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"1fr",alignItems:"center",padding:"8px"},"dyte-controlbar.sm":{display:"flex",position:"relative",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))"},"
2dyte-controlbar.md":{display:"flex",position:"relative",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))"},"div#controlbar-left":{display:"flex",alignItems:"center"},"div#controlbar-center":{display:"flex",alignItems:"center",justifyContent:"center"},"div#controlbar-mobile":{display:"flex",flex:"1",alignItems:"center",justifyContent:"center"},"div#controlbar-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-settings":{width:"720px",height:"480px"},"dyte-breakout-rooms-manager":{minHeight:"400px",minWidth:"500px",maxWidth:"80%",maxHeight:"480px"},"div#more-menu":{position:"absolute",boxSizing:"border-box",top:"0",left:"0",width:"100%",transform:"translateY(-100%)",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))",padding:"16px 12px",borderRadius:"18px 18px 0 0"},"div#setupcontrols-media":{position:"absolute",bottom:"8px",right:"8px",display:"flex"},"div#setupcontrols-settings":{position:"absolute",top:"8px",right:"8px"},"dyte-meeting-title.sm":{marginLeft:"0"},"dyte-clock":{marginRight:"0"}},root:{"dyte-meeting":{state:"meeting",states:["activeSidebar"]},"dyte-meeting[meeting=waiting]":["dyte-waiting-screen"],"dyte-meeting[meeting=idle]":["dyte-idle-screen"],"dyte-meeting[meeting=setup]":["dyte-setup-screen","dyte-dialog-manager"],"dyte-meeting[meeting=joined]":["dyte-header","dyte-stage","dyte-controlbar","dyte-participants-audio","dyte-dialog-manager"],"dyte-meeting[meeting=joined].activeSidebar.sm":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=joined].activeSidebar.md":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=ended]":["dyte-ended-screen"],"dyte-header":["div#header-left","div#header-center","div#header-right"],"dyte-header.sm":{remove:["div#header-center"]},"div#header-left":["dyte-logo","dyte-recording-indicator","dyte-livestream-indicator"],"div#header-center":["dyte-meeting-title"],"div#header-right":["dyte-grid-pagination","dyte-clock","dyte-participant-count","dyte-viewer-count"],"div#header-left.sm":["dyte-meeting-title","dyte-recording-indicator","dyte-livestream-indicator"],"dyte-stage":{states:["activeSidebar"],children:["dyte-grid","dyte-notifications"]},"dyte-stage.activeSidebar":{add:[["dyte-sidebar",{view:"sidebar"}]]},"dyte-stage.activeSidebar.sm":{remove:["dyte-sidebar"]},"dyte-grid":{states:["activeScreenShare","activePlugin","activeSpotlight"],children:["dyte-simple-grid"]},"dyte-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-grid.activeScreenShare":["dyte-mixed-grid"],"dyte-grid.activePlugin":["dyte-mixed-grid"],"dyte-grid.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-mixed-grid":{states:["activeSpotlight"],children:["dyte-simple-grid"]},"dyte-mixed-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-participant-tile":{state:"meeting",children:["dyte-name-tag","dyte-avatar","dyte-network-indicator"]},"dyte-participant-setup":["dyte-avatar","div#setupcontrols-media"],"dyte-participant-tile[meeting=setup]":["dyte-avatar","div#setupcontrols-settings","div#setupcontrols-media"],"div#setupcontrols-media":[["dyte-mic-toggle",{size:"sm"}],["dyte-camera-toggle",{size:"sm"}]],"div#setupcontrols-settings":[["dyte-settings-toggle",{size:"sm"}]],"dyte-screenshare-view":["dyte-name-tag","dyte-network-indicator"],"dyte-name-tag":[["dyte-audio-visualizer",{slot:"start"}]],"dyte-controlbar":{states:["activeMoreMenu"],props:{variant:"solid"},children:["div#controlbar-left","div#controlbar-center","div#controlbar-right"]},"dyte-controlbar.sm":["div#controlbar-mobile"],"dyte-controlbar.md":["div#controlbar-mobile"],"dyte-controlbar.activeMoreMenu.sm":{add:["div#more-menu"]},"dyte-controlbar.activeMoreMenu.md":{add:["div#more-menu"]},"div#controlbar-mobile":["dyte-mic-toggle","dyte-camera-toggle","dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-leave-button","dyte-more-toggle"],"div#more-menu":[["dyte-chat-toggle",{variant:"horizontal"}],["dyte-participants-toggle",{variant:"horizontal"}],["dyte-polls-toggle",{variant:"horizontal"}],["dyte-plugins-toggle",{variant:"horizontal"}],["dyte-fullscreen-toggle",{variant:"horizontal"}],["dyte-screen-share-toggle",{variant:"horizontal"}],["dyte-pip-toggle",{variant:"horizontal"}],["dyte-mute-all-button",{variant:"horizontal"}],["dyte-breakout-rooms-toggle",{variant:"horizontal"}],["dyte-settings-toggle",{variant:"horizontal"}]],"div#controlbar-left":["dyte-screen-share-toggle","dyte-fullscreen-toggle","dyte-pip-toggle","dyte-recording-toggle","dyte-breakout-rooms-toggle","dyte-livestream-toggle"],"div#controlbar-center":["dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-mic-toggle","dyte-camera-toggle","dyte-mute-all-button","dyte-settings-toggle","dyte-leave-button"],"div#controlbar-right":["dyte-chat-toggle","dyte-polls-toggle","dyte-participants-toggle","dyte-plugins-toggle"]},config:{notification_sounds:{participant_left:!1},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10,videoFit:"cover"}},Ve="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,Fe="object"==typeof self&&self&&self.Object===Object&&self,ze=Ve||Fe||Function("return this")(),He=ze.Symbol,qe=Object.prototype,Ge=qe.hasOwnProperty,We=qe.toString,Je=He?He.toStringTag:void 0;var $e=Object.prototype.toString;
2var Ke="[object Null]",Qe="[object Undefined]",Ye=He?He.toStringTag:void 0;function Xe(e){return null==e?void 0===e?Qe:Ke:Ye&&Ye in Object(e)?function(e){var t=Ge.call(e,Je),n=e[Je];try{e[Je]=void 0;var r=!0}catch(a){}var i=We.call(e);return r&&(t?e[Je]=n:delete e[Je]),i}(e):function(e){return $e.call(e)}(e)}function et(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function tt(e){return null!=e&&"object"==typeof e}var nt=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96],rt={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},it={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},at={sharp:{none:0,sm:0,md:0,lg:0}
2,rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}},ot=[-2,-1,0,1,2];function st(e){var t="0",n="0",r="0";return 4==(e=e.trim()).length?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3]):e.length>6&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]),[+t,+n,+r]}var ct=function(e,t,n){var r,i,a;if(0==t)r=i=a=n;else{var o=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*a)]},ut=function(e,t,n){var r=function(e){return e.toString(16).padStart(2,"0")};return"#".concat(r(e)).concat(r(t)).concat(r(n))},lt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ot,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,r=[],i=st(e),a=(0,v.Z)(i,3),s=function(e,t,n){e/=255,t/=255,n/=255;var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a==o)r=i=0;else{var c=a-o;switch(i=s>.5?c/(2-a-o):c/(a+o),a){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return[r,i,s]}(a[0],a[1],a[2]),c=(0,v.Z)(s,3),u=c[0],l=c[1],d=c[2],p=Math.round(100*d);p>70?n=.8:p>60?n=.9:p<10?n=.075:p<42&&(n=.3);var h=t.findIndex((function(e){return 0===e}));if(-1===h)throw new Error("Invalid reducer provided, it must contain atleast one zero");var f,m=(100-p)/(5-h),g=p/(h+1),y=(0,o.Z)(t);try{for(y.s();!(f=y.n()).done;){var b=f.value,k=ct(u,l,(b<0?p+b*g*n:b>0?p+b*m*n:p)/100),_=(0,v.Z)(k,3),w=_[0],x=_[1],S=_[2];r.push(ut(w,x,S))}}catch(E){y.e(E)}finally{y.f()}return r},dt=function(e){return"string"===typeof e&&7===e.length&&e.startsWith("#")},pt=function(e,t){Object.keys(t).forEach((function(n){var r=t[n];if("string"===typeof r)if("text"===n||"text-on-brand"===n){var i=st(r).join(" ");e.style.setProperty("--dyte-colors-".concat(n,"-1000"),"".concat(i)),e.style.setProperty("--dyte-colors-".concat(n,"-900"),"".concat(i," / 0.88")),e.style.setProperty("--dyte-colors-".concat(n,"-800"),"".concat(i," / 0.76")),e.style.setProperty("--dyte-colors-".concat(n,"-700"),"".concat(i," / 0.64")),e.style.setProperty("--dyte-colors-".concat(n,"-600"),"".concat(i," / 0.52"))}else{var a=st(r).join(" ");e.style.setProperty("--dyte-colors-".concat(n),a)}else"object"===typeof r&&Object.keys(r).forEach((function(t){var i=st(r[t]).join(" ");e.style.setProperty("--dyte-colors-".concat(n,"-").concat(t),i)}))}))},ht=function(e,t){var n=t.spacingBase,r=t.borderRadius,i=t.borderWidth,a=t.colors,o=t.fontFamily,s=t.googleFont,c=t.theme;if("object"!==typeof e)throw new Error("[dyte-ui-kit] (provideDyteDesignSystem): Passed element is not a valid HTML Element");if("string"===typeof s&&(!function(e){var t,n=[];if(null==document.querySelector("link[data-dyte-font]")){var r=document.createElement("link");r.rel="preconnect",r.setAttribute("data-dyte-font","true"),r.href="https://fonts.googleapis.com";var i=r.cloneNode(!0);i.href="https://fonts.gstatic.com",i.crossOrigin="",n.push(r,i)}var a=document.createElement("link");a.rel="stylesheet",a.setAttribute("data-dyte-font",e),a.href=encodeURI("https://fonts.googleapis.com/css2?family=".concat(e,":wght@").concat([400,500,700].join(";"),"&display=swap")),n.push(a),(t=document.head).append.apply(t,n)}(s),e.style.setProperty("--dyte-font-family",s)),"string"===typeof o&&e.style.setProperty("--dyte-font-family",o),"number"===typeof n&&function(e,t){nt.forEach((function(n){e.style.setProperty("--dyte-space-".concat(n),"".concat(n*t,"px"))}))}(e,n),"string"===typeof i&&function(e,t){if(t in it){var n=it[t];Object.keys(n).forEach((function(t){e.style.setProperty("--dyte-border-width-".concat(t),"".concat(n[t],"px"))}))}}(e,i),"string"===typeof r&&function(e,t){if(t in at){var n=at[t];Object.keys(n).forEach((function(t){e.style.setProperty("--dyte-border-radius-".concat(t),"".concat(n[t],"px"))}))}}(e,r),"string"===typeof c){var u=rt[c];null!=u&&pt(e,u)}"object"===typeof a&&pt(e,a)};function ft(e,t){return e===t||e!==e&&t!==t}function vt(e,t){for(var n=e.length;n--;)if(ft(e[n][0],t))return n;return-1}var mt=Array.prototype.splice;function gt(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])}}gt.prototype.clear=function(){this.__data__=[],this.size=0},gt.prototype.delete=function(e){var t=this.__data__,n=vt(t,e);return!(n<0)&&(n==t.length-1?t.pop():mt.call(t,n,1),--this.size,!0)},gt.prototype.get=function(e){var t=this.__data__,n=vt(t,e);return n<0?void 0:t[n][1]},gt.prototype.has=function(e){return vt(this.__data__,e)>-1},gt.prototype.set=function(e,t){var n=this.__data__,r=vt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var yt="[object AsyncFunction]",bt="[object Function]",kt="[object GeneratorFunction]",_t="[object Proxy]";function wt(e){if(!et(e))return!1;var t=Xe(e);return t==bt||t==kt||t==yt||t==_t}var xt=ze["__core-js_shared__"],St=function(){var e=/[^.]+$/.exec(xt&&xt.keys&&xt.keys.IE_PROTO||"");
2return e?"Symbol(src)_1."+e:""}();var Et=Function.prototype.toString;var Tt=/^\[object .+?Constructor\]$/,Pt=Function.prototype,Ct=Object.prototype,Rt=Pt.toString,Zt=Ct.hasOwnProperty,Mt=RegExp("^"+Rt.call(Zt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function At(e){return!(!et(e)||(t=e,St&&St in t))&&(wt(e)?Mt:Tt).test(function(e){if(null!=e){try{return Et.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e));var t}function It(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return At(n)?n:void 0}var Ot=It(ze,"Map"),Lt=It(Object,"create");var Dt=Object.prototype.hasOwnProperty;var Nt=Object.prototype.hasOwnProperty;function jt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Bt(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ut(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])}}jt.prototype.clear=function(){this.__data__=Lt?Lt(null):{},this.size=0},jt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},jt.prototype.get=function(e){var t=this.__data__;if(Lt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Dt.call(t,e)?t[e]:void 0},jt.prototype.has=function(e){var t=this.__data__;return Lt?void 0!==t[e]:Nt.call(t,e)},jt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Lt&&void 0===t?"__lodash_hash_undefined__":t,this},Ut.prototype.clear=function(){this.size=0,this.__data__={hash:new jt,map:new(Ot||gt),string:new jt}},Ut.prototype.delete=function(e){var t=Bt(this,e).delete(e);return this.size-=t?1:0,t},Ut.prototype.get=function(e){return Bt(this,e).get(e)},Ut.prototype.has=function(e){return Bt(this,e).has(e)},Ut.prototype.set=function(e,t){var n=Bt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Vt(e){var t=this.__data__=new gt(e);this.size=t.size}Vt.prototype.clear=function(){this.__data__=new gt,this.size=0},Vt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Vt.prototype.get=function(e){return this.__data__.get(e)},Vt.prototype.has=function(e){return this.__data__.has(e)},Vt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof gt){var r=n.__data__;if(!Ot||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ut(r)}return n.set(e,t),this.size=n.size,this};var Ft=function(){try{var e=It(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();function zt(e,t,n){"__proto__"==t&&Ft?Ft(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Ht(e,t,n){(void 0!==n&&!ft(e[t],n)||void 0===n&&!(t in e))&&zt(e,t,n)}var qt,Gt=function(e,t,n){for(var r=-1,i=Object(e),a=n(e),o=a.length;o--;){var s=a[qt?o:++r];if(!1===t(i[s],s,i))break}return e},Wt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Jt=Wt&&e&&!e.nodeType&&e,$t=Jt&&Jt.exports===Wt?ze.Buffer:void 0,Kt=$t?$t.allocUnsafe:void 0;var Qt=ze.Uint8Array;function Yt(e,t){var n=t?function(e){var t=new e.constructor(e.byteLength);return new Qt(t).set(new Qt(e)),t}(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Xt=Object.create,en=function(){function e(){}return function(t){if(!et(t))return{};if(Xt)return Xt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var tn,nn,rn=(tn=Object.getPrototypeOf,nn=Object,function(e){return tn(nn(e))}),an=Object.prototype;function on(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||an)}function sn(e){return tt(e)&&"[object Arguments]"==Xe(e)}var cn=Object.prototype,un=cn.hasOwnProperty,ln=cn.propertyIsEnumerable,dn=sn(function(){return arguments}())?sn:function(e){return tt(e)&&un.call(e,"callee")&&!ln.call(e,"callee")},pn=Array.isArray,hn=9007199254740991;function fn(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=hn}function vn(e){return null!=e&&fn(e.length)&&!wt(e)}var mn="object"==typeof exports&&exports&&!exports.nodeType&&exports,gn=mn&&e&&!e.nodeType&&e,yn=gn&&gn.exports===mn?ze.Buffer:void 0,bn=(yn?yn.isBuffer:void 0)||function(){return!1},kn="[object Object]",_n=Function.prototype,wn=Object.prototype,xn=_n.toString,Sn=wn.hasOwnProperty,En=xn.call(Object);var Tn={};
vendor: 4,348 bytes, line 2
2Tn["[object Float32Array]"]=Tn["[object Float64Array]"]=Tn["[object Int8Array]"]=Tn["[object Int16Array]"]=Tn["[object Int32Array]"]=Tn["[object Uint8Array]"]=Tn["[object Uint8ClampedArray]"]=Tn["[object Uint16Array]"]=Tn["[object Uint32Array]"]=!0,Tn["[object Arguments]"]=Tn["[object Array]"]=Tn["[object ArrayBuffer]"]=Tn["[object Boolean]"]=Tn["[object DataView]"]=Tn["[object Date]"]=Tn["[object Error]"]=Tn["[object Function]"]=Tn["[object Map]"]=Tn["[object Number]"]=Tn["[object Object]"]=Tn["[object RegExp]"]=Tn["[object Set]"]=Tn["[object String]"]=Tn["[object WeakMap]"]=!1;var Pn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Cn=Pn&&e&&!e.nodeType&&e,Rn=Cn&&Cn.exports===Pn&&Ve.process,Zn=function(){try{var e=Cn&&Cn.require&&Cn.require("util").types;return e||Rn&&Rn.binding&&Rn.binding("util")}catch(t){}}(),Mn=Zn&&Zn.isTypedArray,An=Mn?function(e){return function(t){return e(t)}}(Mn):function(e){return tt(e)&&fn(e.length)&&!!Tn[Xe(e)]};function In(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var On=Object.prototype.hasOwnProperty;function Ln(e,t,n){var r=e[t];On.call(e,t)&&ft(r,n)&&(void 0!==n||t in e)||zt(e,t,n)}var Dn=9007199254740991,Nn=/^(?:0|[1-9]\d*)$/;function jn(e,t){var n=typeof e;return!!(t=null==t?Dn:t)&&("number"==n||"symbol"!=n&&Nn.test(e))&&e>-1&&e%1==0&&e<t}var Bn=Object.prototype.hasOwnProperty;function Un(e,t){var n=pn(e),r=!n&&dn(e),i=!n&&!r&&bn(e),a=!n&&!r&&!i&&An(e),o=n||r||i||a,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var u in e)!t&&!Bn.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||jn(u,c))||s.push(u);return s}var Vn=Object.prototype.hasOwnProperty;function Fn(e){if(!et(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=on(e),n=[];for(var r in e)("constructor"!=r||!t&&Vn.call(e,r))&&n.push(r);return n}function zn(e){return vn(e)?Un(e,!0):Fn(e)}function Hn(e){return function(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),i?zt(n,s,c):Ln(n,s,c)}return n}(e,zn(e))}function qn(e,t,n,r,i,a,o){var s=In(e,n),c=In(t,n),u=o.get(c);if(u)Ht(e,n,u);else{var l,d=a?a(s,c,n+"",e,t,o):void 0,p=void 0===d;if(p){var h=pn(c),f=!h&&bn(c),v=!h&&!f&&An(c);d=c,h||f||v?pn(s)?d=s:tt(l=s)&&vn(l)?d=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(s):f?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=Kt?Kt(n):new e.constructor(n);return e.copy(r),r}(c,!0)):v?(p=!1,d=Yt(c,!0)):d=[]:function(e){if(!tt(e)||Xe(e)!=kn)return!1;var t=rn(e);if(null===t)return!0;var n=Sn.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&xn.call(n)==En}(c)||dn(c)?(d=s,dn(s)?d=Hn(s):et(s)&&!wt(s)||(d=function(e){return"function"!=typeof e.constructor||on(e)?{}:en(rn(e))}(c))):p=!1}p&&(o.set(c,d),i(d,c,r,a,o),o.delete(c)),Ht(e,n,d)}}function Gn(e,t,n,r,i){e!==t&&Gt(t,(function(a,o){if(i||(i=new Vt),et(a))qn(e,t,o,n,Gn,r,i);else{var s=r?r(In(e,o),a,o+"",e,t,i):void 0;void 0===s&&(s=a),Ht(e,o,s)}}),zn)}function Wn(e){return e}var Jn=Math.max;var $n=Ft?function(e,t){return Ft(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Wn,Kn=Date.now;var Qn=function(e){var t=0,n=0;return function(){var r=Kn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}($n);function Yn(e,t){return Qn(function(e,t,n){return t=Jn(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Jn(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),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)}(e,this,s)}}(e,t,Wn),e+"")}var Xn,er,tr=(Xn=function(e,t,n){Gn(e,t,n)},Yn((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(i=Xn.length>3&&"function"==typeof i?(r--,i):void 0,a&&function(e,t,n){if(!et(n))return!1;var r=typeof t;return!!("number"==r?vn(n)&&jn(t,n.length):"string"==r&&t in n)&&ft(n[t],e)}(t[0],t[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var o=t[n];
2o&&Xn(e,o,n,i)}return e}))),nr=function(e){var t,n,r,i,a,o,s,c,u,l,d,p,h,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{grid_pagination:!0,settings_toggle:!0},y={showSetupScreen:!0},b=["dyte-stage"],k={},_={},w=!1!==(null===g||void 0===g?void 0:g.settings_toggle),x=!1!==(null===g||void 0===g?void 0:g.grid_pagination);if(null===(t=e.controlBar)||void 0===t?void 0:t.isEnabled){b.push("dyte-controlbar");var S=e.controlBar.elements,E=["dyte-breakout-rooms-toggle","dyte-livestream-toggle"],T=[],P=["dyte-mic-toggle","dyte-camera-toggle","dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-mute-all-button"].concat((0,m.Z)(w?["dyte-settings-toggle"]:[]),["dyte-leave-button"]);S.fullscreen&&E.push("dyte-fullscreen-toggle"),S.screenshare&&E.push("dyte-screen-share-toggle"),E.push("dyte-recording-toggle"),E.push("dyte-pip-toggle"),S.chat&&T.push("dyte-chat-toggle"),S.polls&&T.push("dyte-polls-toggle"),S.participants&&T.push("dyte-participants-toggle"),S.plugins&&T.push("dyte-plugins-toggle");var C=E.concat(["dyte-mute-all-button"]).concat(T);w&&C.push("dyte-settings-toggle");var R=!1;C.length>0&&(R=!0),_={"dyte-controlbar":{states:["activeMoreMenu"],children:["div#controlbar-left","div#controlbar-center","div#controlbar-right"]},"div#controlbar-left":E,"div#controlbar-center":P,"div#controlbar-right":T,"dyte-controlbar.sm":["div#controlbar-mobile"],"dyte-controlbar.md":["div#controlbar-mobile"],"dyte-controlbar.activeMoreMenu.sm":{add:["div#more-menu"]},"dyte-controlbar.activeMoreMenu.md":{add:["div#more-menu"]},"div#controlbar-mobile":["dyte-mic-toggle","dyte-camera-toggle","dyte-webinar-stage-toggle","dyte-stage-toggle","dyte-leave-button"].concat([R&&"dyte-more-toggle"]),"div#more-menu":C.map((function(e){return[e,{variant:"horizontal"}]}))}}if(null===(n=e.header)||void 0===n?void 0:n.isEnabled){b.unshift("dyte-header");var Z=e.header.elements,M=["dyte-recording-indicator","dyte-livestream-indicator"],A=[],I=[];x&&I.push("dyte-grid-pagination"),Z.title&&A.push("dyte-meeting-title"),"string"===typeof Z.logo&&Z.logo.length>0&&(h=Z.logo,M.unshift("dyte-logo")),Z.participantCount&&I.push("dyte-participant-count","dyte-viewer-count"),Z.timer&&I.push("dyte-clock"),k={"dyte-header":["div#header-left","div#header-center","div#header-right"],"dyte-header.sm":{remove:["div#header-center"]},"div#header-left":M,"div#header-center":A,"div#header-right":I,"div#header-left.sm":{remove:["dyte-logo"],prepend:["dyte-meeting-title"]}}}b.push("dyte-participants-audio","dyte-dialog-manager");var O={logo:h};!0===e.isV2?(O=e.designTokens,dt(null===(i=null===(r=null===e||void 0===e?void 0:e.designTokens)||void 0===r?void 0:r.colors)||void 0===i?void 0:i.textOnBrand)&&(O.colors["text-on-brand"]=null===(o=null===(a=null===e||void 0===e?void 0:e.designTokens)||void 0===a?void 0:a.colors)||void 0===o?void 0:o.textOnBrand),dt(null===(c=null===(s=null===e||void 0===e?void 0:e.designTokens)||void 0===s?void 0:s.colors)||void 0===c?void 0:c.videoBg)&&(O.colors["video-bg"]=null===(l=null===(u=null===e||void 0===e?void 0:e.designTokens)||void 0===u?void 0:u.colors)||void 0===l?void 0:l.videoBg)):null!=e.colors&&(O.colors={},dt(e.colors.primary)?O.colors.brand=function(e){var t=lt(e,ot),n=(0,v.Z)(t,5);return{300:n[0],400:n[1],500:n[2],600:n[3],700:n[4]}}(e.colors.primary):"object"===typeof e.colors.primary&&(O.colors.brand=e.colors.primary),dt(e.colors.secondary)?O.colors.background=function(e){var t=lt(e,ot),n=(0,v.Z)(t,5);return{1e3:n[0],900:n[1],800:n[2],700:n[3],600:n[4]}}(e.colors.secondary):"object"===typeof e.colors.secondary&&(O.colors.background=e.colors.secondary),dt(e.colors.text)&&(O.colors.text=e.colors.text),dt(e.colors.textPrimary)&&(O.colors["text-on-brand"]=e.colors.textPrimary),dt(e.colors.videoBackground)&&(O.colors["video-bg"]=e.colors.videoBackground));var L={designTokens:O,styles:{"dyte-header":{display:"grid",height:"48px",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"dyte-header.sm":{display:"grid",gridArea:"header",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"1fr",alignItems:"center"},"div#header-left":{display:"flex",alignItems:"center",height:"48px",wordBreak:"break-all"},"dyte-logo":{height:"26px"},"div#header-center":{display:"flex",alignItems:"center",justifyContent:"center",wordBreak:"break-all"},"div#header-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-stage":{display:"flex",flex:"1"},"dyte-grid":{flex:"1",height:"auto"},"dyte-controlbar":{display:"grid",height:"76px",gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"1fr",alignItems:"center",padding:"8px"},"dyte-controlbar.sm":{display:"flex",position:"relative",backgroundColor:"var(--dyte-colors-background-1000, #000)"},"dyte-controlbar.md":{display:"flex",position:"relative",backgroundColor:"var(--dyte-colors-background-1000, #000)"},"div#controlbar-left":{display:"flex",alignItems:"center"},"div#controlbar-center":{display:"flex",alignItems:"center",justifyContent:"center"},"div#controlbar-mobile":{display:"flex",flex:"1",alignItems:"center",justifyContent:"center",zIndex:"10000"},"div#controlbar-right":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"dyte-settings":{width:"720px",height:"480px"},"div#more-menu":{position:"absolute",boxSizing:"border-box",top:"0",left:"0",width:"100%",transform:"translateY(-100%)",backgroundColor:"rgb(var(--dyte-colors-background-1000, 0 0 0))",padding:"16px 12px",borderRadius:"18px 18px 0 0",zIndex:"400"},"div#setupcontrols-media":{position:"absolute",bottom:"8px",right:"8px",display:"flex"},"div#setupcontrols-settings":{position:"absolute",top:"8px",right:"8px"},"dyte-meeting-title.sm":{marginLeft:"0"},"dyte-clock":{marginRight:"0"}},root:Object.assign(Object.assign(Object.assign({"dyte-meeting":{state:"meeting",states:["activeSidebar"]},"dyte-meeting[meeting=idle]":["dyte-idle-screen"],"dyte-meeting[meeting=waiting]":["dyte-waiting-screen"],"dyte-meeting[meeting=setup]":["dyte-setup-screen","dyte-dialog-manager"],"dyte-meeting[meeting=joined]":b,"dyte-meeting[meeting=joined].activeSidebar.sm":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=joined].activeSidebar.md":{add:[["dyte-sidebar",{view:"full-screen"}]]},"dyte-meeting[meeting=ended]":["dyte-ended-screen"]},k),_),{"dyte-stage":{states:["activeSidebar"],children:["dyte-grid","dyte-notifications"]},"dyte-stage.activeSidebar":{add:[["dyte-sidebar",{view:"sidebar"}]]},"dyte-stage.activeSidebar.sm":{remove:["dyte-sidebar"]},"dyte-grid":{states:["activeScreenShare","activePlugin","activeSpotlight"],children:["dyte-simple-grid"]},"dyte-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-grid.activeScreenShare":["dyte-mixed-grid"],"dyte-grid.activePlugin":["dyte-mixed-grid"],"dyte-grid.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeSpotlight":["dyte-mixed-grid"],"dyte-grid.activePlugin.activeScreenShare.activeSpotlight":["dyte-mixed-grid"],"dyte-mixed-grid":{states:["activeSpotlight"],children:["dyte-simple-grid"]},"dyte-mixed-grid.activeSpotlight":["dyte-spotlight-grid"],"dyte-participant-tile":{state:"meeting",children:["dyte-name-tag","dyte-avatar","dyte-network-indicator"]},"dyte-participant-setup":["dyte-avatar","div#setupcontrols-media"],"dyte-participant-tile[meeting=setup]":["dyte-avatar","div#setupcontrols-media"].
2concat((0,m.Z)(w?["div#setupcontrols-settings"]:[])),"div#setupcontrols-media":[["dyte-mic-toggle",{size:"sm"}],["dyte-camera-toggle",{size:"sm"}]],"div#setupcontrols-settings":[["dyte-settings-toggle",{size:"sm"}]],"dyte-screenshare-view":["dyte-name-tag","dyte-network-indicator"],"dyte-name-tag":[["dyte-audio-visualizer",{slot:"start"}]]}),config:{notification_sounds:{participant_left:!1},participant_joined_sound_notification_limit:3,participant_chat_message_sound_notification_limit:10,videoFit:"cover"}};return L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ue,n=Object.assign({},t);return tr(n,e),n}(f,L),y.showSetupScreen=null===(p=null===(d=e.setupScreen)||void 0===d?void 0:d.isEnabled)||void 0===p||p,{config:L,data:y}},rr={chat:"Chat","chat.new":"New",participants:"Participants",polls:"Polls",plugins:"Plugins",mic_off:"Mic Off",mic_on:"Mic On",video_off:"Video Off",video_on:"Video On",left_meeting:"You left the meeting",share_screen_start:"Share Screen",share_screen_stop:"Stop Sharing",leave:"Leave",dismiss:"Dismiss",page:"Page",settings:"Settings",audio:"Audio",video:"Video",connection:"Connection",leave_confirmation:"Are you sure you want to leave the call?",end_meeting_for_all:"End meeting for all",cancel:"Cancel",yes:"Yes",you:"you",mute:"Mute",kick:"Kick","participant.turn_off_video":"Turn off video",perm_browser_denied:"Permission denied by browser","perm.sys_denied.message":"To enable system permission, go to Mac's System Preferences -> Security & Privacy ->  Privacy -> Select Microphone, Camera or 'Screen Recording' and allow permission for your specific browser","perm_sys_denied.audio":"Mic permission denied by system","perm_sys_denied.video":"Camera permission denied by system","perm_sys_denied.screenshare":"Screenshare permission denied by system","perm_denied_title.video":"Camera permission denied","perm_denied_title.audio":"Mic permission denied","perm_denied_title.screenshare":"Screenshare permission denied","perm_denied_text.audio":"It seems like your browser or system has blocked permission for us to access microphone. Please allow this permission and reload for a smoother experience.","perm_denied_text.video":"It seems like your browser or system has blocked permission for us to access camera. Please allow this permission and reload for a smoother experience.","perm_denied_text.screenshare":"It seems like your browser or system has blocked permission for us to screenshare. Please allow this permission and reload for a smoother experience.",full_screen:"Full Screen","full_screen.exit":"Exit Full Screen","waitlist.header_title":"Waiting","waitlist.body_text":"You are in the waiting room, the host will let you in soon.","waitlist.deny_request":"Deny request","waitlist.accept_request":"Accept request","waitlist.accept_all":"Accept all","stage_request.header_title":"Join Stage Requests","stage_request.deny_request":"Deny request","stage_request.accept_request":"Accept request","stage_request.accept_all":"Accept all","stage_request.deny_all":"Deny all","stage_request.approval_pending":"Pending","stage_request.denied":"Denied","stage_request.request":"Join stage","stage_request.cancel_request":"Cancel request","stage_request.leave_stage":"Leave stage","stage_request.request_tip":"Request to join the discussion","stage_request.leave_tip":"Leave the stage","stage_request.pending_tip":"Request pending","stage_request.denied_tip":"Rejected request","stage.empty_host":"The stage is empty","stage.empty_host_summary":"To begin the webinar, please join the stage or accept a join stage request from the participants tab.","stage.empty_viewer":"Webinar has not yet been started","stage.remove_from_stage":"Remove from stage","stage.add_to_stage":"Add to stage","stage.join_title":"Join Stage","stage.join_summary":"You are about to join the stage, your video & audio as shown above will be visible to all participants.","stage.join_cancel":"Cancel","stage.join_confirm":"Join","setup_screen.join_in_as":"Join in as","setup_screen.joining_as":"Joining as","setup_screen.your_name":"Your name","stage.reconnecting":"Reconnecting...",pip_on:"Show PiP",pip_off:"Hide PiP","recording.started":"This meeting is being recorded.","recording.stopped":"Recording for this meeting has been stopped.",mute_all:"Mute all","mute_all.description":"Everyone in the meeting will be muted","mute_all.header":"Are you sure?","mute_all.allow_unmute":"Allow others to unmute","participants.empty_search_results":"Couldn't find a participant with the specified name or ID.","participants.empty_list":"It looks like nobody is here.",audio_playback:"Play Audio","audio_playback.title":"Allow Audio Playback","audio_playback.description":"In order to play audio properly on your device, click the button below.",join:"Join",joined:"Joined",create:"Create",close:"Close","confirmation_modal.header":"Are you sure?",breakout_rooms:"Breakout Rooms","breakout_rooms.room_config_header":"Create Breakout","breakout_rooms.join_breakout_header":"Join Breakout","breakout_rooms.empty":"Nobody here yet.","breakout_rooms.switch":"Switch","breakout_rooms.main_room":"Main Room","breakout_rooms.shuffle_participants":"Shuffle Participants","breakout_rooms.deselect":"Deselect","breakout_rooms.selected":"selected","breakout_rooms.num_of_rooms":"No. of Rooms","breakout_rooms.approx":"Approx.","breakout_rooms.participants_per_room":"participants/room","breakout_rooms.division_text":"when equally divi
2ded.","breakout_rooms.start_breakout":"Start Breakout","breakout_rooms.close_breakout":"Close Breakout","breakout_rooms.update_breakout":"Update Breakout","breakout_rooms.discard_changes":"Discard Changes","breakout_rooms.room":"Room","breakout_rooms.rooms":"Rooms","breakout_rooms.room_name":"Room Name","breakout_rooms.edit_room_name":"Edit Room Name","breakout_rooms.save_room_name":"Save Room Name","breakout_rooms.add_room":"Add","breakout_rooms.add_room_brief":"Add Room","breakout_rooms.select_all":"Select all","breakout_rooms.unassign_all":"Unassign all","breakout_rooms.assign":"Assign","breakout_rooms.assign_participants":"Assign Participants","breakout_rooms.none_assigned":"No participants assigned yet","breakout_rooms.drag_drop_participants":"Drag and drop participants","breakout_rooms.click_drop_participants":"Click here to assign","breakout_rooms.status.assign_multiple":"Assign multiple participants at once by clicking and selecting them","breakout_rooms.status.select_room":"Select a room to assign","breakout_rooms.ephemeral_status.participants_assigned":"Participants assigned","breakout_rooms.ephemeral_status.participants_assigned_randomly":"Participants assigned randomly","breakout_rooms.ephemeral_status.changes_discarded":"Changes discarded","breakout_rooms.confirm_modal.start_breakout.header":"Start breakout rooms?","breakout_rooms.confirm_modal.start_breakout.content":"Once started, all participants will be moved to their assigned rooms.","breakout_rooms.confirm_modal.start_breakout.cancelText":"No, go back","breakout_rooms.confirm_modal.start_breakout.ctaText":"Yes, start","breakout_rooms.confirm_modal.close_breakout.header":"Close breakout rooms?","breakout_rooms.confirm_modal.close_breakout.content":"All breakout rooms will be closed & participants will be moved back to the main room.","breakout_rooms.confirm_modal.close_breakout.ctaText":"Yes, close breakout","breakout_rooms.move_reason.started_msg":"Starting breakout rooms...","breakout_rooms.move_reason.started_desc":"You are being moved to your assigned room","breakout_rooms.move_reason.closed_msg":"Closing Breakout rooms...","breakout_rooms.move_reason.closed_desc":"You are being moved back to the main room","breakout_rooms.move_reason.switch_room":"Joining Breakout Room...","breakout_rooms.move_reason.switch_main_room":"Joining Main Room...","breakout_rooms.all_assigned":"All participants have been assigned","breakout_rooms.empty_main_room":"No more participants in the main room.","breakout_rooms.leave_confirmation":"Are you sure you want to leave the call? You are in a breakout room, you can join the main room too.","breakout_rooms.leave_confirmation.main_room_btn":"Go back to main room"},ir=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:rr;return function(t){var n;return null!==(n=e[t])&&void 0!==n?n:t}},ar
vendor: 34,486 bytes, line 2
2={people:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 13.999 13 14a2 2 0 0 1 1.995 1.85L15 16v1.5C14.999 21 11.284 22 8.5 22c-2.722 0-6.335-.956-6.495-4.27L2 17.5v-1.501c0-1.054.816-1.918 1.85-1.995L4 14ZM15.22 14H20c1.054 0 1.918.816 1.994 1.85L22 16v1c-.001 3.062-2.858 4-5 4a7.16 7.16 0 0 1-2.14-.322c.336-.386.607-.827.802-1.327A6.19 6.19 0 0 0 17 19.5l.267-.006c.985-.043 3.086-.363 3.226-2.289L20.5 17v-1a.501.501 0 0 0-.41-.492L20 15.5h-4.051a2.957 2.957 0 0 0-.595-1.34L15.22 14H20h-4.78ZM4 15.499l-.1.01a.51.51 0 0 0-.254.136.506.506 0 0 0-.136.253l-.01.101V17.5c0 1.009.45 1.722 1.417 2.242.826.445 2.003.714 3.266.753l.317.005.317-.005c1.263-.039 2.439-.308 3.266-.753.906-.488 1.359-1.145 1.412-2.057l.005-.186V16a.501.501 0 0 0-.41-.492L13 15.5l-9-.001ZM8.5 3a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm9 2a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm-9-.5c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3Zm9 2c-1.103 0-2 .897-2 2s.897 2 2 2 2-.897 2-2-.897-2-2-2Z" fill="currentColor"/></svg>',people_checked:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 29"><path fill="currentColor" d="M14.58 15.333H2.833a2.667 2.667 0 0 0-2.666 2.666v2l.006.307c.214 4.419 5.031 5.693 8.66 5.693 1.374 0 2.92-.182 4.32-.649a8.53 8.53 0 0 1-.717-1.87c-.93.298-2.027.478-3.18.513l-.423.006-.422-.006c-1.684-.052-3.254-.411-4.355-1.004-1.29-.694-1.89-1.644-1.89-2.99v-2.001l.014-.135a.675.675 0 0 1 .181-.337.68.68 0 0 1 .338-.181l.134-.014h10.31a8.71 8.71 0 0 1 1.436-1.998h.001Zm.253-8.667a6 6 0 1 0-12 0 6 6 0 0 0 12 0Zm-10 0c0-2.205 1.795-4 4-4 2.206 0 4 1.795 4 4s-1.794 4-4 4c-2.205 0-4-1.795-4-4ZM25.5 7.999a4.667 4.667 0 1 0-9.333 0A4.667 4.667 0 0 0 25.5 8Zm-7.333 0a2.67 2.67 0 0 1 2.666-2.666A2.67 2.67 0 0 1 23.5 7.999a2.67 2.67 0 0 1-2.667 2.667 2.67 2.67 0 0 1-2.666-2.667Zm10 13.334a7.333 7.333 0 1 1-14.667 0 7.333 7.333 0 0 1 14.667 0Zm-2.862-3.139a.666.666 0 0 0-.944 0l-4.86 4.863-2.196-2.196a.667.667 0 1 0-.944.944l2.667 2.666a.666.666 0 0 0 .944 0l5.333-5.333a.666.666 0 0 0 0-.944Z"/></svg>',chat:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10a9.96 9.96 0 0 1-4.587-1.112l-3.826 1.067a1.25 1.25 0 0 1-1.54-1.54l1.068-3.823A9.96 9.96 0 0 1 2 12C2 6.477 6.477 2 12 2Zm0 1.5A8.5 8.5 0 0 0 3.5 12c0 1.47.373 2.883 1.073 4.137l.15.27-1.112 3.984 3.987-1.112.27.15A8.5 8.5 0 1 0 12 3.5ZM8.75 13h4.498a.75.75 0 0 1 .102 1.493l-.102.007H8.75a.75.75 0 0 1-.102-1.493L8.75 13h4.498H8.75Zm0-3.5h6.505a.75.75 0 0 1 .101 1.493l-.101.007H8.75a.75.75 0 0 1-.102-1.493L8.75 9.5h6.505H8.75Z" fill="currentColor"/></svg>',poll:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.752 2a2.752 2.752 0 0 1 2.752 2.751V19.25a2.752 2.752 0 1 1-5.504 0V4.75A2.752 2.752 0 0 1 11.752 2Zm7 5a2.752 2.752 0 0 1 2.752 2.751v9.499a2.752 2.752 0 1 1-5.504 0V9.75A2.752 2.752 0 0 1 18.752 7Zm-14 5a2.752 2.752 0 0 1 2.752 2.751v4.499a2.752 2.752 0 0 1-5.504 0V14.75A2.752 2.752 0 0 1 4.752 12Zm7-8.5c-.692 0-1.252.56-1.252 1.251V19.25a1.252 1.252 0 0 0 2.504 0V4.75c0-.691-.56-1.251-1.252-1.251Zm7 5c-.691 0-1.252.56-1.252 1.251v9.499a1.252 1.252 0 0 0 2.504 0V9.75c0-.691-.56-1.251-1.252-1.251Zm-14 5c-.692 0-1.252.56-1.252 1.251v4.499a1.252 1.252 0 1 0 2.504 0V14.75c0-.691-.56-1.252-1.252-1.252Z" fill="currentColor"/></svg>',participants:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.754 10c.966 0 1.75.784 1.75 1.75v4.749a4.501 4.501 0 0 1-9.002 0V11.75c0-.966.783-1.75 1.75-1.75h5.502Zm0 1.5H9.252a.25.25 0 0 0-.25.25v4.749a3.001 3.001 0 0 0 6.002 0V11.75a.25.25 0 0 0-.25-.25ZM3.75 10h3.381a2.738 2.738 0 0 0-.618 1.5H3.75a.25.25 0 0 0-.25.25v3.249a2.501 2.501 0 0 0 3.082 2.433c.085.504.24.985.453 1.432A4.001 4.001 0 0 1 2 14.999V11.75c0-.966.784-1.75 1.75-1.75Zm13.125 0h3.375c.966 0 1.75.784 1.75 1.75V15a4 4 0 0 1-5.03 3.866c.214-.448.369-.929.455-1.433A2.5 2.5 0 0 0 20.5 15v-3.25a.25.25 0 0 0-.25-.25h-2.757a2.738 2.738 0 0 0-.618-1.5ZM12 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm6.5 1a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm-13 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm6.5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm6.5 1a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-13 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" fill="currentColor"/></svg>',rocket:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M9.35 20.45 14.65 22.7Q15.55 20.9 16.575 19.15Q17.6 17.4 18.75 15.8L14.8 15Q14.8 15 14.8 15Q14.8 15 14.8 15ZM17.05 24.5 23.7 31.15Q26.55 29.85 29.05 28.2Q31.55 26.55 33.1 25Q37.15 20.95 39.05 16.7Q40.95 12.45 41.1 7.1Q35.75 7.25 31.5 9.15Q27.25 11.05 23.2 15.1Q21.65 16.65 20 19.15Q18.35 21.65 17.05 24.5ZM28.5 19.7Q27.5 18.7 27.5 17.225Q27.5 15.75 28.5 14.75Q29.5 13.75 30.975 13.75Q32.45 13.75 33.45 14.75Q34.45 15.75 34.45 17.225Q34.45 18.7 33.45 19.7Q32.45 20.7 30.975 20.7Q29.5 20.7 28.5 19.7ZM27.75 38.85 33.2 33.4Q33.2 33.4 33.2 33.4Q33.2 33.4 33.2 33.4L32.4 29.45Q30.8 30.6 29.05 31.625Q27.3 32.65 25.5 33.55ZM44.05 4.15Q44.5 10.95 42.35 16.55Q40.2 22.15 35.25 27.1Q35.2 27.15 35.15 27.2Q35.1 27.25 35.05 27.3L36.15 32.8Q36.3 33.55 36.075 34.25Q35.85 34.95 35.3 35.5L26.75 44.1L22.5 34.2L14 25.7L4.1 21.45L12.7 12.9Q13.25 12.35 13.95 12.125Q14.65 11.9 15.4 12.05L20.9 13.15Q20.95 13.1 21 13.075Q21.05 13.05 21.1 13Q26.05 8.05 31.65 5.875Q37.25 3.7 44.05 4.15ZM7.45 31.75Q9.2 30 11.725 29.975Q14.25 29.95 16 31.7Q17.75 33.45 17.725 35.975Q17.7 38.5 15.95 40.25Q14.65 41.55 11.925 42.4Q9.2 43.25 3.75 44Q4.5 38.55 5.325 35.8Q6.15 33.05 7.45 31.75ZM9.55 33.9Q8.85 34.65 8.3 36.25Q7.75 37.85 7.35 40.35Q9.85 39.95 11.45 39.4Q13.05 38.85 13.8 38.15Q14.75 37.3 14.775 36.025Q14.8 34.75 13.9 33.8Q12.95 32.9 11.675 32.925Q10.4 32.95 9.55 33.9Z" fill="currentColor" /></svg>',call_end:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m21.903 13.202-.191.816a2.75 2.75 0 0 1-2.955 2.107l-1.755-.178A2.75 2.75 0 0 1 14.6 13.83l-.389-1.686a.25.25 0 0 0-.113-.157c-.321-.197-1.034-.32-2.098-.32-.786 0-1.386.067-1.786.189-.14.043-.238.085-.301.116l-.09.048-.015.04-.409 1.77A2.75 2.75 0 0 1 7 15.948l-1.746.177A2.75 2.75 0 0 1 2.3 14.03l-.196-.817a3.75 3.75 0 0 1 1.13-3.651C5.134 7.839 8.064 7 12 7c3.943 0 6.875.842 8.776 2.57a3.75 3.75 0 0 1 1.172 3.41l-.045.222Zm-1.426-.514a2.25 2.25 0 0 0-.71-2.009C18.184 9.241 15.602 8.5 12 8.5c-3.598 0-6.177.739-7.76 2.172a2.25 2.25 0 0 0-.677 2.19l.196.818a1.25 1.25 0 0 0 1.342.953l1.746-.178a1.25 1.25 0 0 0 1.09-.962l.423-1.82.043-.136c.376-.998 1.591-1.37 3.597-1.37 1.318 0 2.265.164 2.88.54.401.245.687.642.793 1.1l.389 1.685c.12.522.56.909 1.092.963l1.754.178a1.25 1.25 0 0 0 1.343-.958l.192-.816.034-.171Z" fill="currentColor"/></svg>',share:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 2.498a3.502 3.502 0 1 1-2.597 5.851l-4.558 2.604a3.5 3.5 0 0 1 0 2.093l4.557 2.606a3.502 3.502 0 1 1-.745 1.302L9.1 14.347a3.502 3.502 0 1 1 0-4.698l4.557-2.604A3.502 3.502 0 0 1 17 2.498Zm0 13.5a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Zm-10.498-6a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Zm10.498-6a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Z" fill="currentColor"/></svg>',mic_on:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 11a.75.75 0 0 1 .743.648l.007.102v.5a6.75 6.75 0 0 1-6.249 6.732l-.001 2.268a.75.75 0 0 1-1.493.102l-.007-.102v-2.268a6.75 6.75 0 0 1-6.246-6.496L5 12.25v-.5a.75.75 0 0 1 1.493-.102l.007.102v.5a5.25 5.25 0 0 0 5.034 5.246l.216.004h.5a5.25 5.25 0 0 0 5.246-5.034l.004-.216v-.5a.75.75 0 0 1 .75-.75ZM12 2a4 4 0 0 1 4 4v6a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4Zm0 1.5A2.5 2.5 0 0 0 9.5 6v6a2.5 2.5 0 0 0 5 0V6A2.5 2.5 0 0 0 12 3.5Z" fill="currentColor"/></svg>',mic_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06L8 9.06V12a4 4 0 0 0 6.248 3.309l1.146 1.146A5.227 5.227 0 0 1 12.25 17.5h-.5l-.216-.004A5.25 5.25 0 0 1 6.5 12.25v-.5l-.007-.102A.75.75 0 0 0 5 11.75v.5l.004.236a6.75 6.75 0 0 0 6.246 6.496v2.268l.007.102a.75.75 0 0 0 1.493-.102l.001-2.268a6.718 6.718 0 0 0 3.712-1.458l4.256 4.256a.75.75 0 0 0 1.061-1.06L3.28 2.22Zm9.876 11.997A2.5 2.5 0 0 1 9.5 12v-1.44l3.656 3.657ZM14.5 6v5.318l1.43 1.43c.046-.242.07-.492.07-.748V6a4 4 0 0 0-7.862-1.044L9.5 6.318V6a2.5 2.5 0 0 1 5 0ZM17.196 14.014l1.146 1.146A6.725 6.725 0 0 0 19 12.25v-.5l-.007-.102a.75.75 0 0 0-1.493.102v.5l-.004.216a5.233 5.233 0 0 1-.3 1.548Z" fill="currentColor"/></svg>',video_on:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.75 4.5A3.25 3.25 0 0 1 17 7.75v.173l3.864-2.318A.75.75 0 0 1 22 6.248V17.75a.75.75 0 0 1-1.136.643L17 16.075v.175a3.25 3.25 0 0 1-3.25 3.25h-8.5A3.25 3.25 0 0 1 2 16.25v-8.5A3.25 3.25 0 0 1 5.25 4.5h8.5Zm0 1.5h-8.5A1.75 1.75 0 0 0 3.5 7.75v8.5c0 .966.784 1.75 1.75 1.75h8.5a1.75 1.75 0 0 0 1.75-1.75v-8.5A1.75 1.75 0 0 0 13.75 6Zm6.75 1.573L17 9.674v4.651l3.5 2.1V7.573Z" fill="currentColor"/></svg>',video_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06l1.567 1.567A3.25 3.25 0 0 0 2 7.75v8.5a3.25 3.25 0 0 0 3.25 3.25h8.5a3.25 3.25 0 0 0 2.903-1.786l4.066 4.067a.75.75 0 0 0 1.061-1.061L3.28 2.22Zm12.196 14.317A1.75 1.75 0 0 1 13.75 18h-8.5a1.75 1.75 0 0 1-1.75-1.75v-8.5c0-.869.633-1.59 1.463-1.727l10.514 10.514ZM15.5 12.318V7.75A1.75 1.75 0 0 0 13.75 6H9.182l-1.5-1.5h6.068A3.25 3.25 0 0 1 17 7.75v.173l3.864-2.318A.75.75 0 0 1 22 6.248V17.75c0 .301-.17.543-.403.665L20.5 17.318V7.573L17 9.674v4.144l-1.5-1.5Z" fill="currentColor"/></svg>',share_screen_start:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 6.25A2.25 2.25 0 0 1 4.25 4h15.5A2.25 2.25 0 0 1 22 6.25v11.5A2.25 2.25 0 0 1 19.75 20H4.25A2.25 2.25 0 0 1 2 17.75V6.25Zm2.25-.75a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h15.5a.75.75 0 0 0 .75-.75V6.25a.75.75 0 0 0-.75-.75H4.25Z"/><path d="M12 7.245a.75.75 0 0 1 .53.22l3.255 3.255a.75.75 0 1 1-1.06 1.06L12.75 9.806v6.447a.75.75 0 0 1-1.5 0V9.808L9.28 11.78a.75.75 0 1 1-1.06-1.06l3.25-3.254a.75.75 0 0 1 .53-.22Z"/></svg>',share_screen_stop:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 6.25A2.25 2.25 0 0 1 4.25 4h15.5A2.25 2.25 0 0 1 22 6.25v11.5A2.25 2.25 0 0 1 19.75 20H4.25A2.25 2.25 0 0 1 2 17.75V6.25Zm2.25-.75a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h15.5a.75.75 0 0 0 .75-.75V6.25a.75.75 0 0 0-.75-.75H4.25Z"/><path d="M8.22 8.215a.75.75 0 0 1 1.06 0l2.72 2.72 2.725-2.716a.75.75 0 0 1 1.06 1.062l-2.724 2.715 2.724 2.724a.75.75 0 1 1-1.06 1.06L12 13.057 9.28 15.78a.75.75 0 0 1-1.06-1.06l2.72-2.724-2.72-2.72a.75.75 0 0 1 0-1.06Z"/></svg>',share_screen_person:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 7.25A3.25 3.25 0 0 1 5.25 4h13.5A3.25 3.25 0 0 1 22 7.25V13h-.258a3.74 3.74 0 0 0-1.242-2.545V7.25a1.75 1.75 0 0 0-1.75-1.75H5.25A1.75 1.75 0 0 0 3.5 7.25v9.5c0 .966.784 1.75 1.75 1.75H12v.5c0 .34.04.674.118 1H5.25A3.25 3.25 0 0 1 2 16.75v-9.5ZM21.5 17a1.5 1.5 0 0 1 1.5 1.5v.5c0 1.971-1.86 4-5 4-3.14 0-5-2.029-5-4v-.5a1.5 1.5 0 0 1 1.5-1.5h7ZM18 10.5a2.75 2.75 0 1 1 0 5.5 2.75 2.75 0 0 1 0-5.5Z" fill="currentColor"/></svg>',clock:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2Zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333ZM11.25 6a.75.75 0 0 1 .743.648L12 6.75V12h3.25a.75.75 0 0 1 .102 1.493l-.102.007h-4a.75.75 0 0 1-.743-.648l-.007-.102v-6a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',dismiss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z" fill="currentColor"/></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.694 12 2.299 3.272c-.236-.607.356-1.188.942-.982l.093.04 18 9a.75.75 0 0 1 .097 1.283l-.097.058-18 9a.75.75 0 0 1-1.065-.847l.03-.096L5.694 12 2.299 3.272 5.694 12ZM4.402 4.54l2.61 6.71h6.627a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.649.743l-.101.007H7.01l-2.609 6.71L19.322 12 4.401 4.54Z" fill="currentColor"/></svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 2.75a7.25 7.25 0 0 1 5.63 11.819l4.9 4.9a.75.75 0 0 1-.976 1.134l-.084-.073-4.901-4.9A7.25 7.25 0 1 1 10 2.75Zm0 1.5a5.75 5.75 0 1 0 0 11.5 5.75 5.75 0 0 0 0-11.5Z" fill="currentColor"/</svg>',more_vertical:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7.75a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM12 13.75a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM10.25 18a1.75 1.75 0 1 0 3.5 0 1.75 1.75 0 0 0-3.5 0Z" fill="currentColor"/></svg>',chevron_down:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.22 8.47a.75.75 0 0 1 1.06 0L12 15.19l6.72-6.72a.75.75 0 1 1 1.06 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L4.22 9.53a.75.75 0 0 1 0-1.06Z" fill="currentColor"/></svg>',chevron_up:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.22 15.53a.75.75 0 0 0 1.06 0L12 8.81l6.72 6.72a.75.75 0 1 0 1.06-1.06l-7.25-7.25a.75.75 0 0 0-1.06 0l-7.25 7.25a.75.75 0 0 0 0 1.06Z" fill="currentColor"/></svg>',chevron_left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.53 4.22a.75.75 0 0 1 0 1.06L8.81 12l6.72 6.72a.75.75 0 1 1-1.06 1.06l-7.25-7.25a.75.75 0 0 1 0-1.06l7.25-7.25a.75.75 0 0 1 1.06 0Z" fill="currentColor"/></svg>',chevron_right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.47 4.22a.75.75 0 0 0 0 1.06L15.19 12l-6.72 6.72a.75.75 0 1 0 1.06 1.06l7.25-7.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0Z" fill="currentColor"/></svg>',settings:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.012 2.25c.734.008 1.465.093 2.182.253a.75.75 0 0 1 .582.649l.17 1.527a1.384 1.384 0 0 0 1.927 1.116l1.401-.615a.75.75 0 0 1 .85.174 9.792 9.792 0 0 1 2.204 3.792.75.75 0 0 1-.271.825l-1.242.916a1.381 1.381 0 0 0 0 2.226l1.243.915a.75.75 0 0 1 .272.826 9.797 9.797 0 0 1-2.204 3.792.75.75 0 0 1-.848.175l-1.407-.617a1.38 1.38 0 0 0-1.926 1.114l-.169 1.526a.75.75 0 0 1-.572.647 9.518 9.518 0 0 1-4.406 0 .75.75 0 0 1-.572-.647l-.168-1.524a1.382 1.382 0 0 0-1.926-1.11l-1.406.616a.75.75 0 0 1-.849-.175 9.798 9.798 0 0 1-2.204-3.796.75.75 0 0 1 .272-.826l1.243-.916a1.38 1.38 0 0 0 0-2.226l-1.243-.914a.75.75 0 0 1-.271-.826 9.793 9.793 0 0 1 2.204-3.792.75.75 0 0 1 .85-.174l1.4.615a1.387 1.387 0 0 0 1.93-1.118l.17-1.526a.75.75 0 0 1 .583-.65c.717-.159 1.45-.243 2.201-.252Zm0 1.5a9.135 9.135 0 0 0-1.354.117l-.109.977A2.886 2.886 0 0 1 6.525 7.17l-.898-.394a8.293 8.293 0 0 0-1.348 2.317l.798.587a2.881 2.881 0 0 1 0 4.643l-.799.588c.32.842.776 1.626 1.348 2.322l.905-.397a2.882 2.882 0 0 1 4.017 2.318l.11.984c.889.15 1.798.15 2.687 0l.11-.984a2.881 2.881 0 0 1 4.018-2.322l.905.396a8.296 8.296 0 0 0 1.347-2.318l-.798-.588a2.881 2.881 0 0 1 0-4.643l.796-.587a8.293 8.293 0 0 0-1.348-2.317l-.896.393a2.884 2.884 0 0 1-4.023-2.324l-.11-.976a8.988 8.988 0 0 0-1.333-.117ZM12 8.25a3.75 3.75 0 1 1 0 7.5 3.75 3.75 0 0 1 0-7.5Zm0 1.5a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Z" fill="currentColor"/></svg>',wifi:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.745 10.75a8.291 8.291 0 0 1 1.492 2.07.75.75 0 1 1-1.335.683 6.798 6.798 0 0 0-1.218-1.692 6.562 6.562 0 0 0-10.493 1.673.75.75 0 1 1-1.339-.677 8.062 8.062 0 0 1 12.893-2.057Zm-2.102 3.07c.448.447.816.997 1.072 1.582a.75.75 0 1 1-1.373.602 3.72 3.72 0 0 0-.76-1.124 3.592 3.592 0 0 0-5.08 0c-.31.31-.562.689-.746 1.11a.75.75 0 1 1-1.375-.6 5.11 5.11 0 0 1 1.061-1.57 5.092 5.092 0 0 1 7.201 0Zm4.805-5.541c.51.509.99 1.09 1.409 1.697a.75.75 0 0 1-1.235.852 10.822 10.822 0 0 0-1.234-1.489c-4.08-4.08-10.695-4.08-14.776 0-.421.422-.84.934-1.222 1.484a.75.75 0 0 1-1.232-.855c.43-.62.905-1.2 1.394-1.69 4.666-4.665 12.23-4.665 16.896 0Zm-7.387 8.16a1.5 1.5 0 1 1-2.122 2.122 1.5 1.5 0 0 1 2.122-2.122Z" fill="currentColor"/></svg>',speaker:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 4.25c0-1.079-1.274-1.65-2.08-.934L8.427 7.309a.75.75 0 0 1-.498.19H4.25A2.25 2.25 0 0 0 2 9.749v4.497a2.25 2.25 0 0 0 2.25 2.25h3.68a.75.75 0 0 1 .498.19l4.491 3.994c.806.716 2.081.144 2.081-.934V4.25ZM9.425 8.43 13.5 4.807v14.382l-4.075-3.624a2.25 2.25 0 0 0-1.495-.569H4.25a.75.75 0 0 1-.75-.75V9.75a.75.75 0 0 1 .75-.75h3.68a2.25 2.25 0 0 0 1.495-.569ZM18.992 5.897a.75.75 0 0 1 1.049.157A9.959 9.959 0 0 1 22 12a9.96 9.96 0 0 1-1.96 5.946.75.75 0 0 1-1.205-.892A8.459 8.459 0 0 0 20.5 12a8.459 8.459 0 0 0-1.665-5.054.75.75 0 0 1 .157-1.049Z" /><path d="M17.143 8.37a.75.75 0 0 1 1.017.302c.536.99.84 2.125.84 3.328a6.973 6.973 0 0 1-.84 3.328.75.75 0 0 1-1.32-.714c.42-.777.66-1.666.66-2.614s-.24-1.837-.66-2.614a.75.75 0 0 1 .303-1.017Z"/></svg>',speaker_off:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06L6.438 7.5H4.25A2.25 2.25 0 0 0 2 9.749v4.497a2.25 2.25 0 0 0 2.25 2.25h3.68a.75.75 0 0 1 .498.19l4.491 3.994c.806.716 2.081.144 2.081-.934V16.06l5.72 5.72a.75.75 0 0 0 1.06-1.061L3.28 2.22ZM13.5 14.56v4.629l-4.075-3.624a2.25 2.25 0 0 0-1.495-.569H4.25a.75.75 0 0 1-.75-.75V9.75a.75.75 0 0 1 .75-.75h3.688L13.5 14.56ZM13.5 4.807v5.511l1.5 1.5V4.25c0-1.079-1.274-1.65-2.08-.934l-3.4 3.022 1.063 1.063L13.5 4.807ZM17.141 13.96l1.138 1.137A6.974 6.974 0 0 0 19 12a6.973 6.973 0 0 0-.84-3.328.75.75 0 0 0-1.32.714c.42.777.66 1.666.66 2.614 0 .691-.127 1.351-.359 1.96ZM19.388 16.206l1.093 1.094A9.955 9.955 0 0 0 22 12a9.959 9.959 0 0 0-1.96-5.946.75.75 0 0 0-1.205.892A8.46 8.46 0 0 1 20.5 12a8.458 8.458 0 0 1-1.112 4.206Z"/></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 20.5a.75.75 0 1 1 0 1.5l-13 .004a.75.75 0 1 1 0-1.5l13-.004ZM11.648 2.012l.102-.007a.75.75 0 0 1 .743.648l.007.102-.001 13.685 3.722-3.72a.75.75 0 0 1 .976-.073l.085.073a.75.75 0 0 1 .072.976l-.073.084-4.997 4.997a.75.75 0 0 1-.976.073l-.085-.073-5.003-4.996a.75.75 0 0 1 .976-1.134l.084.072 3.719 3.714L11 2.755a.75.75 0 0 1 .648-.743l.102-.007-.102.007Z" fill="currentColor"/></svg>',full_screen_maximize:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.5 5.75c0-.69.56-1.25 1.25-1.25h2a.75.75 0 0 0 0-1.5h-2A2.75 2.75 0 0 0 3 5.75v2a.75.75 0 0 0 1.5 0v-2ZM4.5 18.25c0 .69.56 1.25 1.25 1.25h2a.75.75 0 0 1 0 1.5h-2A2.75 2.75 0 0 1 3 18.25v-2a.75.75 0 0 1 1.5 0v2ZM18.25 4.5c.69 0 1.25.56 1.25 1.25v2a.75.75 0 0 0 1.5 0v-2A2.75 2.75 0 0 0 18.25 3h-2a.75.75 0 0 0 0 1.5h2ZM19.5 18.25c0 .69-.56 1.25-1.25 1.25h-2a.75.75 0 0 0 0 1.5h2A2.75 2.75 0 0 0 21 18.25v-2a.75.75 0 0 0-1.5 0v2Z" fill="currentColor"/></svg>',full_screen_minimize:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.5 3.75a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 0 0 1.5h2.5A2.25 2.25 0 0 0 8.5 6.25v-2.5ZM8.5 20.25a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 0-.75-.75h-2.5a.75.75 0 0 1 0-1.5h2.5a2.25 2.25 0 0 1 2.25 2.25v2.5ZM16.25 3a.75.75 0 0 0-.75.75v2.5a2.25 2.25 0 0 0 2.25 2.25h2.5a.75.75 0 0 0 0-1.5h-2.5a.75.75 0 0 1-.75-.75v-2.5a.75.75 0 0 0-.75-.75ZM15.5 20.25a.75.75 0 0 0 1.5 0v-2.5a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 0 0-1.5h-2.5a2.25 2.25 0 0 0-2.25 2.25v2.5Z" fill="currentColor"/></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.503 4.627 5.5 6.75v10.504a3.25 3.25 0 0 0 3.25 3.25h8.616a2.251 2.251 0 0 1-2.122 1.5H8.75A4.75 4.75 0 0 1 4 17.254V6.75c0-.98.627-1.815 1.503-2.123ZM17.75 2A2.25 2.25 0 0 1 20 4.25v13a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-13A2.25 2.25 0 0 1 8.75 2h9Zm0 1.5h-9a.75.75 0 0 0-.75.75v13c0 .414.336.75.75.75h9a.75.75 0 0 0 .75-.75v-13a.75.75 0 0 0-.75-.75Z" fill="currentColor"/></svg>',attach:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.772 3.743a6 6 0 0 1 8.66 8.302l-.19.197-8.8 8.798-.036.03a3.723 3.723 0 0 1-5.489-4.973.764.764 0 0 1 .085-.13l.054-.06.086-.088.142-.148.002.003 7.436-7.454a.75.75 0 0 1 .977-.074l.084.073a.75.75 0 0 1 .074.976l-.073.084-7.594 7.613a2.23 2.23 0 0 0 3.174 3.106l8.832-8.83A4.502 4.502 0 0 0 13 4.644l-.168.16-.013.014-9.536 9.536a.75.75 0 0 1-1.133-.977l.072-.084 9.549-9.55h.002Z" fill="currentColor"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.75 3A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3h11.5Zm.58 16.401-5.805-5.686a.75.75 0 0 0-.966-.071l-.084.07-5.807 5.687c.182.064.378.099.582.099h11.5c.203 0 .399-.035.58-.099l-5.805-5.686L18.33 19.4ZM17.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v11.5c0 .208.036.408.103.594l5.823-5.701a2.25 2.25 0 0 1 3.02-.116l.128.116 5.822 5.702c.067-.186.104-.386.104-.595V6.25a1.75 1.75 0 0 0-1.75-1.75Zm-2.498 2a2.252 2.252 0 1 1 0 4.504 2.252 2.252 0 0 1 0-4.504Zm0 1.5a.752.752 0 1 0 0 1.504.752.752 0 0 0 0-1.504Z" fill="currentColor"/></svg>',emoji_multiple:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.5 2a6.503 6.503 0 0 1 6.312 4.943c-.515.01-1.02.068-1.506.171a5 5 0 1 0-6.191 6.191 8.053 8.053 0 0 0-.172 1.507A6.5 6.5 0 0 1 8.5 2Zm.16 8.006c.355-.451.759-.864 1.202-1.23a3.5 3.5 0 0 0-4.022.95.75.75 0 1 0 1.14.974 2 2 0 0 1 1.68-.694ZM7.5 6.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm5.458 2.042a.75.75 0 0 1 .082 1.058 4 4 0 0 1-6.075.005.75.75 0 0 1 1.138-.977 2.499 2.499 0 0 0 3.797-.003.75.75 0 0 1 1.058-.083ZM17.5 14.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM15 22a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0-1.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11Z" fill="currentColor"/></svg>',image_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06l1.263 1.264A3.235 3.235 0 0 0 3 6.25v11.5A3.25 3.25 0 0 0 6.25 21h11.5c.626 0 1.21-.177 1.706-.483l1.263 1.264a.75.75 0 0 0 1.061-1.061L3.28 2.22Zm8.788 10.909 6.206 6.206.056.066a1.746 1.746 0 0 1-.58.099H6.25c-.204 0-.4-.035-.582-.099l5.807-5.686.593-.586Zm-.95-.95a2.245 2.245 0 0 0-.692.464l-5.823 5.7a1.747 1.747 0 0 1-.103-.593V6.25c0-.206.036-.404.101-.588l6.518 6.518ZM19.5 16.318V6.25a1.75 1.75 0 0 0-1.75-1.75H7.682L6.182 3H17.75A3.25 3.25 0 0 1 21 6.25v11.568l-1.5-1.5Z" fill="currentColor"/><path d="M15.252 6.5a2.252 2.252 0 1 1 0 4.504 2.252 2.252 0 0 1 0-4.504Zm0 1.5a.752.752 0 1 0 0 1.504.752.752 0 0 0 0-1.504Z" fill="currentColor"/></svg>',disconnected:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l3.364 3.365a11.99 11.99 0 0 0-2.033 1.634c-.49.489-.964 1.069-1.394 1.689a.75.75 0 1 0 1.233.855c.381-.55.8-1.062 1.222-1.484a10.468 10.468 0 0 1 2.063-1.604l1.591 1.592a8.062 8.062 0 0 0-1.923 1.424c-.61.61-1.109 1.3-1.491 2.056a.75.75 0 1 0 1.338.677 6.51 6.51 0 0 1 1.214-1.673 6.546 6.546 0 0 1 1.984-1.362l1.93 1.93a5.07 5.07 0 0 0-2.876 1.44 5.11 5.11 0 0 0-1.061 1.57.75.75 0 0 0 1.374.602c.185-.422.437-.8.747-1.111a3.59 3.59 0 0 1 3.36-.958l7.858 7.858a.75.75 0 0 0 1.06-1.06L3.28 2.22Zm8.304 6.182 1.584 1.584a6.532 6.532 0 0 1 3.516 1.825 6.798 6.798 0 0 1 1.217 1.692.75.75 0 1 0 1.336-.683 8.292 8.292 0 0 0-1.492-2.07 8.042 8.042 0 0 0-6.16-2.348ZM8.487 5.305 9.713 6.53a10.44 10.44 0 0 1 10.908 4.297.75.75 0 1 0 1.235-.852 11.946 11.946 0 0 0-13.369-4.67Zm4.573 11.134a1.5 1.5 0 1 1-2.121 2.122 1.5 1.5 0 0 1 2.121-2.122Z" fill="currentColor"/></svg>',wand:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m13.314 7.565-.136.126-10.48 10.488a2.27 2.27 0 0 0 3.211 3.208L16.388 10.9a2.251 2.251 0 0 0-.001-3.182l-.157-.146a2.25 2.25 0 0 0-2.916-.007Zm-.848 2.961 1.088 1.088-8.706 8.713a.77.77 0 1 1-1.089-1.088l8.707-8.713Zm4.386 4.48L16.75 15a.75.75 0 0 0-.743.648L16 15.75v.75h-.75a.75.75 0 0 0-.743.648l-.007.102c0 .38.282.694.648.743l.102.007H16v.75c0 .38.282.694.648.743l.102.007a.75.75 0 0 0 .743-.648l.007-.102V18h.75a.75.75 0 0 0 .743-.648L19 17.25a.75.75 0 0 0-.648-.743l-.102-.007h-.75v-.75a.75.75 0 0 0-.648-.743L16.75 15l.102.007Zm-1.553-6.254.027.027a.751.751 0 0 1 0 1.061l-.711.713-1.089-1.089.73-.73a.75.75 0 0 1 1.043.018ZM6.852 5.007 6.75 5a.75.75 0 0 0-.743.648L6 5.75v.75h-.75a.75.75 0 0 0-.743.648L4.5 7.25c0 .38.282.693.648.743L5.25 8H6v.75c0 .38.282.693.648.743l.102.007a.75.75 0 0 0 .743-.648L7.5 8.75V8h.75a.75.75 0 0 0 .743-.648L9 7.25a.75.75 0 0 0-.648-.743L8.25 6.5H7.5v-.75a.75.75 0 0 0-.648-.743L6.75 5l.102.007Zm12-2L18.75 3a.75.75 0 0 0-.743.648L18 3.75v.75h-.75a.75.75 0 0 0-.743.648l-.007.102c0 .38.282.693.648.743L17.25 6H18v.75c0 .38.282.693.648.743l.102.007a.75.75 0 0 0 .743-.648l.007-.102V6h.75a.75.75 0 0 0 .743-.648L21 5.25a.75.75 0 0 0-.648-.743L20.25 4.5h-.75v-.75a.75.75 0 0 0-.648-.743L18.75 3l.102.007Z" fill="currentColor"/></svg>',recording:'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"/><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM3.5 12a8.5 8.5 0 1 1 17 0 8.5 8.5 0 0 1-17 0Z"/></svg>',subtract:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.755 12.5h16.492a.75.75 0 0 0 0-1.5H3.755a.75.75 0 0 0 0 1.5Z" fill="currentColor"/></svg>',stop_recording:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.5C9.74566 3.5 7.58365 4.39553 5.98959 5.98959C4.39553 7.58365 3.5 9.74566 3.5 12C3.5 14.2543 4.39553 16.4163 5.98959 18.0104C7.58365 19.6045 9.74566 20.5 12 20.5C14.2543 20.5 16.4163 19.6045 18.0104 18.0104C19.6045 16.4163 20.5 14.2543 20.5 12C20.5 9.74566 19.6045 7.58365 18.0104 5.98959C16.4163 4.39553 14.2543 3.5 12 3.5ZM2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22C6.477 22 2 17.523 2 12ZM8 9.5C8 9.10218 8.15804 8.72064 8.43934 8.43934C8.72064 8.15804 9.10218 8 9.5 8H14.5C14.8978 8 15.2794 8.15804 15.5607 8.43934C15.842 8.72064 16 9.10218 16 9.5V14.5C16 14.8978 15.842 15.2794 15.5607 15.5607C15.2794 15.842 14.8978 16 14.5 16H9.5C9.10218 16 8.72064 15.842 8.43934 15.5607C8.15804 15.2794 8 14.8978 8 14.5V9.5Z" fill="currentColor"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138 7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878Zm9.505 15.613-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086-7.76-14.008 7.76 14.008ZM12 16.002a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997ZM11.995 8.5a.75.75 0 0 1 .744.647l.007.102.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102-.004-4.502a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m16.242 2.932 4.826 4.826a2.75 2.75 0 0 1-.715 4.404l-4.87 2.435a.75.75 0 0 0-.374.426l-1.44 4.166a1.25 1.25 0 0 1-2.065.476L8.5 16.561 4.06 21H3v-1.06l4.44-4.44-3.105-3.104a1.25 1.25 0 0 1 .476-2.066l4.166-1.44a.75.75 0 0 0 .426-.373l2.435-4.87a2.75 2.75 0 0 1 4.405-.715Zm3.766 5.886-4.826-4.826a1.25 1.25 0 0 0-2.002.325l-2.435 4.871a2.25 2.25 0 0 1-1.278 1.12l-3.789 1.31 6.705 6.704 1.308-3.789a2.25 2.25 0 0 1 1.12-1.277l4.872-2.436a1.25 1.25 0 0 0 .325-2.002Z" fill="currentColor"/></svg>',pin_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l5.905 5.905L4.81 10.33a1.25 1.25 0 0 0-.476 2.065L7.439 15.5 3 19.94V21h1.06l4.44-4.44 3.105 3.105a1.25 1.25 0 0 0 2.065-.476l1.145-3.313 5.905 5.904a.75.75 0 0 0 1.06-1.06L3.28 2.22Zm10.355 12.476-1.252 3.626-6.705-6.705 3.626-1.252 4.331 4.331Zm6.048-3.876-3.787 1.894 1.118 1.118 3.34-1.67a2.75 2.75 0 0 0 .714-4.404l-4.825-4.826a2.75 2.75 0 0 0-4.405.715l-1.67 3.34 1.118 1.117 1.894-3.787a1.25 1.25 0 0 1 2.002-.325l4.826 4.826a1.25 1.25 0 0 1-.325 2.002Z" fill="currentColor"/></svg>',spinner:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke-width="2" stroke="currentColor" stroke-opacity="0.2" vector-effect="non-scaling-stroke"/><path d="M22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke"/></svg>',breakout_rooms:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.5 3a2.25 2.25 0 0 1 2.25 2.25v6h6A2.25 2.25 0 0 1 21 13.5v5.25A2.25 2.25 0 0 1 18.75 21H5.25A2.25 2.25 0 0 1 3 18.75V5.25A2.25 2.25 0 0 1 5.25 3h5.25Zm.75 9.75H4.5v6c0 .414.336.75.75.75h5.999l.001-6.75Zm7.5 0h-6.001v6.75h6.001a.75.75 0 0 0 .75-.75V13.5a.75.75 0 0 0-.75-.75ZM10.5 4.5H5.25a.75.75 0 0 0-.75.75v6h6.75v-6a.75.75 0 0 0-.75-.75Zm7.398-2.493L18 2a.75.75 0 0 1 .743.648l.007.102v2.5h2.5a.75.75 0 0 1 .743.648L22 6a.75.75 0 0 1-.648.743l-.102.007h-2.5v2.5a.75.75 0 0 1-.648.743L18 10a.75.75 0 0 1-.743-.648l-.007-.102v-2.5h-2.5a.75.75 0 0 1-.743-.648L14 6a.75.75 0 0 1 .648-.743l.102-.007h2.5v-2.5a.75.75 0 0 1 .648-.743Z" fill="currentColor"/></svg>',add:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.75 3a.75.75 0 0 1 .743.648l.007.102.001 7.25h7.253a.75.75 0 0 1 .102 1.493l-.102.007h-7.253l.002 7.25a.75.75 0 0 1-1.493.101l-.007-.102-.002-7.249H3.752a.75.75 0 0 1-.102-1.493L3.752 11h7.25L11 3.75a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',shuffle:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M14.0058 8.11111H18.7947L16.9613 9.94444C16.9095 9.99587 16.8684 10.057 16.8402 10.1243C16.812 10.1917 16.7974 10.2639 16.7971 10.3369C16.7966 10.4843 16.8547 10.6259 16.9586 10.7306C17.01 10.7823 17.0711 10.8235 17.1385 10.8517C17.2058 10.8799 17.278 10.8945 17.351 10.8947C17.4985 10.8953 17.64 10.8372 17.7447 10.7333L20.8891 7.59999L20.4947 7.20555L17.7447 4.46111C17.64 4.35723 17.4985 4.29917 17.351 4.29969C17.2036 4.30021 17.0624 4.35927 16.9586 4.46388C16.8547 4.5685 16.7966 4.71009 16.7971 4.85751C16.7977 5.00494 16.8567 5.14612 16.9613 5.24999L18.728 6.99999H13.6669C13.5699 7.00058 13.4748 7.02653 13.391 7.07526C13.3072 7.12399 13.2376 7.19381 13.1891 7.27777L11.7224 9.82777L12.3669 10.9389L14.0058 8.11111Z" fill="currentColor"/><path d="M8.15022 15.9278H3.66688C3.51954 15.9278 3.37823 15.9863 3.27405 16.0905C3.16986 16.1947 3.11133 16.336 3.11133 16.4833C3.11133 16.6307 3.16986 16.772 3.27405 16.8762C3.37823 16.9804 3.51954 17.0389 3.66688 17.0389H8.47244C8.56939 17.0383 8.6645 17.0124 8.74832 16.9636C8.83214 16.9149 8.90174 16.8451 8.95022 16.7611L10.4335 14.2222L9.77799 13.1111L8.15022 15.9278Z"/><path d="M17.7447 13.2056C17.64 13.1017 17.4985 13.0436 17.351 13.0441C17.2036 13.0447 17.0624 13.1037 16.9586 13.2083C16.8547 13.3129 16.7966 13.4545 16.7971 13.602C16.7977 13.7494 16.8567 13.8906 16.9613 13.9944L18.9058 15.9389H14.0058L8.95022 7.29444C8.90174 7.21047 8.83214 7.14066 8.74832 7.09193C8.6645 7.04319 8.56939 7.01725 8.47244 7.01666H3.66688C3.51954 7.01666 3.37823 7.07519 3.27405 7.17938C3.16986 7.28357 3.11133 7.42487 3.11133 7.57222C3.11133 7.71956 3.16986 7.86087 3.27405 7.96505C3.37823 8.06924 3.51954 8.12777 3.66688 8.12777H8.15022L13.2058 16.7667C13.2542 16.8506 13.3239 16.9204 13.4077 16.9692C13.4915 17.0179 13.5866 17.0439 13.6836 17.0444H18.6113L16.9447 18.7111C16.8929 18.7625 16.8517 18.8237 16.8235 18.891C16.7954 18.9584 16.7807 19.0306 16.7805 19.1036C16.7802 19.1766 16.7943 19.2489 16.822 19.3165C16.8497 19.384 16.8905 19.4454 16.9419 19.4972C16.9933 19.549 17.0545 19.5902 17.1218 19.6184C17.1891 19.6465 17.2614 19.6612 17.3344 19.6614C17.4074 19.6617 17.4797 19.6476 17.5472 19.6199C17.6148 19.5922 17.6762 19.5514 17.728 19.5L20.478 16.7556L20.8724 16.3611L17.7447 13.2056Z"/></svg>',edit:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21.03 2.97a3.578 3.578 0 0 1 0 5.06L9.062 20a2.25 2.25 0 0 1-.999.58l-5.116 1.395a.75.75 0 0 1-.92-.921l1.395-5.116a2.25 2.25 0 0 1 .58-.999L15.97 2.97a3.578 3.578 0 0 1 5.06 0ZM15 6.06 5.062 16a.75.75 0 0 0-.193.333l-1.05 3.85 3.85-1.05A.75.75 0 0 0 8 18.938L17.94 9 15 6.06Zm2.03-2.03-.97.97L19 7.94l.97-.97a2.079 2.079 0 0 0-2.94-2.94Z" fill="currentColor"/></svg>',delete:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75Zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5ZM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75Zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75Zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25Z" fill="currentColor"/></svg>',back:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.75 2a.75.75 0 0 1 .743.648l.007.102v5.69l4.574-4.56a6.41 6.41 0 0 1 8.879-.179l.186.18a6.41 6.41 0 0 1 0 9.063l-8.846 8.84a.75.75 0 0 1-1.06-1.062l8.845-8.838a4.91 4.91 0 0 0-6.766-7.112l-.178.17L6.562 9.5h5.688a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.648.743L12.25 11h-7.5a.75.75 0 0 1-.743-.648L4 10.25v-7.5A.75.75 0 0 1 4.75 2Z" fill="currentColor"/></svg>',save:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5.75A2.75 2.75 0 0 1 5.75 3h9.964a3.25 3.25 0 0 1 2.299.952l2.035 2.035c.61.61.952 1.437.952 2.299v9.964A2.75 2.75 0 0 1 18.25 21H5.75A2.75 2.75 0 0 1 3 18.25V5.75ZM5.75 4.5c-.69 0-1.25.56-1.25 1.25v12.5c0 .69.56 1.25 1.25 1.25H6v-5.25A2.25 2.25 0 0 1 8.25 12h7.5A2.25 2.25 0 0 1 18 14.25v5.25h.25c.69 0 1.25-.56 1.25-1.25V8.286c0-.465-.184-.91-.513-1.238l-2.035-2.035a1.75 1.75 0 0 0-.952-.49V7.25a2.25 2.25 0 0 1-2.25 2.25h-4.5A2.25 2.25 0 0 1 7 7.25V4.5H5.75Zm10.75 15v-5.25a.75.75 0 0 0-.75-.75h-7.5a.75.75 0 0 0-.75.75v5.25h9Zm-8-15v2.75c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75V4.5h-6Z" fill="currentColor"/></svg>',web:'<svg 
2xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M9.99906 2.16577C14.6024 2.16577 18.3341 5.89744 18.3341 10.5008C18.3341 15.1033 14.6024 18.8349 9.99906 18.8349C5.39573 18.8349 1.66406 15.1033 1.66406 10.5008C1.66406 5.89744 5.39573 2.16577 9.99906 2.16577ZM12.4482 14.2499H7.54906C8.0924 16.2616 9.0374 17.5849 9.99823 17.5849C10.9591 17.5849 11.9041 16.2616 12.4474 14.2499H12.4482ZM6.25656 14.2499H3.98656C4.79114 15.5374 5.9867 16.5335 7.39823 17.0924C6.96323 16.4091 6.60406 15.5541 6.3399 14.5799L6.2549 14.2508L6.25656 14.2499ZM16.0107 14.2499H13.7424C13.4724 15.3624 13.0824 16.3333 12.5982 17.0924C13.9206 16.5694 15.0556 15.6617 15.8566 14.4866L16.0107 14.2508V14.2499ZM5.91073 8.83327H3.11156L3.1074 8.84744C2.9781 9.38904 2.91293 9.94396 2.91323 10.5008C2.91323 11.3808 3.07406 12.2233 3.3674 13.0008H6.01156C5.81031 11.621 5.77589 10.2221 5.90906 8.83411L5.91073 8.83327ZM12.8299 8.83327H7.16823C7.02162 10.221 7.05945 11.6221 7.28073 12.9999H12.7174C12.9386 11.6221 12.9764 10.221 12.8299 8.83327ZM16.8866 8.83327H14.0882C14.1399 9.37244 14.1674 9.93077 14.1674 10.4999C14.1687 11.3366 14.108 12.1722 13.9857 12.9999H16.6299C16.9308 12.2008 17.0844 11.3538 17.0832 10.4999C17.0832 9.92577 17.0149 9.3666 16.8866 8.83327ZM7.39906 3.90827L7.3799 3.91494C5.67441 4.59596 4.29862 5.91053 3.54073 7.58327H6.08073C6.3424 6.12327 6.7974 4.8516 7.3999 3.90827H7.39906ZM9.99906 3.41577L9.9024 3.41994C8.84906 3.5166 7.82906 5.18494 7.3574 7.58327H12.6424C12.1707 5.1916 11.1566 3.52577 10.1049 3.42077L9.99906 3.4166V3.41577ZM12.5991 3.90744L12.6882 4.05327C13.2457 4.97994 13.6691 6.19661 13.9174 7.58411H16.4574C15.7339 5.98751 14.4463 4.71438 12.8416 4.0091L12.5991 3.90827V3.90744Z"/></svg>',checkmark:'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="m18 6.7-8.48 8.48-3.54-3.54a.996.996 0 1 0-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 0 0-.01-1.42c-.37-.38-1-.38-1.39.01z"/></svg>',spotlight:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19.745 4C20.3417 4 20.914 4.23705 21.336 4.65901C21.7579 5.08097 21.995 5.65326 21.995 6.25V12.805C21.5485 12.3774 21.0434 12.0154 20.495 11.73V6.25C20.495 6.05109 20.416 5.86032 20.2753 5.71967C20.1347 5.57902 19.9439 5.5 19.745 5.5H4.25C4.05109 5.5 3.86032 5.57902 3.71967 5.71967C3.57902 5.86032 3.5 6.05109 3.5 6.25V17.755C3.5 18.169 3.836 18.505 4.25 18.505L6.999 18.504L7 15.75C7.00002 15.3108 7.16517 14.8877 7.46268 14.5646C7.76019 14.2415 8.1683 14.0421 8.606 14.006L8.75 14H12.022C11.7223 14.4675 11.484 14.9716 11.313 15.5H8.75C8.69368 15.5001 8.63904 15.5192 8.59493 15.5542C8.55083 15.5893 8.51984 15.6382 8.507 15.693L8.5 15.75L8.499 18.504H11.077C11.1569 19.0193 11.2989 19.5229 11.5 20.004H4.25C3.65344 20.004 3.08129 19.7671 2.65936 19.3453C2.23744 18.9236 2.00027 18.3516 2 17.755V6.25C2 5.65326 2.23705 5.08097 2.65901 4.65901C3.08097 4.23705 3.65326 4 4.25 4H19.745Z"/><path d="M12 7C12.7956 7 13.5587 7.31607 14.1213 7.87868C14.6839 8.44129 15 9.20435 15 10C15 10.7956 14.6839 11.5587 14.1213 12.1213C13.5587 12.6839 12.7956 13 12 13C11.2044 13 10.4413 12.6839 9.87868 12.1213C9.31607 11.5587 9 10.7956 9 10C9 9.20435 9.31607 8.44129 9.87868 7.87868C10.4413 7.31607 11.2044 7 12 7ZM12 8.5C11.6022 8.5 11.2206 8.65804 10.9393 8.93934C10.658 9.22064 10.5 9.60218 10.5 10C10.5 10.3978 10.658 10.7794 10.9393 11.0607C11.2206 11.342 11.6022 11.5 12 11.5C12.3978 11.5 12.7794 11.342 13.0607 11.0607C13.342 10.7794 13.5 10.3978 13.5 10C13.5 9.60218 13.342 9.22064 13.0607 8.93934C12.7794 8.65804 12.3978 8.5 12 8.5Z"/><path d="M23 17.5C23 18.9587 22.4205 20.3576 21.3891 21.3891C20.3576 22.4205 18.9587 23 17.5 23C16.0413 23 14.6424 22.4205 13.6109 21.3891C12.5795 20.3576 12 18.9587 12 17.5C12 16.0413 12.5795 14.6424 13.6109 13.6109C14.6424 12.5795 16.0413 12 17.5 12C18.9587 12 20.3576 12.5795 21.3891 13.6109C22.4205 14.6424 23 16.0413 23 17.5ZM18.055 14.42C18.0207 14.2993 17.9479 14.193 17.8478 14.1174C17.7476 14.0417 17.6255 14.0008 17.5 14.0008C17.3745 14.0008 17.2524 14.0417 17.1522 14.1174C17.0521 14.193 16.9793 14.2993 16.945 14.42L16.388 16.208H14.585C14.019 16.208 13.785 16.962 14.242 17.308L15.7 18.413L15.143 20.2C14.968 20.761 15.584 21.228 16.042 20.881L17.5 19.777L18.958 20.881C19.416 21.228 20.032 20.761 19.857 20.201L19.3 18.413L20.758 17.309C21.216 16.962 20.981 16.208 20.415 16.208H18.612L18.055 14.421V14.42Z"/></svg>',join_stage:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M17.5 22C14.4618 22 12 19.5376 12 16.5C12 13.4623 14.4618 11 17.5 11C20.5371 11 23 13.4624 23 16.5C23 19.5376 20.5371 22 17.5 22ZM17.0704 18.992L17.1167 19.0322C17.1868 19.0841 17.2716 19.1125 17.3588 19.1132C17.4461 19.1139 17.5314 19.0869 17.6023 19.036L17.654 18.992L17.6936 18.9458C17.7455 18.8757 17.7739 18.7909 17.7746 18.7037C17.7753 18.6164 17.7483 18.5311 17.6975 18.4602L17.6535 18.4085L16.158 16.9125H19.8375L19.8936 16.9092C19.9829 16.8969 20.0657 16.8558 20.1293 16.792C20.193 16.7282 20.234 16.6454 20.2462 16.5561L20.25 16.5005L20.2462 16.4444C20.2339 16.3553 20.1928 16.2725 20.1292 16.2089C20.0655 16.1452 19.9828 16.1041 19.8936 16.0919L19.8375 16.088H16.158L17.654 14.592L17.6941 14.5453C17.7537 14.4659 17.7827 14.3676 17.7756 14.2686C17.7686 14.1695 17.726 14.0763 17.6558 14.0061C17.5856 13.9359 17.4924 13.8934 17.3934 13.8863C17.2943 13.8793 17.1961 13.9082 17.1167 13.9678L17.071 14.0079L14.8699 16.2079L14.8303 16.2547C14.7784 16.3247 14.75 16.4094 14.7493 16.4965C14.7485 16.5837 14.7753 16.6688 14.8259 16.7398L14.8699 16.7915L17.0704 18.992Z"/><path d="M2.80546 3.80546C2.28973 4.32118 2 5.02065 2 5.75V16.25C2 16.6111 2.07113 16.9687 2.20933 17.3024C2.34753 17.636 2.5501 17.9392 2.80546 18.1945C3.06082 18.4499 3.36398 18.6525 3.69762 18.7907C4.03127 18.9289 4.38886 19 4.75 19H11.498C11.3 18.526 11.157 18.023 11.076 17.5H9.002V14.75C9.002 14.6837 9.02834 14.6201 9.07522 14.5732C9.12211 14.5263 9.1857 14.5 9.252 14.5H11.3135C11.4858 13.9665 11.7253 13.4632 12.0218 13H9.252C8.285 13 7.502 13.784 7.502 14.75V16H7.5V17.5
2H4.75C4.06 17.5 3.5 16.94 3.5 16.25V5.75C3.5 5.06 4.06 4.5 4.75 4.5H19.25C19.94 4.5 20.5 5.06 20.5 5.75V10.732C20.6457 10.808 20.7884 10.8895 20.9277 10.9762C20.9687 11.0017 21.0093 11.0276 21.0497 11.054C21.3899 11.2762 21.708 11.5294 22 11.8096V5.75C22 5.02065 21.7103 4.32118 21.1945 3.80546C20.6788 3.28973 19.9793 3 19.25 3H4.75C4.02065 3 3.32118 3.28973 2.80546 3.80546Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4181 10.7757C14.7938 10.264 15 9.64262 15 9C15 8.20435 14.6839 7.44129 14.1213 6.87868C13.5587 6.31607 12.7956 6 12 6C11.2044 6 10.4413 6.31607 9.87868 6.87868C9.31607 7.44129 9 8.20435 9 9C9 9.79565 9.31607 10.5587 9.87868 11.1213C10.4413 11.6839 11.2044 12 12 12C12.333 12 12.6602 11.9446 12.9695 11.839C13.3992 11.4213 13.8864 11.0625 14.4181 10.7757ZM10.9393 7.93934C11.2206 7.65804 11.6022 7.5 12 7.5C12.3978 7.5 12.7794 7.65804 13.0607 7.93934C13.342 8.22064 13.5 8.60218 13.5 9C13.5 9.39782 13.342 9.77936 13.0607 10.0607C12.7794 10.342 12.3978 10.5 12 10.5C11.6022 10.5 11.2206 10.342 10.9393 10.0607C10.658 9.77936 10.5 9.39782 10.5 9C10.5 8.60218 10.658 8.22064 10.9393 7.93934Z"></svg>',leave_stage:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M2.80546 3.80546C2.28973 4.32118 2 5.02065 2 5.75V16.25C2 16.6111 2.07113 16.9687 2.20933 17.3024C2.34753 17.636 2.5501 17.9392 2.80546 18.1945C3.06082 18.4499 3.36398 18.6525 3.69762 18.7907C4.03127 18.9289 4.38886 19 4.75 19H11.498C11.3 18.526 11.157 18.023 11.076 17.5H9.002V14.75C9.002 14.6837 9.02834 14.6201 9.07522 14.5732C9.12211 14.5263 9.1857 14.5 9.252 14.5H11.3135C11.4858 13.9665 11.7253 13.4632 12.0218 13H9.252C8.285 13 7.502 13.784 7.502 14.75V16H7.5V17.5H4.75C4.06 17.5 3.5 16.94 3.5 16.25V5.75C3.5 5.06 4.06 4.5 4.75 4.5H19.25C19.94 4.5 20.5 5.06 20.5 5.75V10.732C20.6457 10.808 20.7884 10.8895 20.9277 10.9762C20.9687 11.0017 21.0093 11.0276 21.0497 11.054C21.3899 11.2762 21.708 11.5294 22 11.8096V5.75C22 5.02065 21.7103 4.32118 21.1945 3.80546C20.6788 3.28973 19.9793 3 19.25 3H4.75C4.02065 3 3.32118 3.28973 2.80546 3.80546Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4181 10.7757C14.7938 10.264 15 9.64262 15 9C15 8.20435 14.6839 7.44129 14.1213 6.87868C13.5587 6.31607 12.7956 6 12 6C11.2044 6 10.4413 6.31607 9.87868 6.87868C9.31607 7.44129 9 8.20435 9 9C9 9.79565 9.31607 10.5587 9.87868 11.1213C10.4413 11.6839 11.2044 12 12 12C12.333 12 12.6602 11.9446 12.9695 11.839C13.3992 11.4213 13.8864 11.0625 14.4181 10.7757ZM10.9393 7.93934C11.2206 7.65804 11.6022 7.5 12 7.5C12.3978 7.5 12.7794 7.65804 13.0607 7.93934C13.342 8.22064 13.5 8.60218 13.5 9C13.5 9.39782 13.342 9.77936 13.0607 10.0607C12.7794 10.342 12.3978 10.5 12 10.5C11.6022 10.5 11.2206 10.342 10.9393 10.0607C10.658 9.77936 10.5 9.39782 10.5 9C10.5 8.60218 10.658 8.22064 10.9393 7.93934Z"/><path d="M17.5 11C20.5382 11 23 13.4624 23 16.5C23 19.5377 20.5382 22 17.5 22C14.4629 22 12 19.5377 12 16.5C12 13.4624 14.4629 11 17.5 11V11ZM17.9296 14.0079L17.8833 13.9678C17.8132 13.9159 17.7284 13.8875 17.6412 13.8868C17.5539 13.8861 17.4686 13.9131 17.3977 13.964L17.346 14.0079L17.3064 14.0542C17.2545 14.1243 17.2261 14.2091 17.2254 14.2963C17.2247 14.3836 17.2517 14.4689 17.3026 14.5398L17.3465 14.5915L18.842 16.0875H15.1625L15.1064 16.0908C15.0171 16.1031 14.9343 16.1442 14.8707 16.208C14.807 16.2718 14.766 16.3546 14.7539 16.4439L14.75 16.4995L14.7539 16.5556C14.7661 16.6447 14.8072 16.7275 14.8708 16.7911C14.9345 16.8548 15.0172 16.8959 15.1064 16.9081L15.1625 16.912H18.842L17.346 18.408L17.3059 18.4547C17.2463 18.5341 17.2173 18.6324 17.2244 18.7314C17.2314 18.8305 17.274 18.9237 17.3442 18.9939C17.4144 19.0641 17.5076 19.1066 17.6066 19.1137C17.7057 19.1207 17.8039 19.0918 17.8833 19.0322L17.929 18.9921L20.1301 16.7921L20.1697 16.7453C20.2216 16.6753 20.25 16.5906 20.2507 16.5035C20.2515 16.4163 20.2247 16.3312 20.1741 16.2602L20.1301 16.2085L17.9301 14.0079L17.8833 13.9678L17.9296 14.0079V14.0079Z"/></svg>',pip_off:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.8666 12.3058C11.0731 12.3058 11.2404 12.1385 11.2404 11.932V8.56753C11.2404 8.36107 11.0731 8.1937 10.8666 8.1937C10.6601 8.1937 10.4928 8.36107 10.4928 8.56753V11.0295L6.45393 6.99066C6.30794 6.84467 6.07124 6.84467 5.92525 6.99066C5.77926 7.13665 5.77926 7.37335 5.92525 7.51934L9.9641 11.5582L7.50212 11.5582C7.29566 11.5582 7.12829 11.7256 7.12829 11.932C7.12829 12.1385 7.29566 12.3058 7.50212 12.3058L10.8666 12.3058ZM5.73832 19.8879C3.6737 19.8879 2 18.2141 2 16.1495V7.73832C2 5.6737 3.6737 4 5.73832 4H18.2617C20.3263 4 22 5.6737 22 7.73832L22 13.0269C22 12.2687 21.6002 11.6038 21 11.2316C20.8468 11.1366 20.6806 11.0607 20.5047 11.0071V7.73832C20.5047 6.49955 19.5005 5.49533 18.2617 5.49533H5.73832C4.49955 5.49533 3.49533 6.49955 3.49533 7.73832V16.1495C3.49533 17.3883 4.49955 18.3925 5.73832 18.3925H10.7971C10.8506 18.5685 10.9266 18.7347 11.0216 18.8879C11.3938 19.4881 12.0587 19.8879 12.8169 19.8879H5.73832Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.7265 12.5H13.3911C12.899 12.5 12.5 12.899 12.5 13.3911V17.6462C12.5 18.1384 12.899 18.5374 13.3911 18.5374H19.7265C20.2187 18.5374 20.6176 18.1384 20.6176 17.6462V13.3911C20.6176 12.899 20.2187 12.5 19.7265 12.5ZM13.3911 11.5C12.3467 11.5 11.5 12.3467 11.5 13.3911V17.6462C11.5 18.6907 12.3467 19.5374 13.3911 19.5374H19.7265C20.771 19.5374 21.61
276 18.6907 21.6176 17.6462V13.3911C21.6176 12.3467 20.771 11.5 19.7265 11.5H13.3911Z"/></svg>',pip_on:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.73832 19.8879C3.6737 19.8879 2 18.2141 2 16.1495V7.73832C2 5.6737 3.6737 4 5.73832 4H18.2617C20.3263 4 22 5.6737 22 7.73832L22 13.0269C22 12.2687 21.6002 11.6038 21 11.2316C20.8468 11.1366 20.6806 11.0607 20.5047 11.0071V7.73832C20.5047 6.49955 19.5005 5.49533 18.2617 5.49533H5.73832C4.49955 5.49533 3.49533 6.49955 3.49533 7.73832V16.1495C3.49533 17.3883 4.49955 18.3925 5.73832 18.3925H10.7971C10.8506 18.5685 10.9266 18.7347 11.0216 18.8879C11.3938 19.4881 12.0587 19.8879 12.8169 19.8879H5.73832Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.7265 12.5H13.3911C12.899 12.5 12.5 12.899 12.5 13.3911V17.6462C12.5 18.1384 12.899 18.5374 13.3911 18.5374H19.7265C20.2187 18.5374 20.6176 18.1384 20.6176 17.6462V13.3911C20.6176 12.899 20.2187 12.5 19.7265 12.5ZM13.3911 11.5C12.3467 11.5 11.5 12.3467 11.5 13.3911V17.6462C11.5 18.6907 12.3467 19.5374 13.3911 19.5374H19.7265C20.771 19.5374 21.6176 18.6907 21.6176 17.6462V13.3911C21.6176 12.3467 20.771 11.5 19.7265 11.5H13.3911Z"/><path d="M6.18951 6.88123C5.98304 6.88123 5.81567 7.0486 5.81567 7.25506V10.6195C5.81567 10.826 5.98304 10.9934 6.18951 10.9934C6.39597 10.9934 6.56334 10.826 6.56334 10.6195V8.15757L10.6022 12.1964C10.7482 12.3424 10.9849 12.3424 11.1309 12.1964C11.2769 12.0504 11.2769 11.8137 11.1309 11.6677L7.09202 7.62889L9.55399 7.62889C9.76045 7.62889 9.92782 7.46152 9.92782 7.25506C9.92782 7.0486 9.76045 6.88123 9.55399 6.88123L6.18951 6.88123Z"/></svg>',signal_1:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3z"></path></svg>',signal_2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7z"></path></svg>',signal_3:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2z"></path></svg>',signal_4:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2zm4-3h2v14h-2z"></path></svg>',signal_5:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2zm4-3h2v14h-2zm4-3h2v17h-2z"></path></svg>',start_livestream:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M6.343 4.938a1 1 0 0 1 0 1.415a8.003 8.003 0 0 0 0 11.317a1 1 0 1 1-1.415 1.414c-3.906-3.906-3.906-10.24 0-14.146a1 1 0 0 1 1.415 0Zm12.731 0c3.906 3.907 3.906 10.24 0 14.146a1 1 0 0 1-1.414-1.414a8.003 8.003 0 0 0 0-11.317a1 1 0 0 1 1.414-1.415ZM9.31 7.812a1 1 0 0 1 0 1.414a3.92 3.92 0 0 0 0 5.544a1 1 0 1 1-1.414 1.414a5.92 5.92 0 0 1 0-8.372a1 1 0 0 1 1.414 0Zm6.959 0a5.92 5.92 0 0 1 0 8.372a1 1 0 0 1-1.415-1.414a3.92 3.92 0 0 0 0-5.544a1 1 0 0 1 1.415-1.414Zm-4.187 2.77a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3Z"/></svg>',stop_livestream:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M2.854 2.146a.5.5 0 1 0-.708.708l1.811 1.81A8.218 8.218 0 0 0 2 10a8.228 8.228 0 0 0 2.604 6.015a.725.725 0 0 0 1.01-.025c.316-.316.277-.819-.027-1.11A6.73 6.73 0 0 1 3.5 10c0-1.62.57-3.107 1.522-4.27l.712.71A5.726 5.726 0 0 0 4.5 10c0 1.691.73 3.213 1.893 4.264a.713.713 0 0 0 .983-.037c.328-.328.267-.844-.041-1.134A4.238 4.238 0 0 1 6 10c0-.93.298-1.789.804-2.489l1.842 1.842a1.5 1.5 0 0 0 2 2l6.5 6.5a.5.5 0 0 0 .708-.707l-1.811-1.81l-1.065-1.066l-.712-.71l-1.07-1.072l-1.842-1.841l-2-2L7.4 6.693l-.942-.942l-.82-.82l-.944-.944l-1.841-1.842Zm13.794 12.38A8.212 8.212 0 0 0 18 10c0-2.283-.928-4.35-2.426-5.843a.726.726 0 0 0-1.027.01c-.31.31-.28.8.01 1.095A6.727 6.727 0 0 1 16.5 10a6.718 6.718 0 0 1-.94 3.438l1.088 1.089Zm-1.822-1.822A5.73 5.73 0 0 0 15.5 10a5.733 5.733 0 0 0-1.706-4.087a.714.714 0 0 0-1.008.016c-.319.318-.272.816.014 1.111A4.235 4.235 0 0 1 14 10c0 .557-.107 1.09-.302 1.577l1.128 1.127Z"/></svg>',viewers:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 13">
2<path fill="currentColor" d="M10.0309 4.00462C12.24 4.00462 14.0309 5.79549 14.0309 8.00462C14.0309 10.2138 12.24 12.0046 10.0309 12.0046C7.82174 12.0046 6.03088 10.2138 6.03088 8.00462C6.03088 5.79549 7.82174 4.00462 10.0309 4.00462ZM10.0309 5.50462C8.65017 5.50462 7.53088 6.62391 7.53088 8.00462C7.53088 9.38534 8.65017 10.5046 10.0309 10.5046C11.4116 10.5046 12.5309 9.38534 12.5309 8.00462C12.5309 6.62391 11.4116 5.50462 10.0309 5.50462ZM10.0309 0.5C14.6444 0.5 18.627 3.65001 19.732 8.06439C19.8326 8.4662 19.5884 8.87348 19.1866 8.97406C18.7848 9.07465 18.3775 8.83045 18.2769 8.42863C17.338 4.67796 13.9522 2 10.0309 2C6.10781 2 2.72098 4.68026 1.78374 8.43315C1.68337 8.83502 1.27623 9.07944 0.874363 8.97908C0.472492 8.87872 0.228071 8.47158 0.328434 8.06971C1.43153 3.65272 5.41536 0.5 10.0309 0.5Z"/></svg>'},or=function(e){var t=e.elements,n=e.defaults,r=e.props,i=void 0===r?{}:r,a=e.deepProps,o=void 0!==a&&a,s=e.elementProps,c=void 0===s?{}:s;return Array.isArray(t)&&0!==t.length?t.map((function(e){return T(sr,{element:e,defaults:n,props:i,childProps:o&&i,elementProps:c})})):null},sr=function(e,t){var n,r,i=e.element,a=e.defaults,s=e.childProps,c=void 0===s?{}:s,u=e.props,l=void 0===u?{}:u,d=e.onlyChildren,p=void 0!==d&&d,h=e.asHost,f=void 0!==h&&h,g=e.deepProps,y=void 0!==g&&g,b=e.elementProps,k=void 0===b?{}:b,_=a.config,w=a.size,x=a.states,S={};if(Array.isArray(i)){var E=(0,v.Z)(i,2);r=E[0],S=E[1]}else r=i;var P=null===(n=null===_||void 0===_?void 0:_.root)||void 0===n?void 0:n[r];null!=P&&"props"in P&&(l=Object.assign(Object.assign({},P.props),l)),l=Object.assign(Object.assign({},l),S),r in k&&(l=Object.assign(Object.assign({},l),k[r]));var R=function(e){var t=e.element,n=e.size,r=e.states,i=void 0===r?{}:r,a=e.config,s=void 0===a?{}:a,c=[],u=null===s||void 0===s?void 0:s.root[t],l=function(e){c.push(e),"string"===typeof n&&c.push("".concat(e,".").concat(n))};if(l(t),"object"===typeof u&&!Array.isArray(u)&&null!==u){var d=u.state,p=u.states,h=t,f=[];if(Array.isArray(p)){f=p.filter((function(e){return i[e]})),f.sort();var v,g=(0,o.Z)(f);try{for(g.s();!(v=g.n()).done;){var y=v.value;l("".concat(h,".").concat(y))}}catch(x){g.e(x)}finally{g.f()}f.length>1&&l([h].concat((0,m.Z)(f)).join("."))}if("string"===typeof d){var b="".concat(t,"[").concat(d,"=").concat(i[d],"]");l(b);var k,_=(0,o.Z)(f);try{for(_.s();!(k=_.n()).done;){var w=k.value;l("".concat(b,".").concat(w))}}catch(x){_.e(x)}finally{_.f()}f.length>1&&l([b].concat((0,m.Z)(f)).join("."))}}return c}({element:r,size:w,states:x,config:_}),Z=function(e){var t=e.selectors,n=e.root;if(!n||!Array.isArray(t))return[];var r,i=[],a=(0,o.Z)(t);try{for(a.s();!(r=a.n()).done;){var s=n[r.value];if(Array.isArray(s))i=(0,m.Z)(s);else if(s){if(s.children&&(i=(0,m.Z)(s.children)),Array.isArray(s.remove)){var c,u=(0,o.Z)(s.remove);try{var l=function(){var e=c.value;i=i.filter((function(t){return"string"===typeof t?t!==e:!Array.isArray(t)||t[0]!==e}))};for(u.s();!(c=u.n()).done;)l()}catch(f){u.e(f)}finally{u.f()}}if(s.addBefore)for(var d=function(){var e,t=(0,v.Z)(h[p],2),n=t[0],r=t[1],a=i.findIndex((function(e){return"string"===typeof e?e===n:!!Array.isArray(e)&&e[0]===n}));a>=0&&(e=i).splice.apply(e,[a,0].concat((0,m.Z)(r)))},p=0,h=Object.entries(s.addBefore);p<h.length;p++)d();Array.isArray(s.add)&&(i=i.concat(s.add)),Array.isArray(s.prepend)&&(i=s.prepend.concat(i))}}}catch(f){a.e(f)}finally{a.f()}return i}({selectors:R,root:_.root});if(p)return T(or,{elements:Z,defaults:a,props:c,deepProps:y,elementProps:k});var M=function(e){var t=e.selectors,n=e.styles;if(!Array.isArray(t)||null==n)return{};var r,i={},a=(0,o.Z)(t);try{for(a.s();!(r=a.n()).done;){var s=n[r.value];null!=s&&Object.assign(i,s)}}catch(c){a.e(c)}finally{a.f()}return i}({selectors:R,styles:_.styles});if(f)return T(C,Object.assign({},a,{style:M},l),T(or,{elements:Z,defaults:a,props:c,deepProps:y,elementProps:k}),t);if(["dyte-header","dyte-controlbar"].includes(r)&&(l.disableRender=!0),r.startsWith("dyte-"))return T(r,Object.assign({},a,{style:M},l),T(or,{elements:Z,defaults:a,props:c,deepProps:y,elementProps:k}),t);var A=r.split("#"),I=(0,v.Z)(A,2),O=I[0],L=I[1];return T(O,{id:L,style:M},T(or,{elements:Z,defaults:a,props:c,deepProps:y,elementProps:k}),t)},cr={get:function(e,t,n){return function(){try{for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return Reflect.get(e,t,n).apply(e,i)}catch(o){return null}}}};try{er=new Proxy(localStorage,cr)}catch(hl){er=new Proxy({},cr)}var ur=er,lr="dyte-prefs",dr=function(e,t){var n=JSON.parse(ur.getItem(lr)||"{}");n[e]=JSON.stringify(t),ur.setItem("dyte-prefs",JSON.stringify(n))},pr=function(e){return JSON.parse(ur.getItem(lr)||"{}")[e]},hr={},fr=function(e){return!("isConnected"in e)||e.isConnected},vr=function(e,t){var n;return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];n&&clearTimeout(n),n=setTimeout((function(){n=0,e.apply(void 0,i)}),t)}}((function(e){var t,n=(0,o.Z)(e.keys());try{for(n.s();!(t=n.n()).done;){var r=t.value;e.set(r,e.get(r).filter(fr))}}catch(i){n.e(i)}finally{n.f()}}),2e3),mr=function(e){return"function"===typeof e?e():e},gr=function(e,t){var n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},yr=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return e!==t},n=mr(e),r=new Map(Object.entries(null!==n&&void 0!==n?n:{})),i={dispose:[],get:[],set:[],reset:[]},a=function(){var t;r=new Map(Object.entries(null!==(t=mr(e))&&void 0!==t?t:{})),i.reset.forEach((function(e){return e()}))},o=function(e){return i.get.forEach((function(t){return t(e)})),r.get(e)},s=function(e,n){var a=r.get(e);t(n,a,e)&&(r.set(e,n),i.set.forEach((function(t){return t(e,n,a)})))},c="undefined"===typeof Proxy?{}:new Proxy(n,{get:function(e,t){return o(t)},ownKeys:function(e){return Array.from(r.keys())},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0}},has:function(e,t){return r.has(t)},set:function(e,t,n){return s(t,n),!0}}),u=function(e,t){return i[e].push(t),function(){gr(i[e],t)}};return{state:c,get:o,set:s,on:u,onChange:function(t,n){var r=u("set",(function(e,r){e===t&&n(r)})),i=u("reset",(function(){return n(mr(e)[t])}));return function(){r(),i()}},use:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return t.set&&e.push(u("set",t.set)),t.get&&e.push(u("get",t.get)),t.reset&&e.push(u("reset",t.reset)),t.dispose&&e.push(u("dispose",t.dispose)),e}),[]);return function(){return r.forEach((function(e){return e()}))}},dispose:function(){i.dispose.forEach((function(e){return e()})),a()},reset:a,forceUpdate:function(e){var t=r.get(e);i.set.forEach((function(n){return n(e,t,t)}))}}}(e,t);return n.use(function(){var e=new Map;return{dispose:function(){return e.clear()},get:function(t){var n=ne();n&&function(e,t,n){var r=e.get(t);r?r.includes(n)||r.push(n):e.set(t,[n])}
vendor: 7,807 bytes, line 2
2(e,t,n)},set:function(t){var n=e.get(t);n&&e.set(t,n.filter(ie)),vr(e)},reset:function(){e.forEach((function(e){return e.forEach(ie)})),vr(e)}}}()),n}({}),br=yr.state,kr=yr.onChange,_r=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()}(),wr="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,xr="undefined"!==typeof n.g&&n.g.Math===Math?n.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),Sr="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(xr):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var Er=["top","right","bottom","left","width","height","size","weight"],Tr="undefined"!==typeof MutationObserver,Pr=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&s()}function o(){Sr(a)}function s(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(o,t);i=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){wr&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Tr?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){wr&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;Er.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Cr=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},Rr=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||xr},Zr=Dr(0,0,0,0);function Mr(e){return parseFloat(e)||0}function Ar(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+Mr(e["border-"+n+"-width"])}),0)}function Ir(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Zr;var r=Rr(e).getComputedStyle(e),i=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],a=e["padding-"+i];t[i]=Mr(a)}return t}(r),a=i.left+i.right,o=i.top+i.bottom,s=Mr(r.width),c=Mr(r.height);if("border-box"===r.boxSizing&&(Math.round(s+a)!==t&&(s-=Ar(r,"left","right")+a),Math.round(c+o)!==n&&(c-=Ar(r,"top","bottom")+o)),!function(e){return e===Rr(e).document.documentElement}(e)){var u=Math.round(s+a)-t,l=Math.round(c+o)-n;1!==Math.abs(u)&&(s-=u),1!==Math.abs(l)&&(c-=l)}return Dr(i.left,i.top,s,c)}var Or="undefined"!==typeof SVGGraphicsElement?function(e){return e instanceof Rr(e).SVGGraphicsElement}:function(e){return e instanceof Rr(e).SVGElement&&"function"===typeof e.getBBox};function Lr(e){return wr?Or(e)?function(e){var t=e.getBBox();return Dr(0,0,t.width,t.height)}(e):Ir(e):Zr}function Dr(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Nr=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dr(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Lr(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),jr=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,o=Object.create(a.prototype);return Cr(o,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),o}(t);Cr(this,{target:e,contentRect:n})},Br=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new _r,"function"!==typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof Rr(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Nr(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(e instanceof Rr(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new jr(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Ur="undefined"!==typeof WeakMap?new WeakMap:new _r,Vr=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Pr.getInstance(),r=new Br(t,n,this);Ur.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Vr.prototype[e]=function(){var t;return(t=Ur.get(this))[e].apply(t,arguments)}}));
2var Fr,zr,Hr="undefined"!==typeof xr.ResizeObserver?xr.ResizeObserver:Vr,qr=function(e){return!!Gr(e)&&("LIVESTREAM"===e.meta.viewType&&"ON_STAGE"!==e.stage.status)},Gr=function(e){var t;return(null===(t=null===e||void 0===e?void 0:e.self)||void 0===t?void 0:t.permissions.isV2)&&(null===e||void 0===e?void 0:e.livestream)};!function(e){e.BUFFERING="Buffering",e.ENDED="Ended",e.IDLE="Idle",e.PLAYING="Playing",e.READY="Ready"}(Fr||(Fr={})),function(e){e.INITIALIZED="PlayerInitialized",e.QUALITY_CHANGED="PlayerQualityChanged",e.DURATION_CHANGED="PlayerDurationChanged",e.VOLUME_CHANGED="PlayerVolumeChanged",e.MUTED_CHANGED="PlayerMutedChanged",e.PLAYBACK_RATE_CHANGED="PlayerPlaybackRateChanged",e.REBUFFERING="PlayerRebuffering",e.AUDIO_BLOCKED="PlayerAudioBlocked",e.PLAYBACK_BLOCKED="PlayerPlaybackBlocked",e.ERROR="PlayerError",e.RECOVERABLE_ERROR="PlayerRecoverableError",e.ANALYTICS_EVENT="PlayerAnalyticsEvent",e.TIME_UPDATE="PlayerTimeUpdate",e.BUFFER_UPDATE="PlayerBufferUpdate",e.SEEK_COMPLETED="PlayerSeekCompleted",e.SESSION_DATA="PlayerSessionData",e.STATE_CHANGED="PlayerStateChanged",e.WORKER_ERROR="PlayerWorkerError",e.METADATA="PlayerMetadata",e.TEXT_CUE="PlayerTextCue",e.TEXT_METADATA_CUE="PlayerTextMetadataCue",e.AD_CUE="PlayerAdCue",e.STREAM_SOURCE_CUE="PlayerStreamSourceCue",e.NETWORK_UNAVAILABLE="PlayerNetworkUnavailable",e.SEGMENT_DISCONTINUITY="PlayerSegmentDiscontinuity",e.SEGMENT_METADATA="PlayerSegmentMetadata",e.PLAYER_METADATA="PlayerMetadata"}(zr||(zr={}));var Wr=[zr.TIME_UPDATE,zr.BUFFER_UPDATE,zr.TEXT_METADATA_CUE,zr.PLAYER_METADATA],Jr=[zr.REBUFFERING,zr.AUDIO_BLOCKED,zr.PLAYBACK_BLOCKED,zr.ERROR,zr.RECOVERABLE_ERROR,zr.WORKER_ERROR,zr.NETWORK_UNAVAILABLE,zr.ANALYTICS_EVENT,zr.PLAYBACK_RATE_CHANGED,zr.QUALITY_CHANGED,zr.INITIALIZED],$r=function(e){var t,n,r,i,a,o;return!!Gr(e)&&("ALLOWED"===(null===(n=null===(t=null===e||void 0===e?void 0:e.self)||void 0===t?void 0:t.permissions)||void 0===n?void 0:n.canProduceAudio)||"ALLOWED"===(null===(i=null===(r=null===e||void 0===e?void 0:e.self)||void 0===r?void 0:r.permissions)||void 0===i?void 0:i.canProduceScreenshare)||"ALLOWED"===(null===(o=null===(a=null===e||void 0===e?void 0:e.self)||void 0===a?void 0:a.permissions)||void 0===o?void 0:o.canProduceVideo))},Kr=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var n;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",ar);case 2:return e.prev=2,e.next=5,fetch(t);case 5:if((n=e.sent).ok){e.next=8;break}return e.abrupt("return",ar);case 8:return e.t0=Object,e.t1={},e.t2=ar,e.next=13,n.json();case 13:return e.t3=e.sent,e.abrupt("return",e.t0.assign.call(e.t0,e.t1,e.t2,e.t3));case 17:return e.prev=17,e.t4=e.catch(2),e.abrupt("return",ar);case 20:case"end":return e.stop()}}),e,null,[[2,17]])})));return function(t){return e.apply(this,arguments)}}(),Qr=768,Yr=1080,Xr=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.roomJoinedListener=function(){n.setStates({meeting:"joined"}),br.meeting="joined"},this.waitlistedListener=function(){n.setStates({meeting:"waiting"}),br.meeting="waiting"},this.roomLeftListener=function(e){var t=e.state,r=n.states||br;if("disconnected"===(null===r||void 0===r?void 0:r.roomLeftState))return n.setStates({meeting:"ended",roomLeftState:t}),void(br.meeting="ended");n.setStates({meeting:"ended",roomLeftState:t}),br.meeting="ended",br.roomLeftState=t},this.mediaPermissionUpdateListener=function(e){var t=e.kind,r=e.message;if(["audio","video"].includes(t)){if("ACCEPTED"===r)return;var i={enabled:!0,kind:t};n.setStates({activePermissionsMessage:i}),br.activePermissionsMessage=i}},this.joinStateAcceptedListener=function(){n.setStates({activeJoinStage:!0}),n.stateUpdate.emit({activeJoinStage:!0}),br.activeJoinStage=!0},this.loadConfigFromPreset=!0,this.applyDesignSystem=!0,this.mode="fixed",this.leaveOnUnmount=!1,this.meeting=void 0,this.showSetupScreen=void 0,this.t=ir(),this.config=Ue,this.iconPackUrl=void 0,this.size=void 0,this.gridLayout="row",this.states={meeting:"idle",prefs:{mirrorVideo:!0,muteNotificationSounds:!1}},this.newMeeting=void 0,this.iconPack=ar}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e,t=this;this.resizeObserver=new Hr((function(){return t.handleResize()})),this.resizeObserver.observe(this.host),this.applyDesignSystem&&null!=(null===(e=this.config)||void 0===e?void 0:e.designTokens)&&"undefined"!==typeof document&&ht(document.documentElement,this.config.designTokens),this.meetingChanged(this.meeting),this.iconPackUrlChanged(this.iconPackUrl),this.initializePreferences()}},{key:"clearListeners",value:function(e){void 0!=e&&(e.self.removeListener("roomJoined",this.roomJoinedListener),e.self.removeListener("socketServiceRoomJoined",this.roomJoinedListener),e.meta.removeListener("socketReconnected",this.roomJoinedListener),e.self.removeListener("roomLeft",this.roomLeftListener),e.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),e.self.removeListener("waitlisted",this.waitlistedListener),e.self.removeListener("joinStageRequestAccepted",this.joinStateAcceptedListener))}},{key:"disconnectedCallback",value:function(){var e;this.leaveOnUnmount&&(null===(e=this.meeting)||void 0===e||e.leaveRoom()),this.resizeObserver.disconnect(),this.clearListeners(this.meeting)}},{key:"meetingChanged",value:function(e){var t,n;if(null!=e){if(this.loadConfigFromPreset&&null!=e.self.config){var r=e.self.config,i=nr(r),a=i.config,o=i.data;this.config===Ue&&(this.config=a),null==this.showSetupScreen&&(this.showSetupScreen=o.showSetupScreen),e.connectedMeetings.supportsConnectedMeetings&&(null===(t=br.activeBreakoutRoomsManager)||void 0===t?void 0:t.destinationMeetingId)&&(this.showSetupScreen=!1)}this.applyDesignSystem&&null!=(null===(n=this.config)||void 0===n?void 0:n.designTokens)&&"undefined"!==typeof document&&ht(document.documentElement,this.config.designTokens),qr(e)?e.self.addListener("socketServiceRoomJoined",this.roomJoinedListener):e.self.addListener("roomJoined",this.roomJoinedListener),e.self.addListener("waitlisted",this.waitlistedListener),e.self.addListener("roomLeft",this.roomLeftListener),e.self.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),e.self.addListener("joinStageRequestAccepted",this.joinStateAcceptedListener),e.connectedMeetings.supportsConnectedMeetings&&e.connectedMeetings.once("changingMeeting",this.handleChangingMeeting),e.self.roomJoined?(this.states=Object.assign(Object.assign({},this.states),{meeting:"joined"}),br.meeting="joined"):this.showSetupScreen&&null==this.newMeeting?(this.states=Object.assign(Object.assign({},this.states),{meeting:"setup"}),br.meeting="setup"):e.joinRoom()}}},{key:"iconPackUrlChanged",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Kr(t);case 2:this.iconPack=e.sent;case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"listenState",value:function(e){e.stopPropagation(),this.setStates(e.detail)}},{key:"initializePreferences",value:function(){var e=function(){var e=JSON.parse(ur.getItem(lr)||"{}");return{mirrorVideo:!e["mirror-video"]||"true"===e["mirror-video"],muteNotificationSounds:!!e["mute-notification-sounds"]&&"true"===e["mute-notification-sounds"]}}();this.setStates({prefs:e}),br.prefs=e}},{key:"handleChangingMeeting",value:function(e){br.activeBreakoutRoomsManager=Object.assign(Object.assign({},br.activeBreakoutRoomsManager),{destinationMeetingId:e})}},{key:"handleResize",value:function(){var e;this.size=(e=this.host.clientWidth)>=Yr?"lg":e>=Qr?"md":"sm"}},{key:"setStates",value:function(e){var t=Object.assign({},this.states);tr(t,e),this.states=t}},{key:"render",value:function(){var e,t={meeting:null!==(e=this.newMeeting)&&void 0!==e?e:this.meeting,size:this.size,states:this.states||br,config:this.config,iconPack:this.iconPack,t:this.t},n={"dyte-grid":{layout:this.gridLayout}};return T(sr,{element:"dyte-meeting",defaults:t,asHost:!0,elementProps:n})}},{key:"host",get:function(){return A(this)}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],iconPackUrl:["iconPackUrlChanged"]}}}]),e}();Xr.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);box-sizing:border-box;display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));overflow:hidden;position:fixed;top:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);height:100%;width:100%}:host([mode='fill']){position:relative}";var ei=Object.freeze({__proto__:null,dyte_meeting:Xr}),ti=0;var ni="temp-";function ri(e){return e.includes(ni)}function ii(e){var t;return null!==(t=e.customParticipantId)&&void 0!==t?t:e.clientSpecificId}function ai(e){var t=new Map;return[e.self].concat((0,m.Z)(e.participants.joined.toArray())).map((function(e){t.set(ii(e),e.picture)})),[e.connectedMeetings.parentMeeting].concat((0,m.Z)(e.connectedMeetings.meetings)).flatMap((function(e){return e.participants})).map((function(e){return{id:e.id,customParticipantId:ii(e),displayName:e.displayName,displayPictureUrl:""!==e.displayPictureUrl?e.displayPictureUrl:t.get(ii(e))}}))}
2var oi,si,ci,ui,li,di,pi,hi,fi,vi,mi,gi,yi,bi,ki,_i=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n},wi=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},xi=function(){function e(){(0,s.Z)(this,e),oi.add(this),si.set(this,!1),ci.set(this,void 0),ui.set(this,void 0),li.set(this,void 0),di.set(this,void 0),pi.set(this,void 0),hi.set(this,void 0),fi.set(this,void 0),vi.set(this,void 0)}return(0,c.Z)(e,[{key:"hasLocalChanges",get:function(){return wi(this,si,"f")}},{key:"currentState",get:function(){var e,t=this,n=[];return Array.from(wi(this,di,"f").keys()).forEach((function(r){var i=wi(t,hi,"f").get(r);i.isParent?e=Object.assign(Object.assign({},i),{participants:wi(t,oi,"m",ki).call(t,r)}):n.push(Object.assign(Object.assign({},i),{participants:wi(t,oi,"m",ki).call(t,r)}))})),{parentMeeting:e,meetings:n}}},{key:"allConnectedMeetings",get:function(){return this.currentState.meetings.sort((function(e,t){return e.title.localeCompare(t.title)}))}},{key:"allParticipants",get:function(){return Array.from(wi(this,pi,"f").values())}},{key:"unassignedParticipants",get:function(){return wi(this,oi,"m",ki).call(this,wi(this,ci,"f").parentMeeting.id)}},{key:"getParticipantsForMeeting",value:function(e){return wi(this,oi,"m",ki).call(this,e)}},{key:"addNewMeeting",value:function(){_i(this,si,!0,"f");var e=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}({id:"".concat(ni).concat(Math.random().toString(36)),title:"Room ".concat(++ti),participants:[]},["participants"]);return wi(this,oi,"m",gi).call(this,Object.assign(Object.assign({},e),{isParent:!1})),e}},{key:"addNewMeetings",value:function(e){var t=this;return Array.from({length:e}).map((function(){return t.addNewMeeting()}))}},{key:"updateMeetingTitle",value:function(e,t){wi(this,hi,"f").get(e).title=t,ri(e)||wi(this,fi,"f").add(e)}},{key:"deleteMeeting",value:function(e){_i(this,si,!0,"f");var t=wi(this,hi,"f").get(e),n=wi(this,oi,"m",ki).call(this,t.id).map(ii);this.assignParticipantsToMeeting(n,wi(this,ci,"f").parentMeeting.id),wi(this,hi,"f").delete(t.id),wi(this,di,"f").delete(t.id),ri(t.id)||wi(this,vi,"f").add(t.id)}},{key:"assignParticipantsToMeeting",value:function(e,t){var n=this;return _i(this,si,!0,"f"),e.forEach((function(e){var r=wi(n,ui,"f").get(e);wi(n,di,"f").get(r).delete(e),wi(n,di,"f").get(t).add(e),wi(n,ui,"f").set(e,t)})),this.currentState}},{key:"assignParticipantsRandomly",value:function(){var e=this,t=function(e,t){for(var n=e.length,r=Math.ceil(n/t),i=new Array(t),a=0,o=0;o<t;o++)i[o]=e.slice(a,a+r),a+=r;return i.filter((function(e){return e.length}))}(this.unassignedParticipants,this.allConnectedMeetings.length);return this.allConnectedMeetings.forEach((function(n,r){var i=t[r];i&&0!==i.length&&e.assignParticipantsToMeeting(i.map((function(e){return e.customParticipantId})),n.id)})),this.currentState}},{key:"unassignParticipants",value:function(e){var t=wi(this,ci,"f").parentMeeting.id;return this.assignParticipantsToMeeting(e,t)}},{key:"unassignAllParticipants",value:function(){var e=wi(this,ci,"f").parentMeeting.id,t=this.allParticipants.map(ii);return this.assignParticipantsToMeeting(t,e)}},{key:"updateCurrentState",value:function(e){var t=this;wi(this,si,"f")||wi(this,oi,"m",mi).call(this,e),[e.parentMeeting].concat((0,m.Z)(e.meetings)).forEac
2h((function(e,n){var r=Object.assign(Object.assign({},e),{isParent:0===n});wi(t,oi,"m",gi).call(t,r),e.participants.forEach((function(e){wi(t,oi,"m",yi).call(t,e,r)}))}))}},{key:"meetingsToCreate",get:function(){return this.allConnectedMeetings.filter((function(e){return ri(e.id)})).map((function(e){return{id:e.id,title:e.title}}))}},{key:"meetingsToUpdate",get:function(){var e=this;return this.allConnectedMeetings.filter((function(t){return wi(e,fi,"f").has(t.id)})).map((function(e){return{id:e.id,title:e.title}}))}},{key:"meetingsToDelete",get:function(){return Array.from(wi(this,vi,"f"))}},{key:"participantsToMove",get:function(){var e=this,t=new Map;return Array.from(wi(this,ui,"f").keys()).forEach((function(n){var r=wi(e,li,"f").get(n),i=wi(e,ui,"f").get(n);if(r!==i){var a="".concat(r,"__").concat(i);t.has(a)||t.set(a,[]);var o=wi(e,pi,"f").get(n);t.get(a).push(o.id)}})),Array.from(t.keys()).map((function(e){var n=e.split("__"),r=(0,v.Z)(n,2);return{sourceMeetingId:r[0],destinationMeetingId:r[1],participantIds:t.get(e)}}))}},{key:"applyChanges",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var n,r,i,a,o,s=this;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=0!==this.meetingsToCreate.length?t.connectedMeetings.createMeetings(this.meetingsToCreate):Promise.resolve([]),r=0!==this.meetingsToUpdate.length?t.connectedMeetings.updateMeetings(this.meetingsToUpdate):Promise.resolve(),e.next=4,Promise.all([n,r]);case 4:i=e.sent,a=(0,v.Z)(i,1),(o=a[0])&&o.forEach((function(e){s.meetingsToCreate.forEach((function(t){t.title===e.title&&wi(s,oi,"m",bi).call(s,wi(s,hi,"f").get(t.id),e.id)}))})),0!==this.participantsToMove.length&&this.participantsToMove.forEach((function(e){var n=e.sourceMeetingId,r=e.destinationMeetingId,i=e.participantIds;t.connectedMeetings.moveParticipants(n,r,i)})),0!==this.meetingsToDelete.length&&t.connectedMeetings.deleteMeetings(this.meetingsToDelete);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"discardChanges",value:function(){return _i(this,si,!1,"f"),this.updateCurrentState(wi(this,ci,"f")),this.currentState}}]),e}();si=new WeakMap,ci=new WeakMap,ui=new WeakMap,li=new WeakMap,di=new WeakMap,pi=new WeakMap,hi=new WeakMap,fi=new WeakMap,vi=new WeakMap,oi=new WeakSet,mi=function(e){var t=this;_i(this,ci,e,"f"),_i(this,hi,new Map,"f"),_i(this,pi,new Map,"f"),_i(this,fi,new Set,"f"),_i(this,vi,new Set,"f"),_i(this,di,new Map,"f"),_i(this,ui,new Map,"f"),_i(this,li,new Map,"f"),_i(this,li,new Map,"f"),wi(this,ci,"f").parentMeeting.participants.forEac
2h((function(e){wi(t,li,"f").set(ii(e),wi(t,ci,"f").parentMeeting.id)})),wi(this,ci,"f").meetings.forEach((function(e){e.participants.forEach((function(n){wi(t,li,"f").set(ii(n),e.id)}))}))},gi=function(e){wi(this,hi,"f").has(e.id)||(wi(this,hi,"f").set(e.id,e),wi(this,di,"f").set(e.id,new Set))},yi=function(e,t){wi(this,pi,"f").has(ii(e))||(wi(this,pi,"f").set(ii(e),e),wi(this,ui,"f").set(ii(e),t.id),wi(this,di,"f").get(t.id).add(ii(e)))},bi=function(e,t){var n=this,r=e.id;wi(this,oi,"m",gi).call(this,Object.assign(Object.assign({},e),{id:t})),wi(this,hi,"f").delete(r);var i=wi(this,di,"f").get(r);wi(this,di,"f").set(t,i),wi(this,di,"f").delete(r),Array.from(wi(this,ui,"f").keys()).forEach((function(e){wi(n,ui,"f").get(e)===r&&wi(n,ui,"f").set(e,t)}))},ki=function(e){var t=this;return Array.from(wi(this,di,"f").get(e)).map((function(e){return wi(t,pi,"f").get(e)}))};var Si=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.updateLocalState=function(e){n.stateManager.updateCurrentState(e),n.draftState=n.stateManager.currentState,n.meeting.connectedMeetings.isActive&&(n.roomConfig=Object.assign(Object.assign({},n.roomConfig),{mode:"edit"})),"create"!==n.roomConfig.mode||n.meeting.connectedMeetings.isActive||(ti=0),["edit","view"].includes(n.roomConfig.mode)&&(n.roomConfig=Object.assign(Object.assign({},n.roomConfig),{rooms:e.meetings.length,step:"participants-config"}),n.selectedParticipants=[])},this.onAddNewRoom=function(){n.stateManager.addNewMeeting(),n.draftState=n.stateManager.currentState,n.selectorRef.scrollTo({top:n.selectorRef.scrollHeight,behavior:"smooth"})},this.onRoomUpdate=function(e){var t=e.detail;n.stateManager.updateMeetingTitle(t.id,t.title),n.draftState=n.stateManager.currentState},this.onRoomDelete=function(e){n.stateManager.allConnectedMeetings.find((function(t){return t.id===e}))&&(n.stateManager.deleteMeeting(e),n.draftState=n.stateManager.currentState)},this.unassignParticipant=function(e){n.stateManager.unassignParticipants([e]),n.draftState=n.stateManager.currentState},this.onUnassignAll=function(){n.stateManager.unassignAllParticipants(),n.draftState=n.stateManager.currentState},this.assignParticipantsToRoom=function(e){0!==n.selectedParticipants.length&&0!=n.assigningParticipants&&(n.stateManager.assignParticipantsToMeeting(n.selectedParticipants,e),n.draftState=n.stateManager.currentState,n.selectedParticipants=[],n.assigningParticipants=!1,n.setEphemeralStatus(n.t("breakout_rooms.ephemeral_status.participants_assigned")))},this.handleClose=function(e,t){e.emit({activeBreakoutRoomsManager:{active:!0}}),t.activeBreakoutRoomsManager={active:!0}},this.enableConfirmationModal=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"start-breakout",t={active:!0,header:"breakout_rooms.confirm_modal.start_breakout.header",content:"breakout_rooms.confirm_modal.start_breakout.content",variant:"primary",cancelText:"breakout_rooms.confirm_modal.start_breakout.cancelText",ctaText:"breakout_rooms.confirm_modal.start_breakout.ctaText",onClick:function(){return n.applyChanges()},onClose:n.handleClose};"close-breakout"===e&&(t={active:!0,header:"breakout_rooms.confirm_modal.close_breakout.header",content:"breakout_rooms.confirm_modal.close_breakout.content",variant:"danger",cancelText:"cancel",ctaText:"breakout_rooms.confirm_modal.close_breakout.ctaText",onClick:function(){return n.closeBreakout()},onClose:n.handleClose}),n.stateUpdate.emit({activeBreakoutRoomsManager:{active:!1},activeConfirmationModal:t}),br.activeBreakoutRoomsManager={active:!1},br.activeConfirmationModal=t},this.close=function(){var e;n.stateManager.discardChanges(),null===(e=n.stateUpdate)||void 0===e||e.emit({activeBreakoutRoomsManager:{active:!1}}),br.activeBreakoutRoomsManager={active:!1}},this.applyChanges=(0,f.Z)((0,h.Z)().mark((function e(){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.roomConfig=Object.assign(Object.assign({},n.roomConfig),{applyingChanges:!0}),e.next=3,n.stateManager.applyChanges(n.meeting);case 3:n.close(),n.roomConfig=Object.assign(Object.assign({},n.roomConfig),{applyingChanges:!1});case 5:case"end":return e.stop()}}),e)}))),this.loading=!1,this.roomConfig={rooms:2,step:"room-config",mode:"create",applyingChanges:!1},this.draftState=void 0,this.assigningParticipants=!1,this.selectedParticipants=[],this.ephemeralStatusText="",this.isDragMode=!1,this.meeting=void 0,this.states=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"onSelectedParticipantsChanged",value:function(e){e.length>0?this.assigningParticipants=!0:this.assigningParticipants=!1}},{key:"connectedCallback",value:function(){this.permissions=this.meeting.self.permissions.connectedMeetings,this.meeting.connectedMeetings.on("stateUpdate",this.updateLocalState),this.meeting.connectedMeetings.on("changingMeeting",this.close),this.stateManager=new xi,this.fetchRoomState()}},{key:"disconnectedCallback",value:function(){this.meeting.connectedMeetings.off("stateUpdate",this.updateLocalState),this.meeting.connectedMeetings.off("changingMeeting",this.close)}},{key:"fetchRoomState",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.loading=!0,e.next=3,this.meeting.connectedMeetings.getConnectedMeetings();case 3:this.loading=!1;case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setEphemeralStatus",value:function(e){var t=this;this.ephemeralStatusText=e,setTimeout((function(){t.ephemeralStatusText=""}),3e3)}},{key:"onCreateRooms",value:function(){this.selectedParticipants=[],this.stateManager.addNewMeetings(this.roomConfig.rooms),this.draftState=this.stateManager.currentState,this.roomConfig=Object.assign(Object.assign({},this.roomConfig),{step:"participants-config"})}},{key:"onParticipantDelete",value:function(e){var t=ii(e.detail);null!=t&&this.unassignParticipant(t)}
2},{key:"toggleDragMode",value:function(e){this.isDragMode=e.detail}},{key:"assignParticipantsRandomly",value:function(){0!==this.stateManager.unassignedParticipants.length&&(this.stateManager.assignParticipantsRandomly(),this.draftState=this.stateManager.currentState,this.setEphemeralStatus(this.t("breakout_rooms.ephemeral_status.participants_assigned_randomly")))}},{key:"joinRoom",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var n;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ii(this.meeting.self),this.stateManager.assignParticipantsToMeeting([n],t),e.next=4,this.applyChanges();case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"closeBreakout",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){var t=this;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateManager.allConnectedMeetings.forEach((function(e){return t.stateManager.deleteMeeting(e.id)})),e.next=3,this.applyChanges();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"updateSelectedParticipants",value:function(e){this.selectedParticipants=e.detail}},{key:"updateAllParticipants",value:function(e){this.selectedParticipants=e.detail}},{key:"getStatusText",value:function(){if(""!==this.ephemeralStatusText)return this.ephemeralStatusText;var e="";return"create"===this.roomConfig.mode&&(e=this.t("breakout_rooms.status.assign_multiple"),0!==this.selectedParticipants.length&&(e=this.t("breakout_rooms.status.select_room"))),e}},{key:"getApproxDistribution",value:function(){var e=this.stateManager.unassignedParticipants.length/(this.roomConfig.rooms||1);return Math.max(1,Math.round(e))}},{key:"deselectAll",value:function(){this.selectedParticipants=[]}},{key:"discardChanges",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stateManager.discardChanges(),e.next=3,this.fetchRoomState();case 3:this.setEphemeralStatus(this.t("breakout_rooms.ephemeral_status.changes_discarded"));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"shouldShowOnlyRoomSwitcher",value:function(){return!1===this.permissions.canAlterConnectedMeetings}},{key:"getPermittedRooms",value:function(){var e=this;return this.permissions.canAlterConnectedMeetings||this.permissions.canSwitchConnectedMeetings?this.stateManager.allConnectedMeetings:this.stateManager.allConnectedMeetings.filter((function(t){return t.id===e.meeting.meta.roomName}))}},{key:"renderMainRoomMaybe",value:function(){var e=this;return this.meeting.connectedMeetings.isActive&&this.permissions.canSwitchToParentMeeting?T("dyte-breakout-room-manager",{key:this.stateManager.currentState.parentMeeting.id,assigningParticipants:this.assigningParticipants,isDragMode:this.isDragMode,meeting:this.meeting,mode:this.roomConfig.mode,onParticipantsAdd:function(){return e.assignParticipantsToRoom(e.stateManager.currentState.parentMeeting.id)},onRoomJoin:function(){return e.joinRoom(e.stateManager.currentState.parentMeeting.id)},onUpdate:this.onRoomUpdate,states:this.states,room:Object.assign({},this.stateManager.currentState.parentMeeting),iconPack:this.iconPack,t:this.t}):null}},{key:"renderRoomSwitcher",value:function(){var e=this;return T(C,null,T("div",{class:"room-switcher-container"},T("header",null,T("dyte-icon",{icon:this.iconPack.breakout_rooms}),T("span",null,this.t("breakout_rooms.join_breakout_header"))),T("div",{class:"rooms",ref:function(t){return e.selectorRef=t}},this.renderMainRoomMaybe(),this.getPermittedRooms().map((function(t,n){return T("dyte-breakout-room-manager",{key:t.id,assigningParticipants:e.assigningParticipants,isDragMode:e.isDragMode,defaultExpanded:0===n,meeting:e.meeting,mode:e.roomConfig.mode,onDelete:function(){return e.onRoomDelete(t.id)},onParticipantsAdd:function(){return e.assignParticipantsToRoom(t.id)},onRoomJoin:function(){return e.joinRoom(t.id)},states:e.states,room:Object.assign({},t),iconPack:e.iconPack,t:e.t,allowDelete:!1})}
2)))))}},{key:"renderLoading",value:function(){return T(C,null,T("div",{class:"loading-content"},T("dyte-spinner",{size:"xl"})))}},{key:"renderRoomConfig",value:function(){var e=this;return T(C,null,T("div",{class:"room-config"},T("header",null,T("dyte-icon",{icon:this.iconPack.breakout_rooms}),T("span",null,this.t("breakout_rooms.room_config_header"))),T("div",{class:"create-room"},T("p",null,this.t("breakout_rooms.num_of_rooms")),T("dyte-counter",{value:this.roomConfig.rooms,minValue:1,iconPack:this.iconPack,t:this.t,onValueChange:function(t){e.roomConfig=Object.assign(Object.assign({},e.roomConfig),{rooms:Math.max(+t.detail,1)})}})),T("span",{class:"distribution-hint"},"".concat(this.t("breakout_rooms.approx")," ")," ",T("em",null,this.getApproxDistribution()," ",this.t("breakout_rooms.participants_per_room"))," ",this.t("breakout_rooms.division_text")),T("footer",null,T("dyte-button",{kind:"button",iconPack:this.iconPack,t:this.t,size:"lg",title:this.t("create"),disabled:0===this.roomConfig.rooms,onClick:function(){return e.onCreateRooms()}},this.t("create")))))}},{key:"render",value:function(){var e=this;return this.loading?this.renderLoading():this.shouldShowOnlyRoomSwitcher()?this.renderRoomSwitcher():"room-config"===this.roomConfig.step?this.renderRoomConfig():T(C,null,T("div",{class:"participant-config-wrapper"},T("div",{class:"participant-config"},T("aside",{part:"menu"},T("header",null,this.t("breakout_rooms.assign_participants")),T("dyte-breakout-room-participants",{meeting:this.meeting,iconPack:this.iconPack,t:this.t,participantIds:this.stateManager.unassignedParticipants.map(ii),selectedParticipantIds:this.selectedParticipants},T("dyte-tooltip",{label:this.t("breakout_rooms.shuffle_participants"),iconPack:this.iconPack,t:this.t,slot:"shuffle-button"},T("dyte-button",{disabled:"edit"===this.roomConfig.mode||0===this.stateManager.unassignedParticipants.length,iconPack:this.iconPack,t:this.t,kind:"button",variant:"secondary",size:"md",onClick:function(){return e.assignParticipantsRandomly()},class:"shuffle-button br-primary-btn"},T("dyte-icon",{icon:this.iconPack.shuffle,iconPack:this.iconPack,t:this.t})))),0!==this.selectedParticipants.length&&T("div",{class:"participants-assign-actions"},T("span",null,"".concat(this.selectedParticipants.length," ").concat(this.t("breakout_rooms.selected"))),T("dyte-button",{disabled:"edit"===this.roomConfig.mode,iconPack:this.iconPack,t:this.t,kind:"button",variant:"ghost",size:"md",onClick:function(){return e.deselectAll()},class:"deselect-button color-danger"},this.t("breakout_rooms.deselect")))),T("div",{class:"assign-rooms"},T("div",{class:"row"},T("p",{class:"row-header"},this.t("breakout_rooms.rooms")," (",this.stateManager.allConnectedMeetings.length,")"),!this.assigningParticipants&&T("div",{class:"cta-buttons"},T("dyte-button",{kind:"button",variant:"secondary",iconPack:this.iconPack,t:this.t,class:"br-primary-btn"},T("div",{onClick:this.onAddNewRoom},T("dyte-icon",{icon:this.iconPack.add,iconPack:this.iconPack,t:this.t}),this.t("breakout_rooms.add_room"))),0!==this.stateManager.allConnectedMeetings.flatMap((function(e){return e.participants})).length&&T("dyte-button",{kind:"button",variant:"ghost",onClick:this.onUnassignAll,iconPack:this.iconPack,t:this.t},this.t("breakout_rooms.unassign_all")))),T("div",{class:"rooms",ref:function(t){return e.selectorRef=t}},this.renderMainRoomMaybe(),this.getPermittedRooms().map((function(t,n){return T("dyte-breakout-room-manager",{key:t.id,assigningParticipants:e.assigningParticipants,isDragMode:e.isDragMode,defaultExpanded:0===n,meeting:e.meeting,mode:e.roomConfig.mode,onDelete:function(){return e.onRoomDelete(t.id)},onParticipantsAdd:function(){return e.assignParticipantsToRoom(t.id)},onRoomJoin:function(){return e.joinRoom(t.id)},onUpdate:e.onRoomUpdate,states:e.states,room:Object.assign({},t),iconPack:e.iconPack,t:e.t,allowDelete:e.stateManager.allConnectedMeetings.length>1})})),T("dyte-button",{kind:"button",variant:"secondary",iconPack:this.iconPack,t:this.t,onClick:this.onAddNewRoom,class:"add-room-jumbo-btn br-secondary-btn"},T("div",null,T("dyte-icon",{icon:this.iconPack.add,iconPack:this.iconPack,t:this.t}),T("span",null,this.t("breakout_rooms.add_room_brief"))))))),T("div",{class:"participant-config-actions"},T("div",{class:{"status-bar":!0,"ephemeral-status":""!==this.ephemeralStatusText}},""!==this.ephemeralStatusText&&T("dyte-icon",{icon:this.iconPack.checkmark,iconPack:this.iconPack,t:this.t}
2),this.getStatusText()),T("div",{class:"breakout-actions"},"create"===this.roomConfig.mode&&this.permissions.canAlterConnectedMeetings&&T("dyte-button",{size:"md",iconPack:this.iconPack,t:this.t,class:"start-breakout-button",onClick:function(){return e.enableConfirmationModal("start-breakout")}},this.t("breakout_rooms.start_breakout")),"edit"===this.roomConfig.mode&&this.stateManager.hasLocalChanges&&this.permissions.canAlterConnectedMeetings&&T("dyte-button",{size:"md",iconPack:this.iconPack,t:this.t,class:"color-danger",variant:"ghost",onClick:function(){return e.discardChanges()}},this.t("breakout_rooms.discard_changes")),"edit"===this.roomConfig.mode&&this.stateManager.hasLocalChanges&&this.permissions.canAlterConnectedMeetings&&T("dyte-button",{size:"md",iconPack:this.iconPack,t:this.t,class:"update-breakout-button",onClick:this.applyChanges},this.t("breakout_rooms.update_breakout")),"edit"===this.roomConfig.mode&&!this.stateManager.hasLocalChanges&&this.permissions.canAlterConnectedMeetings&&T("dyte-button",{size:"md",iconPack:this.iconPack,t:this.t,class:"close-breakout-button",onClick:function(){return e.enableConfirmationModal("close-breakout")}},this.t("breakout_rooms.close_breakout"))))))}}],[{key:"watchers",get:function(){return{selectedParticipants:["onSelectedParticipantsChanged"]}}}]),e}();Si.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.color-brand{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.color-danger{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}.loading-content{height:var(--dyte-space-60, 240px);width:var(--dyte-space-96, 384px);padding:var(--dyte-space-9, 36px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));display:flex;align-items:center;justify-content:center}.room-config{overflow:hidden;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));display:flex;flex-direction:column;width:var(--dyte-space-96, 384px);padding-left:var(--dyte-space-9, 36px);padding-right:var(--dyte-space-9, 36px);padding-top:var(--dyte-space-10, 40px);padding-bottom:var(--dyte-space-10, 40px)}header{margin-bottom:var(--dyte-space-8, 32px);display:flex;align-items:center;gap:var(--dyte-space-2, 8px);font-size:24px;font-weight:600}header dyte-icon{height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px)}.create-room{margin-bottom:var(--dyte-space-4, 16px);display:flex;align-items:center;gap:var(--dyte-space-3, 12px);width:100%}.create-room p{margin:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-1, 4px);font-size:16px}.distribution-hint{margin-bottom:var(--dyte-space-8, 32px);font-size:14px;font-weight:400;color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}.distribution-hint em{font-style:normal;color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}footer{display:flex;flex-direction:row;vertical-align:middle;justify-content:center}footer dyte-button{width:100%;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}label{margin-bottom:var(--dyte-space-3, 12px);font-weight:400;color:rgb(var(--dyte-colors-text-1000, 255 255 255));opacity:0.4}.participant-config-wrapper{width:850px;height:595px;max-width:100%;max-height:100%;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));display:flex;flex-direction:column}.participant-config-actions{display:flex;justify-content:space-between;padding-left:var(--dyte-space-8, 32px);padding-right:var(--dyte-space-8, 32px);padding-top:var(--dyte-space-5, 20px);padding-bottom:var(--dyte-space-5, 20px);border-bottom-right-radius:var(--dyte-border-radius-md, 8px);border-bottom-left-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.participant-config{display:flex;flex-grow:1;flex-direction:row;overflow:hidden}aside{box-sizing:border-box;display:flex;width:var(--dyte-space-96, 384px);flex-grow:1;flex-direction:column;padding-left:var(--dyte-space-8, 32px);padding-right:var(--dyte-space-4, 16px);border-right-width:var(--dyte-border-width-sm, 1px);border-top-width:var(--dyte-border-width-none, 0);border-bottom-width:var(--dyte-border-width-none, 0);border-left-width:var(--dyte-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-right-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-border-opacity))}aside header{margin-bottom:var(--dyte-space-4, 16px);width:100%;padding-left:var(--dyte-space-0, 0px);padding-right:var(--dyte-space-0, 0px);padding-top:var(--dyte-space-8, 32px);font-size:20px;font-weight:500;line-height:2rem}.shuffle-button{display:flex;flex-direction:row;align-items:center}.shuffle-button dyte-icon{height:var(--dyte-space-8, 32px)}.participants-assign-actions{display:flex;flex-direction:row;align-items:center;justify-content:space-between;font-size:14px;padding-left:var(--dyte-space-8, 32px);padding-right:var(--dyte-space-2, 8px);margin-left:calc(var(--dyte-space-8, 32px) * -1);margin-right:calc(var(--dyte-space-4, 16px) * -1);padding-top:var(--dyte-space-0\\.5, 2px);padding-bottom:var(--dyte-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.participants-assign-actions .deselect-button{height:var(--dyte-space-6, 24px)}.participants-assign-actions .deselect-button:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.assign-rooms{padding:var(--dyte-space-8, 32px);display:flex;width:100%;flex-direction:column}.assign-rooms .disabled{opacity:0.2}.assign-rooms .back{display:flex;cursor:pointer;flex-direction:row;align-items:center;justify-content:flex-start;padding:var(--dyte-space-4, 16px);padding-bottom:var(--dyte-space-0, 0px);font-size:14px;color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.assign-rooms .back dyte-icon{height:var(--dyte-space-5, 20px)}.assign-rooms .row{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-4, 16px);font-size:14px}.assign-rooms .row-header{margin:var(--dyte-space-0, 0px);font-size:16px;line-height:2rem}.assign-rooms .cta-buttons{display:flex;align-items:center;justify-content:flex-start;gap:var(--dyte-space-2, 8px)}.assign-rooms .cta-buttons dyte-button div{display:flex;flex-direction:row;align-items:center}.assign-rooms .cta-buttons dyte-button div dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}.rooms{margin-bottom:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-1, 4px);display:flex;flex-grow:1;flex-direction:column;gap:var(--dyte-space-2, 8px);overflow-y:auto;max-height:500px}.rooms::-webkit-scrollbar{width:var(--dyte-space-1\\.5, 6px);border-radius:var(--dyte-border-radius-sm, 4px)}.rooms::-webkit-scrollbar-thumb{border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.rooms::-webkit-scrollbar-track{border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.breakout-actions{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;
2gap:var(--dyte-space-2, 8px)}.breakout-actions .start-breakout-button{color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.breakout-actions .close-breakout-button{color:rgb(var(--dyte-colors-text-1000, 255 255 255));--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-bg-opacity))}.breakout-actions .update-breakout-button{background-color:transparent;--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity));border-width:var(--dyte-border-width-sm, 1px);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-border-opacity))}.status-bar{display:flex;align-items:center;font-size:14px;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64));width:var(--dyte-space-80, 320px)}.ephemeral-status{--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}.ephemeral-status dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}.room-switcher-container{border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));width:468px;padding:var(--dyte-space-8, 32px)}.add-room-jumbo-btn div{display:flex;align-items:center;gap:var(--dyte-space-1, 4px);font-size:14px;--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.add-room-jumbo-btn div dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}.br-primary-btn:not([disabled]){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.br-primary-btn:not([disabled]):hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-600, 13 81 253) / var(--tw-bg-opacity))}.br-secondary-btn:not([disabled]){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.br-secondary-btn:not([disabled]):hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}";var Ei=Object.freeze({__proto__:null,dyte_breakout_rooms_manager:Si}),Ti="play_participant_tile_video_on_pause",Pi="disable_emoji_picker",Ci="log_playing_failures",Ri=function(e){var t;return Gr(e)||(null===(t=null===e||void 0===e?void 0:e.__internals__)||void 0===t?void 0:t.features.hasFeature("feat_paginated_chat"))},Zi=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.breakoutRoomToggle=function(){var e,t,r,i=n.meeting.connectedMeetings.isActive?"view":"create";n.stateUpdate.emit({activeBreakoutRoomsManager:{active:!(null===(t=null===(e=n.states)||void 0===e?void 0:e.activeBreakoutRoomsManager)||void 0===t?void 0:t.active),mode:i}}),br.activeBreakoutRoomsManager={active:!(null===(r=br.activeBreakoutRoomsManager)||void 0===r?void 0:r.active),mode:i}},this.variant="button",this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){var e=this.meeting.self.permissions.connectedMeetings;if((e.canAlterConnectedMeetings||this.meeting.connectedMeetings.isActive)&&((e.canSwitchConnectedMeetings||e.canSwitchToParentMeeting)&&this.meeting.connectedMeetings.supportsConnectedMeetings))return T(C,{title:this.t("breakout_rooms")},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,onClick:this.breakoutRoomToggle,icon:this.iconPack.breakout_rooms,label:this.t("breakout_rooms"),variant:this.variant}))}}]),e}();Zi.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Mi=Object.freeze({__proto__:null,dyte_breakout_rooms_toggle:Zi}),Ai=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.meeting=void 0,this.states=void 0,this.iconPack=ar,this.t=ir(),this.messagePayload={to:"Everyone",message:""},this.successMessage=!1}return(0,c.Z)(e,[{key:"close",value:function(){var e;null===(e=this.stateUpdate)||void 0===e||e.emit({activeBroadcastMessageModal:!1}),br.activeBroadcastMessageModal=!1}},{key:"sendMessage",value:function(){var e=this;this.successMessage=!0,setTimeout((function(){e.close()}),2e3)}},{key:"render",value:function(){var e=this;return T(C,null,T("div",{class:"content-col"},T("h2",null,"Broadcast message to"),T("select",{onChange:function(t){e.messagePayload=Object.assign(Object.assign({},e.messagePayload),{to:t.target.value})}},T("option",null,"Everyone"),T("option",null,"List of rooms")),T("textarea",{placeholder:"Type message here...",onInput:function(t){e.messagePayload=Object.assign(Object.assign({},e.messagePayload),{message:t.target.value})}}),this.successMessage?T("p",null,"Message sent to ",this.messagePayload.to,T("dyte-icon",{icon:this.iconPack.checkmark,iconPack:this.iconPack,t:this.t})):T("div",{class:"content-row"},T("dyte-button",{onClick:function(){return e.close()},variant:"secondary",iconPack:this.iconPack,t:this.t},"Cancel"),"\u2002",T("dyte-button",{variant:"primary",onClick:function(){return e.sendMessage()},iconPack:this.iconPack,t:this.t},"Send"))))}}]),e}();Ai.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--dyte-border-radius-md, 8px);padding:var(--dyte-space-4, 16px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));width:400px;max-width:80%}.content-col{display:flex;width:100%;flex-direction:column}h2{margin:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-2, 8px)}.content-row{display:flex;width:100%;flex-direction:row}.content-row dyte-button{margin-top:var(--dyte-space-4, 16px);width:100%}textarea{margin-top:var(--dyte-space-3, 12px);resize:none;border-radius:var(--dyte-border-radius-sm, 4px);border-width:var(--dyte-border-width-none, 0);border-style:none;font-family:var(--dyte-font-family, sans-serif);outline:2px solid transparent;outline-offset:2px;height:var(--dyte-space-16, 64px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));padding:var(--dyte-space-2, 8px);color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}textarea::-moz-placeholder{color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}textarea::placeholder{color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}select{border-radius:var(--dyte-border-radius-sm, 4px);border-width:var(--dyte-border-width-none, 0);border-style:none;padding-top:var(--dyte-space-3, 12px);padding-bottom:var(--dyte-space-3, 12px);padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);outline:2px solid transparent;outline-offset:2px;border-right-width:var(--dyte-border-width-md, 2px);border-style:solid;border-color:transparent;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255))}p{margin:var(--dyte-space-0, 0px);margin-top:var(--dyte-space-2, 8px);width:100%;text-align:center;font-size:14px;--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity));display:flex;flex-direction:row;align-items:center;justify-content:center}p dyte-icon{margin-left:var(--dyte-space-1, 4px);height:var(--dyte-space-5, 20px)}";var Ii=Object.freeze({__proto__:null,dyte_broadcast_message_modal:Ai}),Oi=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.videoUp
2dateListener=function(e){var t=e.videoEnabled;n.videoEnabled=t},this.selfJoinStateListener=function(){n.updateCanProduce(n.meeting)},this.selfStateLeftListener=function(){n.canProduceVideo=!1},this.mediaPermissionUpdateListener=function(e){var t=e.kind,r=e.message;"video"===t&&(n.cameraPermission=r)},this.toggleCamera=function(){var e,t,r,i,a,o,s,c,u,l,d,p;if(null===(e=n.meeting)||void 0===e||e.__internals__.logger.info("dyteCameraToggle::toggleCamera",{media:{video:{enabled:Boolean(null===(r=null===(t=n.meeting)||void 0===t?void 0:t.self)||void 0===r?void 0:r.videoEnabled),permission:n.cameraPermission,canProduce:null===(o=null===(a=null===(i=n.meeting)||void 0===i?void 0:i.self)||void 0===a?void 0:a.permissions)||void 0===o?void 0:o.canProduceVideo}},webinar:{stageStatus:null===(c=null===(s=n.meeting)||void 0===s?void 0:s.self)||void 0===c?void 0:c.webinarStageStatus},livestream:{stageStatus:null===(l=null===(u=n.meeting)||void 0===u?void 0:u.stage)||void 0===l?void 0:l.status},moduleExists:{self:Boolean(null===(d=n.meeting)||void 0===d?void 0:d.self)}}),n.hasPermissionError()){var h={enabled:!0,kind:"video"};return n.stateUpdate.emit({activePermissionsMessage:h}),br.activePermissionsMessage=h,!1}var f=null===(p=n.meeting)||void 0===p?void 0:p.self;null!=f&&n.canProduceVideo&&(f.videoEnabled?f.disableVideo():f.enableVideo())},this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.videoEnabled=!1,this.canProduceVideo=!1,this.cameraPermission="NOT_REQUESTED"}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e,t,n,r,i,a,o,s,c;null===(e=this.meeting)||void 0===e||e.self.removeListener("videoUpdate",this.videoUpdateListener),null===(t=this.meeting)||void 0===t||t.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null===(n=this.meeting)||void 0===n||n.self.removeListener("joinStageRequestAccepted",this.selfJoinStateListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("joinStageRequestRejected",this.selfJoinStateListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("stageJoined",this.selfJoinStateListener),null===(a=this.meeting)||void 0===a||a.self.removeListener("stageLeft",this.selfStateLeftListener),null===(o=this.meeting)||void 0===o||o.self.removeListener("removedFromStage",this.selfJoinStateListener),null===(c=null===(s=this.meeting)||void 0===s?void 0:s.stage)||void 0===c||c.removeListener("stageStatusUpdate",this.selfJoinStateListener)}},{key:"meetingChanged",value:function(e){if(null!=e){var t=e.self,n=e.stage;this.updateCanProduce(e),this.cameraPermission=t.mediaPermissions.video||"NOT_REQUESTED",this.videoEnabled=t.videoEnabled,t.addListener("videoUpdate",this.videoUpdateListener),t.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),t.addListener("joinStageRequestAccepted",this.selfJoinStateListener),t.addListener("joinStageRequestRejected",this.selfJoinStateListener),t.addListener("stageJoined",this.selfJoinStateListener),t.addListener("stageLeft",this.selfStateLeftListener),t.addListener("removedFromStage",this.selfJoinStateListener),null===n||void 0===n||n.addListener("stageStatusUpdate",this.selfJoinStateListener)}}},{key:"updateCanProduce",value:function(e){var t=e.self,n=e.meta,r=e.stage,i="ALLOWED"===t.permissions.canProduceVideo,a="WEBINAR"===n.viewType,o="LIVESTREAM"===n.viewType;if(this.canProduceVideo=!1,i&&!o)this.canProduceVideo=!0;else if(a||o){i&&"OFF_STAGE"!==r.status&&"REQUESTED_TO_JOIN_STAGE"!==r.status&&(this.canProduceVideo=!0),"CAN_REQUEST"===t.permissions.canProduceVideo&&(a&&("ON_STAGE"===t.webinarStageStatus||"ACCEPTED_TO_JOIN_STAGE"===t.webinarStageStatus)||o&&("ON_STAGE"===r.status||"ACCEPTED_TO_JOIN_STAGE"===r.status))&&(this.canProduceVideo=!0)}}},{key:"hasPermissionError",value:function(){return"DENIED"===this.cameraPermission||"SYSTEM_DENIED"===this.cameraPermission}},{key:"getState",value:function(){var e="",t="",n={},r=this.hasPermissionError(),i="COULD_NOT_START"===this.cameraPermission;return this.videoEnabled&&!r?(e=this.t("video_on"),t=this.iconPack.video_on):(e=this.t("video_off"),t=this.iconPack.video_off,n["red-icon"]=!0),{tooltipLabel:i?this.t("Unable to capture video"):"SYSTEM_DENIED"===this.cameraPermission?this.t("perm_sys_denied"):"DENIED"===this.cameraPermission?this.t("perm_browser_denied"):this.videoEnabled?this.t("Disable Camera"):this.t("Enable Camera"),label:e,icon:t,classList:n,showWarning:r||i,disable:r}}},{key:"render",value:function(){if(!this.canProduceVideo)return null;var e=this.getState(),t=e.tooltipLabel,n=e.label,r=e.icon,i=e.classList,a=e.showWarning,o=e.disable;return T(C,{title:n},T("dyte-tooltip",{kind:"block",label:t,part:"tooltip",iconPack:this.iconPack,t:this.t},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,class:i,variant:this.variant,label:n,icon:r,onClick:this.toggleCamera,showWarning:a,disabled:o})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Oi.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Li=Object.freeze({__proto__:null,dyte_camera_toggle:Oi}),Di=function(e){var t=null;try{var n=JSON.parse(e.message),r=n.target,i=n.message;t=void 0===r||void 0===i?e:Object.assign(Object.assign({},e),{targetUserIds:r,message:i})}catch(a){t=e}return t};function Ni(e){return e.sort((function(e,t){return e.localeCompare(t)})).join("_")}function ji(e,t){if(null!=e){var n,r=(0,o.Z)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("file"===i.kind){var a=i.getAsFile();i.type.startsWith("image/")?t("image",a):t("file",a)}}}catch(s){r.e(s)}finally{r.f()}}}var Bi=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.disconnectMeeting=function(e){var t;n.isPrivateChatSupported()&&(null===e||void 0===e||e.participants.joined.removeListener("participantsUpdate",n.onParticipantUpdate),null===e||void 0===e||e.participants.joined.removeListener("participantLeft",n.onParticipantUpdate)),null===(t=null===e||void 0===e?void 0:e.chat)||void 0===t||t.removeListener("chatUpdate",n.chatUpdateListener)},this.onParticipantUpdate=function(){n.participants=n.meeting.participants.joined.toArray().filter((function(e){return 0===n.privatePresetFilter.length||n.privatePresetFilter.includes(e.presetName)})),n.selectedParticipant&&!n.participants.includes(n.selectedParticipant)&&(n.selectedParticipant=null,n.chatRecipientId=n.selectedGroup="everyone")},this.usePaginatedChat=function(){return Ri(n.meeting)},this.updateUnreadCountGroups=function(e){n.unreadCountGroups=Object.assign(Object.assign({},n.unreadCountGroups),e)},this.isPrivateChatSupported=function(){var e,t,r;return n.canPrivateMessage&&!n.disablePrivateChat&&"socket-service"===(null===(r=null===(t=null===(e=n.meeting)||void 0===e?void 0:e.__internals__)||void 0===t?void 0:t.features)||void 0===r?void 0:r.getFeatureValue("chat_socket_server"))},this.updateRecipients=function(e){if("string"===typeof e.detail)n.chatRecipientId="everyone",n.selectedParticipant=null;else{var t=e.detail.userId;n.chatRecipientId=t,n.selectedParticipant=n.participants.find((function(e){return e.userId===t}))}if("everyone"!==n.chatRecipientId){var r=Ni([n.chatRecipientId,n.meeting.self.userId]);n.selectedGroup=r}else n.selectedGroup="everyone";n.updateUnreadCountGroups((0,a.Z)({},n.selectedGroup,0))},this.isTextMessagingAllowed=function(){return"everyone"===n.chatRecipientId?n.canSend&&n.canSendTextMessage:n.canPrivateMessage&&n.canSendPrivateTexts},this.isFileMessagingAllowed=function(){return"everyone"===n.chatRecipientId?n.canSend&&n.canSendFiles:n.canPrivateMessage&&n.canSendPrivateFiles},this.meeting=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.t=ir(),this.disablePrivateChat=!1,this.privatePresetFilter=[],this.unreadCountGroups={},this.chatGroups={everyone:[]},this.selectedGroup="everyone",this.now=new Date,this.dropzoneActivated=!1,this.showLatestMessageButton=!1,this.canSend=!1,this.canSendTextMessage=!1,this.canSendFiles=!1,this.canPrivateMessage=!1,this.canSendPrivateTexts=!1,this.canSendPrivateFiles=!1,this.emojiPickerEnabled=!1,this.chatRecipientId="everyone",this.participants=[],this.selectedParticipant=void 0}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e=this;this.meetingChanged(this.meeting),this.meeting&&!this.meeting.chat||this.isFileMessagingAllowed()&&(this.host.addEventListener("dragover",(function(t){t.preventDefault(),e.dropzoneActivated=!0})),this.host.addEventListener("dragleave",(function(){e.dropzoneActivated=!1})),this.host.addEventListener("drop",(function(t){t.preventDefault(),e.dropzoneActivated=!1,ji(t.dataTransfer.items,(function(t,n){var r,i,a,o;switch(t){case"image":e.isFileMessagingAllowed()&&(null===(i=null===(r=e.meeting)||void 0===r?void 0:r.chat)||void 0===i||i.sendImageMessage(n,e.getRecipientPeerIds()));break;case"file":e.isFileMessagingAllowed()&&(null===(o=null===(a=e.meeting)||void 0===a?void 0:a.chat)||void 0===o||o.sendFileMessage(n,e.getRecipientPeerIds()))}}))})))}},{key:"disconnectedCallback",value:function(){this.disconnectMeeting(this.meeting)}},{key:"meetingChanged",value:function(e,t){var n,r,i,a,o,s=this;void 0!=t&&this.disconnectMeeting(t),e&&!e.chat||null!=e&&(this.canSend=e.self.permissions.chatPublic.canSend,this.canSendTextMessage=e.self.permissions.chatPublic.text,this.canSendFiles=e.self.permissions.chatPublic.files,this.canPrivateMessage=(null===(n=e.self.permissions.chatPrivate)||void 0===n?void 0:n.canSend)||(null===(r=e.self.permissions.chatPrivate)||void 0===r?void 0:r.canReceive),this.canSendPrivateTexts=null===(i=e.self.permissions.chatPrivate)||void 0===i?void 0:i.text,this.canSendPrivateFiles=null===(a=e.self.permissions.chatPrivate)||void 0===a?void 0:a.files,this.initializeChatGroups(),this.chatGroups=Object.assign({},this.chatGroups),this.chatUpdateListener=function(e){var t=e.message;s.addToChatGroup(t),s.chatGroups=Object.assign({},s.chatGroups)},this.onParticipantUpdate(),this.usePaginatedChat()||null===(o=e.chat)||void 0===o||o.addListener("chatUpdate",this.chatUpdateListener),this.isPrivateChatSupported()&&(e.participants.joined.addListener("participantJoined",this.onParticipantUpdate),e.participants.joined.addListener("participantLeft",this.onParticipantUpdate)))}},{key:"chatGroupsChanged",value:function(e){var t,n,r=this;if(this.isPrivateChatSupported()){var i={},a=function(){var a=null!==(t=hr[o])&&void 0!==t?t:0;i[o]=e[o].filter((function(e){return"chat"==e.type&&e.message.time>a&&e.message.userId!==r.meeting.self.userId})).length,(o===Ni([r.meeting.self.userId,null===(n=r.selectedParticipant)||void 0===n?void 0:n.userId])||"everyone"===o&&null===r.selectedParticipant)&&(i[o]=0,hr[o]=new Date)};for(var o in e)a();this.updateUnreadCountGroups(i)}}},{key:"initializeChatGroups",value:function(){var e,t=this;null===(e=this.meeting.chat)||void 0===e||e.messages.forEach((function(e){t.addToChatGroup(e)}))}},{key:"addToChatGroup",value:function(e){var t,n=Di(e),r="everyone";if((null===(t=n.targetUserIds)||void 0===t?void 0:t.length)>0){var i=new Set([n.userId].concat((0,m.Z)(n.targetUserIds)));r=Ni(Array.from(i))}void 0===this.chatGroups[r]&&(this.chatGroups[r]=[]),this.chatGroups[r]=[].concat((0,m.Z)(this.chatGroups[r]),[{type:"chat",message:n}])}},{key:"getRecipientPeerIds",value:function(){var e=[];return"everyone"!==this.chatRecipientId&&(e=[this.selectedParticipant.id]),e}},{key:"render",value:function(){var e,t,n,r,i=this,a={iconPack:this.iconPack,t:this.t,size:this.size},o=null===(e=this.meeting)||void 0===e?void 0:e.self.userId,s=this.chatGroups[this.selectedGroup]||[];return T(C,null,this.isFileMessagingAllowed()&&T("div",{id:"dropzone",class:{active:this.dropzoneActivated},part:"dropzone"},T("dyte-icon",{icon:this.iconPack.attach,iconPack:this.iconPack,t:this.t}),T("p",null,this.t("Drop files/images to send"))),this.isPrivateChatSupported()&&T("dyte-chat-selector-ui",Object.assign({selfUserId:o,groups:this.participants,selectedGroupId:null===(t=this.selectedParticipant)||void 0===t?void 0:t.userId,unreadCounts:this.unreadCountGroups,onDyteChatGroupChanged:this.updateRecipients},a)),this.usePaginatedChat()?T("dyte-chat-messages-ui-paginated",{meeting:this.meeting,size:this.size,iconPack:this.iconPack,t:this.t}):T("dyte-chat-messages-ui",Object.assign({messages:s,selfUserId:o,selectedGroup:this.selectedGroup},a)),T("dyte-chat-composer-ui",Object.assign({canSendTextMessage:this.isTextMessagingAllowed(),c
2anSendFiles:this.isFileMessagingAllowed(),disableEmojiPicker:!!(null===(r=null===(n=this.meeting)||void 0===n?void 0:n.__internals__)||void 0===r?void 0:r.features.hasFeature(Pi)),onDyteNewMessage:function(e){var t,n,r,a,o,s,c=e.detail;switch(c.type){case"text":null===(n=null===(t=i.meeting)||void 0===t?void 0:t.chat)||void 0===n||n.sendTextMessage(c.message,i.getRecipientPeerIds());break;case"image":null===(a=null===(r=i.meeting)||void 0===r?void 0:r.chat)||void 0===a||a.sendImageMessage(c.file,i.getRecipientPeerIds());break;case"file":null===(s=null===(o=i.meeting)||void 0===o?void 0:o.chat)||void 0===s||s.sendFileMessage(c.file,i.getRecipientPeerIds())}}},a),T("slot",{name:"chat-addon",slot:"chat-addon"})))}},{key:"host",get:function(){return A(this)}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],chatGroups:["chatGroupsChanged"]}}}]),e}();Bi.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}h3{margin:var(--dyte-space-0, 0px);display:flex;height:var(--dyte-space-12, 48px);align-items:center;justify-content:center;font-size:16px;font-weight:400;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));text-align:center}#dropzone{position:absolute;top:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);z-index:10;display:none;flex-direction:column;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}#dropzone.active{display:flex;-webkit-animation:0.2s slide-up ease-in;animation:0.2s slide-up ease-in}dyte-chat-messages-ui{flex:1 0 0}";var Ui=Object.freeze({__proto__:null,dyte_chat:Bi}),Vi=function(e){if(e&&!e.chat)return!1;var t=null===e||void 0===e?void 0:e.self.config;if(t&&!t.controlBar.elements.chat)return!1;var n=e.self.permissions,r=n.chatPublic,i=n.chatPrivate;return r.canSend||r.text||r.files||i.canSend||i.canReceive||i.files||i.text},Fi=function(e){if(e&&!e.polls)return!1;var t=null===e||void 0===e?void 0:e.self.config;if(t&&!t.controlBar.elements.polls)return!1;var n=e.self.permissions.polls;return n.canCreate||n.canView||n.canVote},zi=function(e){var t,n;if(Gr(e)&&!(null===(t=e.self.permissions)||void 0===t?void 0:t.acceptPresentRequests))return!1;if(e&&!e.participants)return!1;if("LIVESTREAM"===e.meta.viewType)return e.self.permissions.acceptPresentRequests||"ON_STAGE"===(null===(n=null===e||void 0===e?void 0:e.stage)||void 0===n?void 0:n.status);var r=null===e||void 0===e?void 0:e.self.config;return!(r&&!r.controlBar.elements.participants)},Hi=function(e){if(qr(e))return!1;if(e&&!e.plugins)return!1;if("LIVESTREAM"===e.meta.viewType)return"ON_STAGE"===e.stage.status;var t=null===e||void 0===e?void 0:e.self.config;if(t&&!t.controlBar.elements.plugins)return!1;var n=e.self.permissions.plugins;return n.canClose||n.canStart},qi=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.onChatUpdate=function(e){var t,r=e.action,i=e.message;n.chatActive||"add"===r&&i.userId!==(null===(t=n.meeting)||void 0===t?void 0:t.self.userId)&&(n.hasNewMessages=!0,n.unreadMessageCount+=1)},this.toggleChat=function(){var e=n.states||br;n.chatActive=!((null===e||void 0===e?void 0:e.activeSidebar)&&"chat"===(null===e||void 0===e?void 0:e.sidebar)),n.chatActive&&(n.unreadMessageCount=0,n.hasNewMessages=!1),br.activeSidebar=n.chatActive,br.activeMoreMenu=!1,br.sidebar=n.chatActive?"chat":"none",n.stateUpdate.emit({activeSidebar:n.chatActive,sidebar:n.chatActive?"chat":"none",activeMoreMenu:!1})},this.updateCanView=function(){n.canViewChat=Vi(n.meeting)},this.unreadMessageCount=0,this.variant="button",this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.chatActive=!1,this.canViewChat=!1,this.hasNewMessages=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e=this;this.meetingChanged(this.meeting),this.statesChanged(this.states),kr("sidebar",(function(){return e.statesChanged()}))}},{key:"disconnectedCallback",value:function(){var e,t,n,r;null===(t=null===(e=this.meeting)||void 0===e?void 0:e.chat)||void 0===t||t.removeListener("chatUpdate",this.onChatUpdate),null===(r=null===(n=this.meeting)||void 0===n?void 0:n.stage)||void 0===r||r.removeListener("stageStatusUpdate",this.updateCanView)}},{key:"meetingChanged",value:function(e){var t,n,r,i,a=this;null!=e&&(Ri(e)&&(null===(t=e.chat)||void 0===t||t.getMessages((new Date).getTime(),1,!0).then((function(e){var t;(null===(t=null===e||void 0===e?void 0:e.messages)||void 0===t?void 0:t.length)&&(a.hasNewMessages=!0)}))),this.unreadMessageCount=(null===(n=e.chat)||void 0===n?void 0:n.messages.length)||0,null===(r=e.chat)||void 0===r||r.addListener("chatUpdate",this.onChatUpdate),this.canViewChat=Vi(e),null===(i=null===e||void 0===e?void 0:e.stage)||void 0===i||i.on("stageStatusUpdate",this.updateCanView))}},{key:"statesChanged",value:function(e){var t=e||br;null!=t&&(this.chatActive=!0===t.activeSidebar&&"chat"===t.sidebar)}},{key:"render",value:function(){if(this.canViewChat)return T(C,{title:this.t("chat")},Ri(this.meeting)?this.hasNewMessages&&T("div",{class:"unread-count-dot",part:"unread-count-dot"}):0!==this.unreadMessageCount&&!this.chatActive&&T("div",{class:"unread-count",part:"unread-count"},T("span",null,this.unreadMessageCount<=100?this.unreadMessageCount:"99+")),T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,class:{active:this.chatActive},onClick:this.toggleChat,icon:this.iconPack.chat,label:this.t("chat"),variant:this.variant}))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],states:["statesChanged"]}}}]),e}();qi.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:block}.unread-count{position:absolute;right:var(--dyte-space-3, 12px);box-sizing:border-box;padding:var(--dyte-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;display:flex;height:var(--dyte-space-5, 20px);min-width:var(--dyte-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}.unread-count-dot{position:absolute;right:var(--dyte-space-3, 12px);z-index:10;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));border-radius:50%;display:flex;height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px);align-items:center;justify-content:center}:host([variant='horizontal']){display:flex;flex-direction:row-reverse;align-items:center}:host([variant='horizontal']) .unread-count{right:var(--dyte-space-4, 16px);top:auto}";var Gi=Object.freeze({__proto__:null,dyte_chat_toggle:qi}),Wi=function(e){return Math.trunc(e).toString().padStart(2,"0")},Ji=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.disconnectMeeting=function(){var e,t;n.timeout&&clearTimeout(n.timeout),"number"===typeof n.request&&cancelAnimationFrame(n.request),null===(t=null===(e=n.meeting)||void 0===e?void 0:e.meta)||void 0===t||t.removeListener("meetingStartTimeUpdate",n.startedTimeUpdateListener)},this.startedTimeUpdateListener=function(){var e,t,r;n.startedTime=null===(r=null===(t=null===(e=n.meeting)||void 0===e?void 0:e.meta)||void 0===t?void 0:t.meetingStartedTimestamp)||void 0===r?void 0:r.toISOString()},this.meeting=void 0,this.iconPack=ar,this.t=ir(),this.startedTime=void 0,this.timeDiff=void 0}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){this.disconnectMeeting()}},{key:"meetingChanged",value:function(e){var t,n,r;this.disconnectMeeting(),null!=e&&(this.startedTime=null===(n=null===(t=e.meta)||void 0===t?void 0:t.meetingStartedTimestamp)||void 0===n?void 0:n.toISOString(),null===(r=e.meta)||void 0===r||r.addListener("meetingStartTimeUpdate",this.startedTimeUpdateListener))}},{key:"startedTimeChanged",value:function(e){var t=this;if(void 0!==e){this.request=requestAnimationFrame((function e(){t.timeDiff=(Date.now()-new Date(t.startedTime).getTime())/1e3,t.timeout=setTimeout((function(){null!=t.request&&(t.request=requestAnimationFrame(e))}),500)}))}}},{key:"getFormattedTime",value:function(){if(null==this.timeDiff)return null;var e=this.timeDiff,t="";return e>=3600&&(t="".concat(Wi(e/3600),":")),t+="".concat(Wi(e%3600/60),":").concat(Wi(e%60))}},{key:"render",value:function(){return T(C,{tabIndex:0,role:"timer","aria-live":"off"},void 0!==this.startedTime&&[T("dyte-icon",{icon:this.iconPack.clock,"aria-hidden":!0,tabIndex:-1,part:"icon",iconPack:this.iconPack,t:this.t}),T("span",{part:"text"},this.getFormattedTime())])}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],startedTime:["startedTimeChanged"]}}}]),e}();Ji.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:inline-flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:14px;color:rgb(var(--dyte-colors-text-1000, 255 255 255));font-variant-numeric:tabular-nums}:host([size='sm']){margin-left:var(--dyte-space-1, 4px);margin-right:var(--dyte-space-1, 4px);font-size:12px}dyte-icon{margin-right:var(--dyte-space-1, 4px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}:host([size='sm']) dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}";var $i=Object.freeze({__proto__:null,dyte_clock:Ji}),Ki=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.keyPressListener=function(e){"Escape"===e.key&&n.close()},this.close=function(){n.stateUpdate.emit({activeConfirmationModal:{active:!1}}),br.activeConfirmationModal={active:!1},n.states.activeConfirmationModal.onClose(n.stateUpdate,br,n.meeting)},this.onConfirmation=(0,f.Z)((0,h.Z)().mark((function e(){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.stateUpdate.emit({activeConfirmationModal:{active:!1}}),br.activeConfirmationModal={active:!1},n.states.activeConfirmationModal.onClick(n.stateUpdate,br,n.meeting);case 3:case"end":return e.stop()}}),e)}))),this.meeting=void 0,this.states=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){document.addEventListener("keydown",this.keyPressListener)}},{key:"componentDidLoad",value:function(){}},{key:"disconnectedCallback",value:function(){document.removeEventListener("keydown",this.keyPressListener)}},{key:"render",value:function(){var e,t,n=this,r=this.states.activeConfirmationModal;return T(C,null,T("div",{class:"leave-modal"},T("div",{class:"header"},T("h2",{class:"title"},r.header?this.t(r.header):this.t("confirmation_modal.header"))),T("p",{class:"message"},r.content?this.t(r.content):""),T("div",{class:"content"},T("div",{class:"leave-meeting"},T("dyte-button",{variant:"secondary",title:r.cancelText?this.t(r.cancelText):this.t("cancel"),onClick:this.close,iconPack:this.iconPack,t:this.t,class:"br-secondary-btn"},r.cancelText?this.t(r.cancelText):this.t("cancel")),T("dyte-button",{onClick:function(){return n.onConfirmation()},variant:null!==(t=null===(e=this.states.activeConfirmationModal)||void 0===e?void 0:e.variant)&&void 0!==t?t:"danger",title:r.ctaText?this.t(r.ctaText):this.t("yes"),iconPack:this.iconPack,t:this.t},r.ctaText?this.t(r.ctaText):this.t("yes"))))))}}]),e}();Ki.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--dyte-border-radius-md, 8px);padding:var(--dyte-space-8, 32px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));width:400px;max-width:80%}.leave-modal{width:100%;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.leave-modal .header h2{margin:var(--dyte-space-0, 0px)}.leave-modal .content{font-size:14px}.leave-message p{margin-top:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-3, 12px)}.leave-meeting{display:flex;flex-direction:row;justify-content:space-between;gap:var(--dyte-space-4, 16px)}.leave-meeting dyte-button{color:rgb(var(--dyte-colors-text-1000, 255 255 255));flex:1 1 0%}.end-meeting{margin-top:var(--dyte-space-2, 8px)}.br-secondary-btn{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.br-secondary-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}";var Qi=Object.freeze({__proto__:null,dyte_confirmation_modal:Ki}),Yi=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.variant="solid",this.disableRender=!1,this.meeting=void 0,this.config=Ue,this.states=void 0,this.iconPack=ar,this.t=ir(),this.size=void 0}return(0,c.Z)(e,[{key:"render",value:function(){var e={meeting:this.meeting,config:this.config,states:this.states,t:this.t,iconPack:this.iconPack,size:this.size};return T(C,null,!this.disableRender&&T(sr,{element:"dyte-header",defaults:e,onlyChildren:!0}),T("slot",null))}}]),e}();Yi.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);box-sizing:border-box;display:flex;height:var(--dyte-space-16, 64px);align-items:center;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px);z-index:10}";var Xi=Object.freeze({__proto__:null,dyte_controlbar:Yi}),ea=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.onDyteDialogClose=function(e,t){br[e]=t,n.stateUpdate.emit((0,a.Z)({},e,t))},this.leaveStage=(0,f.Z)((0,h.Z)().mark((function e(){var t,r,i;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("LIVESTREAM"!==n.meeting.meta.viewT
2ype||"ACCEPTED_TO_JOIN_STAGE"!==(null===(t=n.meeting.stage)||void 0===t?void 0:t.status)){e.next=3;break}return e.next=3,null===(i=null===(r=n.meeting)||void 0===r?void 0:r.stage)||void 0===i?void 0:i.leave();case 3:if("WEBINAR"!==n.meeting.meta.viewType){e.next=6;break}return e.next=6,n.meeting.self.leaveStage();case 6:n.onDyteDialogClose("activeJoinStage",!1);case 7:case"end":return e.stop()}}),e)}))),this.joinStage=(0,f.Z)((0,h.Z)().mark((function e(){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("LIVESTREAM"!==n.meeting.meta.viewType){e.next=3;break}return e.next=3,n.meeting.stage.join();case 3:if("WEBINAR"!==n.meeting.meta.viewType){e.next=6;break}return e.next=6,n.meeting.self.joinStage();case 6:n.onDyteDialogClose("activeJoinStage",!1);case 7:case"end":return e.stop()}}),e)}))),this.meeting=void 0,this.config=Ue,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){var e,t,n,r,i=this,a={meeting:this.meeting,states:this.states||br,config:this.config,size:this.size,iconPack:this.iconPack,t:this.t},o=this.states||br;if(null!=(null===o||void 0===o?void 0:o.image)){var s=o.image,c=function(){i.stateUpdate.emit({image:null}),br.image=null};return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:c,hideCloseButton:!0,iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-image-viewer",defaults:a,props:{image:s,onClose:c}})))}if(!0===(null===o||void 0===o?void 0:o.activeSettings))return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){return i.onDyteDialogClose("activeSettings",!1)},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-settings",defaults:a})));if(!0===(null===o||void 0===o?void 0:o.activeLeaveConfirmation))return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){return i.onDyteDialogClose("activeLeaveConfirmation",!1)},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-leave-meeting",defaults:a})));if(!0===(null===(e=null===o||void 0===o?void 0:o.activePermissionsMessage)||void 0===e?void 0:e.enabled))return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){return i.onDyteDialogClose("activePermissionsMessage",{enabled:!1})},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-permissions-message",defaults:a})));if(!0===(null===o||void 0===o?void 0:o.activeRemoteAccessManager))return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){return i.onDyteDialogClose("activeRemoteAccessManager",!1)},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-remote-access-manager",defaults:a})));if(!0===(null===(t=null===o||void 0===o?void 0:o.activeBreakoutRoomsManager)||void 0===t?void 0:t.active))return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){return i.onDyteDialogClose("activeBreakoutRoomsManager",{active:!1,data:void 0})},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-breakout-rooms-manager",defaults:a,props:{mode:this.meeting.connectedMeetings.isActive?"view":"create"}})));if(!0===(null===(n=null===o||void 0===o?void 0:o.activeConfirmationModal)||void 0===n?void 0:n.active))return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){return i.onDyteDialogClose("activeConfirmationModal",!1)},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-confirmation-modal",defaults:a})));if(!0===(null===(r=null===o||void 0===o?void 0:o.activeOverlayModal)||void 0===r?void 0:r.active))return T(C,null,T("dyte-overlay-modal",{meeting:this.meeting,states:this.states,iconPack:this.iconPack,t:this.t}));if(null===o||void 0===o?void 0:o.activeBroadcastMessageModal)return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){return i.onDyteDialogClose("activeBroadcastMessageModal",!1)},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-broadcast-message-modal",defaults:a})));if(!0===(null===o||void 0===o?void 0:o.activeJoinStage)){var u={title:this.t("stage.join_title"),label:{accept:this.t("stage.join_confirm"),reject:this.t("stage.join_cancel")},description:this.t("stage.join_summary")}
2;return T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:this.leaveStage,iconPack:this.iconPack,t:this.t},T("dyte-join-stage",Object.assign({dataConfig:u,onDyteJoinStage:this.joinStage,onDyteLeaveStage:this.leaveStage},a))))}return!0===(null===o||void 0===o?void 0:o.activeMuteAllConfirmation)?T(C,null,T("dyte-dialog",{open:!0,onDyteDialogClose:function(){i.onDyteDialogClose("activeMuteAllConfirmation",!1)},iconPack:this.iconPack,t:this.t},T(sr,{element:"dyte-mute-all-confirmation",defaults:a}))):null}}]),e}();ea.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var ta=Object.freeze({__proto__:null,dyte_dialog_manager:ea}),na=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.config=Ue,this.size=void 0,this.icon=ar,this.states=void 0,this.t=ir(),this.iconPack=ar,this.message="",this.meeting=void 0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e=this;this.statesChanged(this.states),kr("roomLeftState",(function(){return e.statesChanged()}))}},{key:"getBreakoutRoomsMessage",value:function(e){var t,n;return"connected-meeting"===(null===e||void 0===e?void 0:e.roomLeftState)&&(n=(null===(t=br.activeBreakoutRoomsManager)||void 0===t?void 0:t.destinationMeetingId)===this.meeting.connectedMeetings.parentMeeting.id?"breakout_rooms.move_reason.switch_main_room":"breakout_rooms.move_reason.switch_room"),n}},{key:"statesChanged",value:function(e){var t=e||br;if(null!=t)switch(null===t||void 0===t?void 0:t.roomLeftState){case"left":this.message="You left the meeting";break;case"kicked":this.message="You were removed from the meeting";break;case"disconnected":this.message="The call ended because the connection was lost.";break;case"rejected":this.message="Your request to join the meeting was denied.";break;case"connected-meeting":this.message=this.getBreakoutRoomsMessage(t);break;default:this.message="The meeting ended"}}},{key:"renderBreakoutRoomScreen",value:function(){return T(C,null,T("div",{class:"ctr",part:"container"},T("dyte-icon",{icon:this.iconPack.breakout_rooms}),T("p",{part:"message",class:"breakout"},this.t(this.message))))}},{key:"render",value:function(){var e=this.states||br;return"connected-meeting"===e.roomLeftState?this.renderBreakoutRoomScreen():T(C,null,T("div",{class:"ctr",part:"container"},T("dyte-logo",{meeting:this.meeting,config:this.config,part:"logo",t:this.t}),T("p",{part:"message"},this.t(this.message)),"disconnected"===(null===e||void 0===e?void 0:e.roomLeftState)&&T("span",{part:"description"},this.t("Please check your internet connection and try again."))))}}],[{key:"watchers",get:function(){return{states:["statesChanged"]}}}]),e}();na.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);height:100%;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;display:flex;flex-direction:column;align-items:center;justify-content:center}.ctr{display:flex;flex-direction:column;align-items:center}dyte-logo{margin-bottom:var(--dyte-space-8, 32px);height:var(--dyte-space-12, 48px)}.rejoin-button{margin-top:var(--dyte-space-4, 16px);margin-bottom:var(--dyte-space-4, 16px);padding-top:var(--dyte-space-6, 24px);padding-bottom:var(--dyte-space-6, 24px);padding-left:var(--dyte-space-16, 64px);padding-right:var(--dyte-space-16, 64px)}.rejoin-icon{margin-right:var(--dyte-space-2, 8px)}p{font-size:16px;border-radius:var(--dyte-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding-left:var(--dyte-space-8, 32px);padding-right:var(--dyte-space-8, 32px);padding-top:var(--dyte-space-4, 16px);padding-bottom:var(--dyte-space-4, 16px);color:rgb(var(--dyte-colors-text-1000, 255 255 255))}p.breakout{font-size:20px;display:flex;flex-direction:column;align-items:center}p.breakout span{margin-top:var(--dyte-space-1, 4px);margin-bottom:var(--dyte-space-0, 0px);color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}span{margin-top:var(--dyte-space-4, 16px);margin-bottom:var(--dyte-space-4, 16px);font-size:14px}";var ra=Object.freeze({__proto__:null,dyte_ended_screen:na}),ia=function(e){null!=e&&(null!=e.requestFullscreen?e.requestFullscreen():null!=e.mozRequestFullScreen?e.mozRequestFullScreen():null!=e.webkitRequestFullscreen?e.webkitRequestFullscreen():null!=e.msRequestFullscreen&&e.msRequestFullscreen())},aa=function(){null!=document.exitFullscreen?document.exitFullscreen():null!=document.mozExitFullScreen?document.mozExitFullScreen():null!=document.webkitExitFullscreen?document.webkitExitFullscreen():null!=document.msExitFullscreen&&document.msExitFullscreen()},oa=function(){return null!=document.fullscreenElement||null!=document.webkitCurrentFullScreenElement},sa=function(){return"undefined"!==typeof document&&(document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled)},ca=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.onFullScreenchange=function(){n.fullScreenActive=oa()},this.toggleFullScreen=function(){var e=document.querySelector("dyte-meeting");e&&(n.fullScreenActive?(aa(),n.fullScreenActive=!1):(ia(e),n.fullScreenActive=!0),n.stateUpdate.emit({activeMoreMenu:!1}),br.activeMoreMenu=!1)},this.states=void 0,this.variant="button",this.size=void 0,this.iconPack=ar,this.t=ir(),this.fullScreenActive=!1,this.isFullScreenSupported=!0}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.isFullScreenSupported=sa(),this.onFullScreenchange(),window.addEventListener("webkitfullscreenchange",this.onFullScreenchange),window.addEventListener("fullscreenchange",this.onFullScreenchange)}},{key:"disconnectedCallback",value:function(){window.removeEventListener("webkitfullscreenchange",this.onFullScreenchange),window.removeEventListener("fullscreenchange",this.onFullScreenchange)}},{key:"render",value:function(){return this.isFullScreenSupported?T(C,{title:this.t("Fullscreen")},T("dyte-controlbar-button",{size:this.size,iconPack:this.iconPack,t:this.t,onClick:this.toggleFullScreen,icon:this.fullScreenActive?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize,label:this.fullScreenActive?this.t("full_screen.exit"):this.t("full_screen"),variant:this.variant})):null}}]),e}();ca.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var ua,la=Object.freeze({__proto__:null,dyte_fullscreen_toggle:ca}),da=720,pa=1280,ha=function(e,t,n,r,i,a){var o,s,c,u,l=i,d=a,p=Math.min(n/l,r/d),h=l*p,f=d*p,v=1;return h<n&&(v=n/h),Math.abs(v-1)<1e-14&&f<r&&(v=r/f),(o=.5*(l-(c=l/((h*=v)/n))))<0&&(o=0),(s=.5*(d-(u=d/((f*=v)/r))))<0&&(s=0),c>l&&(c=l),u>d&&(u=d),[o,s,c,u,e,t,n,r]};!function(e){e.CAMERA="CAMERA",e.MIC="MIC",e.END="END"}(ua||(ua={}));var fa=function(){function e(){(0,s.Z)(this,e),this.tracks=[],this.sources=[],this.enabled=!1}return(0,c.Z)(e,[{key:"isSupported",value:function(){return!!window.chrome&&document.pictureInPictureEnabled}},{key:"cleanup",value:function(){this.isSupported()&&void 0!==document.exitPictureInPicture&&null!==document.pictureInPictureElement&&document.exitPictureInPicture(),this.canvas=void 0,this.video=void 0,this.tracks=[],this.request=void 0}},{key:"createCanvas",value:function(){var e=document.createElement("canvas");e.height=da,e.width=pa,this.canvas=e}},{key:"setupEvents",value:function(e){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("hangup",(function(){e(ua.END)}))}},{key:"mountAudioEvents",value:function(e){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglemicrophone",(function(){e(ua.MIC)}))}},{key:"mountVideoEvents",value:function(e){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglecamera",(function(){e(ua.CAMERA)}))}},{key:"unmountAudioEvents",value:function(){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglemicrophone",void 0)}},{key:"unmountVideoEvents",value:function(){void 0!==navigator.mediaSession&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setActionHandler("togglecamera",void 0)}},{key:"drawGrid",value:function(e,t,n){if(void 0!==this.canvas){var r=this.canvas.getContext("2d");r.fillStyle="#000000",r.fillRect(0,0,pa,da);for(var i=0,a=0;i<715;){for(var o=0;o<1275&&a<n;){var s=this.tracks[a],c=ha(o,i,e,t,s.videoWidth,s.videoHeight),u=(0,v.Z)(c,8),l=u[0],d=u[1],p=u[2],h=u[3],f=u[4],m=u[5],g=u[6],y=u[7];r.drawImage(s,l,d,p,h,f,m,g,y),a+=1,o+=e}i+=t}}}},{key:"paintCanvas",value:function(){var e=this.tracks.length,t=function(e){switch(e){case 0:case 1:return[pa,da];case 2:return[Math.floor(640),da];case 3:case 4:return[Math.floor(640),Math.floor(360)];default:return[Math.floor(426.6666666666667),Math.floor(360)]}}(e),n=(0,v.Z)(t,2),r=n[0],i=n[1];this.drawGrid(r,i,e)}},{key:"animate",value:function(){var e=this;void 0!==this.tracks&&this.paintCanvas(),void 0!==this.request&&(this.request=requestAnimationFrame((function(){return e.animate()})))}},{key:"create",value:function(e,t,n){var r=this;this.cleanup(),this.createCanvas(),this.setupEvents(n);var i=document.createElement("video");i.height=da,i.width=pa,i.autoplay=!0,i.srcObject=this.canvas.captureStream(24),this.video=i,this.video.onloadedmetadata=function(){try{e(),r.video.onleavepictureinpicture=function(){t()}}catch(n){t(n.getMessage())}},this.paintCanvas()}},{key:"updateMediaSession",value:function(e,t){void 0!==navigator.mediaSession&&(e===ua.CAMERA&&void 0!==navigator.mediaSession.setCameraActive&&navigator.mediaSession.setCameraActive(t),e===ua.MIC&&void 0!==navigator.mediaSession.setMicrophoneActive&&navigator.mediaSession.setMicrophoneActive(t))}},{key:"updateVideoSources",value:function(){var e=Object.values(this.sources).filter((function(e){return e.enabled})),t=[];e.map((function(e){t.push(e.element)})),this.tracks=t}},{key:"enableSource",value:function(e){void 0!==this.sources[e]&&(this.sources[e].enabled=!0),this.updateVideoSources()}},{key:"disableSource",value:function(e){void 0!==this.sources[e]&&(this.sources[e].enabled=!1),this.updateVideoSources()}},{key:"addSource",value:function(e,t,n){this.sources[e]={element:t,enabled:n}}},{key:"removeSource",value:function(e){delete this.sources[e]}},{key:"removeAllSource",value:function(){this.sources=[]}},{key:"enable",value:function(){var e=this;this.enabled=!0,this.request=requestAnimationFrame((function(){return e.animate()})),this.video.requestPictureInPicture()}},{key:"disable",value:function(){this.enabled=!1,cancelAnimationFrame(this.request),this.request=void 0,document.exitPictureInPicture()}}]),e}(),va=new fa;function ma(e){var t=e.dimensions,n=e.count,r=e.aspectRatio,i=e.gap,a=function(e){var t=e.count,n=e.dimensions,r=e.aspectRatio,i=e.gap,a=n.width,o=n.height;if(0===a||0===o)return{width:0,height:0,rows:1,cols:1};a-=2*i,o-=2*i;for(var s=i,c=t,u=ga(r),l=0,d=0,p=1,h=1,f=[],v=1;v<=c;v++)f.push((a-s*(v-1))/v),f.push((o-s*(v-1))/(v*u));f.sort((function(e,t){return t-e}));for(var m=0,g=f;m<g.length;m++){if(d=(l=g[m])*u,(p=Math.floor((a+s)/(l+s)))*(h=Math.floor((o+s)/(d+s)))>=c){h=Math.ceil(c/p);break}}return{width:l,height:d,rows:h,cols:p}}({dimensions:t,count:n,aspectRatio:r,gap:i}),o=a.width,s=a.height,c=function(e){var t=e.parentDimensions,n=e.dimensions,r=e.rows,i=e.cols,a=e.count,o=e.gap,s=t.
2width,c=t.height,u=n.width,l=n.height,d=(c-(l*r+(r-1)*o))/2,p=(s-(u*i+(i-1)*o))/2,h=l+o,f=u+o,v=0,m=0,g=a%i;function y(e){var t=a-e;t===g&&(p=(s-(u*t+(t-1)*o))/2);var n=d+m*h,r=p+v*f;return v++,(e+1)%i===0&&(m++,v=0),{top:n,left:r}}return y}({parentDimensions:t,dimensions:{width:o,height:s},rows:a.rows,cols:a.cols,count:n,gap:i});return{width:o,height:s,getPosition:c}}var ga=function(e){var t=e.split(":"),n=(0,v.Z)(t,2),r=n[0],i=n[1];return Number.parseInt(i)/Number.parseInt(r)},ya={spotlight:"sm",mixed:"sm"},ba=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.hideSelf=!1,this.networkUpdateListener=function(e){var t=e.event;n.connected="connected"===t},this.meetingDisconnectedListener=function(){n.networkUpdateListener({event:"disconnected"})},this.meetingConnectedListener=function(){n.networkUpdateListener({event:"connected"})},this.eventCallback=function(e){var t=n.meeting.self;e===ua.CAMERA&&(t.videoEnabled?t.disableVideo():t.enableVideo()),e===ua.MIC&&(t.audioEnabled?t.disableAudio():t.enableAudio()),e===ua.END&&(va.cleanup(),n.stateUpdate.emit({activePipMode:!1}),n.meeting.leaveRoom())},this.enablePipMediaControls=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.meeting,t=e.self.permissions.canProduceAudio,r=e.self.permissions.canProduceVideo;t&&va.mountAudioEvents(n.eventCallback),r&&va.mountVideoEvents(n.eventCallback)},this.disablePipMediaControls=function(){va.unmountAudioEvents(),va.unmountVideoEvents()},this.handlePipMediaControls=function(e){"ON_STAGE"===e?n.enablePipMediaControls():n.disablePipMediaControls()},this.filterParticipants=function(e){var t;if(n.overrides&&(null===(t=n.overrides)||void 0===t?void 0:t.videoUnsubscribed)){var r=n.overrides.videoUnsubscribed.preset;r.length>0&&(e=e.filter((function(e){return!r.some((function(t){return void 0!==e.presetName&&e.presetName.match(t)}))})))}return e},this.onSelfVideoUpdateListener=function(e){var t=e.videoEnabled;va.updateMediaSession(ua.CAMERA,t)},this.onSelfAudioUpdateListener=function(e){var t=e.audioEnabled;va.updateMediaSession(ua.MIC,t)},this.onViewModeChanged=function(){null!=n.meeting&&n.updateActiveParticipants()},this.onParticipantJoined=function(e){null!=n.meeting&&(n.participants.some((function(t){return t.id===e.id}))||(n.participants=n.filterParticipants([e].concat((0,m.Z)(n.participants)))),e.isPinned&&!n.pinnedParticipants.some((function(t){return t.id===e.id}))&&(n.pinnedParticipants=n.pinnedParticipants.concat([e])),n.updateWebinarStage())},this.onParticipantLeft=function(e){n.participants=n.participants.filter((function(t){return t.id!==e.id})),n.participants=n.participants.concat(n.meeting.participants.active.toArray().filter((function(e){return!n.participants.find((function(t){return t.id===e.id}))}))),n.participants=n.filterParticipants(n.participants),n.pinnedParticipants=n.pinnedParticipants.filter((function(t){return t.id!==e.id})),e.screenShareEnabled&&n.removeScreenShare(e),n.updateWebinarStage()},this.selfStageJoinListener=function(){n.updateActiveParticipants()},this.selfStageLeaveListener=function(){n.removeScreenShare(n.meeting.self),n.updateActiveParticipants()},this.onPresentationStart=function(){null!=n.meeting&&n.updateActiveParticipants()},this.onPresentationEnd=function(e){null!=n.meeting&&(n.removePinned(e),n.removeScreenShare(e),n.updateActiveParticipants())},this.onScreenShareUpdate=function(e){e.screenShareEnabled?n.addScreenShare(e):n.removeScreenShare(e)},this.onSelfScreenShareUpdate=function(e){e.screenShareEnabled?n.addScreenShare(n.meeting.self):n.removeScreenShare(n.meeting.self)},this.onPluginStateUpdate=function(e,t){t.active?n.plugins.some((function(t){return t.id===e.id}))||(n.plugins=[].concat((0,m.Z)(n.plugins),[e])):n.plugins=n.plugins.filter((function(t){return t.id!==e.id}))},this.onParticipantPinned=function(){n.updateActiveParticipants()},this.onParticipantUnpinned=function(){n.updateActiveParticipants()},this.participants=[],this.pinnedParticipants=[],this.screenShareParticipants=[],this.plugins=[],this.showWebinarStage=!1,this.showLiveStreamPlayer=!1,this.canCurrentPeerHost=!1,this.connected=!0,this.pipSupported=!1,this.pipEnabled=!1,this.layout="row",this.aspectRatio="16:9",this.meeting=void 0,this.gap=8,this.size=void 0,this.states=void 0,this.config=Ue,this.iconPack=ar,this.t=ir(),this.gridSize=ya,this.overrides={}}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectMeeting",value:function(e){var t,n;if(null!=e){this.participants=[],this.plugins=[];var r=e.self,i=e.participants,a=e.plugins,o=e.meta;i.active.removeListener("participantJoined",this.onParticipantJoined),i.active.removeListener("participantLeft",this.onParticipantLeft),i.joined.removeListener("screenShareUpdate",this.onScreenShareUpdate),i.joined.removeListener("peerStartedPresenting",this.onPresentationStart),i.joined.removeListener("peerStoppedPresenting",this.onPresentationEnd),r.removeListener("screenShareUpdate",this.onSelfScreenShareUpdate),null===a||void 0===a||a.all.removeListener("stateUpdate",this.onPluginStateUpdate),i.pinned.removeListener("participantJoined",this.onParticipantPinned),i.pinned.removeListener("participantLeft",this.onParticipantUnpinned),r.removeListener("pinned",this.onParticipantPinned),r.removeListener("unpinned",this.onParticipantUnpinned),i.removeListener("viewModeChanged",this.onViewModeChanged),r.removeListener("stageJoined",this.selfStageJoinListener),r.removeListener("stageLeft",this.selfStageLeaveListener),r.removeListener("removedFromStage",this.selfStageLeaveListener),r.removeListener("videoUpdate",this.onSelfVideoUpdateListener),r.removeListener("audioUpdate",this.onSelfAudioUpdateListener),o.removeListener("disconnected",this.meetingDisconnectedListener),o.removeListener("connected",this.meetingConnectedListener),null===(t=e.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.handlePipMediaControls),e.self.removeListener("stageJoined",this.enablePipMediaControls),e.self.removeListener("stageLeft",this.disablePipMediaControls),null===(n=e.stage)||void 0===n||n.removeListener("stageStatusUpdate",this.updateLiveStreamStage)}}},{key:"disconnectedCallback",value:function(){this.disconnectMeeting(this.meeting)}},{key:"screenShareParticipantsChanged",value:function(e){var t=e.length>0;this.stateUpdate.emit({activeScreenShare:t}),br.activeScreenShare=t}},{key:"pluginsChanged",value:function(e){var t=e.length>0;this.stateUpdate.emit({activePlugin:t}),br.activePlugin=t}},{key:"pinnedParticipantsChanged",value:function(e){var t=e.length>0;this.stateUpdate.emit({activeSpotlight:t}),br.activeSpotlight=t}},{key:"updateActiveParticipants",value:function(){var e,t,n=this.meeting,r=n.self,i=n.participants,a="WEBINAR"===(null===(e=r.config)||void 0===e?void 0:e.viewType)&&"ON_STAGE"!==r.webinarStageStatus,o=null===(t=r.permissions)||void 0===t?void 0:t.isRecorder;this.hideSelf=a||o||r.permissions.hiddenParticipant,this.participants=this.filterParticipants([].concat((0,m.Z)(i.active.toArray().filter((function(e){return e.id!==r.id}))),(0,m.Z)("ACTIVE_GRID"!==i.viewMode||r.isPinned||this.hideSelf?[]:[r]))),this.pinnedParticipants=[].concat((0,m.Z)(i.pinned.toArray().filter((function(e){return e.id!==r.id}))),(0,m.Z)(r.isPinned&&!this.hideSelf?[r]:[])),this.screenShareParticipants=i.joined.toArray().filter((function(e){return e.screenShareEnabled})),r.screenShareEnabled&&(this.screenShareParticipants=this.screenShareParticipants.concat([r])),this.updateWebinarStage()}},{key:"updateWebinarStage",value:function(){this.meeting&&"WEBINAR"===this.meeting.meta.viewType?this.showWebinarStage=0===this.participants.length&&0===this.pinnedParticipants.length:this.showWebinarStage=!1}},{key:"updateLiveStreamStage",value:function(){this.showLiveStreamPlayer=qr(this.meeting)}},{key:"meetingChanged",value:function(e,t){var n,r,i,a=this;if(null!==t&&this.disconnectMeeting(t),null!=e){var o=e.self,s=e.participants,c=e.plugins,u=e.meta,l=e.stage,d=o.config,p=o.permissions,h="WEBINAR"===(null===d||void 0===d?void 0:d.viewType)&&"ON_STAGE"!==this.meeting.self.webinarStageStatus,f=null===p||void 0===p?void 0:p.isRecorder;if(this.hideSelf=h||f||p.hiddenParticipant,this.participants=this.filterParticipants([].concat((0,m.Z)(s.active.toArray()),(0,m.Z)(o.isPinned||this.hideSelf?[]:[o]))),this.pinnedParticipants=[].concat((0,m.Z)(s.pinned.toArray()),(0,m.Z)(o.isPinned&&!this.hideSelf?[o]:[])),this.screenShareParticipants=s.joined.toArray().filter((function(e){return e.screenShareEnabled})),this.plugins=(null===c||void 0===c?void 0:c.active.toArray())||[],"WEBINAR"===(null===d||void 0===d?void 0:d.viewType)&&(this.canCurrentPeerHost=p.acceptPresentRequests||p.canPresent,this.updateWebinarStage()),this.pipSupported=va.isSupported()&&(null===(n=e.self.config)||void 0===n?void 0:n.pi
2pMode),this.pipSupported){va.create((function(){}),(function(){a.stateUpdate.emit({activePipMode:!1})}),this.eventCallback),this.enablePipMediaControls(e),null===(r=e.stage)||void 0===r||r.on("stageStatusUpdate",this.handlePipMediaControls),e.self.on("stageJoined",this.enablePipMediaControls),e.self.on("stageLeft",this.disablePipMediaControls)}var v=null!==document.pictureInPictureElement,g=this.states||br;va.isSupported()&&g.activePipMode!==v&&this.stateUpdate.emit({activePipMode:v}),s.active.addListener("participantJoined",this.onParticipantJoined),s.active.addListener("participantLeft",this.onParticipantLeft),s.joined.addListener("screenShareUpdate",this.onScreenShareUpdate),s.joined.addListener("peerStartedPresenting",this.onPresentationStart),s.joined.addListener("peerStoppedPresenting",this.onPresentationEnd),o.addListener("screenShareUpdate",this.onSelfScreenShareUpdate),null===c||void 0===c||c.all.addListener("stateUpdate",this.onPluginStateUpdate),s.pinned.addListener("participantJoined",this.onParticipantPinned),s.pinned.addListener("participantLeft",this.onParticipantUnpinned),o.addListener("pinned",this.onParticipantPinned),o.addListener("videoUpdate",this.onSelfVideoUpdateListener),o.addListener("audioUpdate",this.onSelfAudioUpdateListener),o.addListener("unpinned",this.onParticipantUnpinned),o.addListener("stageJoined",this.selfStageJoinListener),o.addListener("stageLeft",this.selfStageLeaveListener),o.addListener("removedFromStage",this.selfStageLeaveListener),u.addListener("disconnected",this.meetingDisconnectedListener),u.addListener("connected",this.meetingConnectedListener),null===l||void 0===l||l.addListener("stageStatusUpdate",this.updateLiveStreamStage.bind(this)),s.addListener("viewModeChanged",this.onViewModeChanged),(null===(i=e.stage)||void 0===i?void 0:i.status)&&this.updateLiveStreamStage()}}},{key:"addScreenShare",value:function(e){this.screenShareParticipants.some((function(t){return t.id===e.id}))||(this.screenShareParticipants=[].concat((0,m.Z)(this.screenShareParticipants),[e]))}},{key:"removeScreenShare",value:function(e){this.screenShareParticipants=this.screenShareParticipants.filter((function(t){return t.id!==e.id}))}},{key:"removePinned",value:function(e){this.pinnedParticipants=this.pinnedParticipants.filter((function(t){return t.id!==e.id}))}},{key:"render",value:function(){var e={meeting:this.meeting,size:this.size,states:this.states||br,config:this.config,iconPack:this.iconPack,t:this.t};return!this.connected&&this.hideSelf?T("div",{class:"webinar-stage"},T("div",{class:"center"},T("h2",null,this.t("stage.reconnecting")))):this.showWebinarStage?T(C,null,T("div",{class:"webinar-stage"},T("div",{class:"center"},this.canCurrentPeerHost&&T("div",null,T("h2",null,this.t("stage.empty_host")),T("p",null,this.t("stage.empty_host_summary"))),!this.canCurrentPeerHost&&T("h2",null,this.t("stage.empty_viewer"))))):this.showLiveStreamPlayer?T(C,null,T("dyte-livestream-player",{meeting:this.meeting,size:this.size})):T(C,null,T(sr,{element:"dyte-grid",defaults:e,childProps:{participants:this.participants,screenShareParticipants:this.screenShareParticipants,plugins:this.plugins,pinnedParticipants:this.pinnedParticipants,aspectRatio:this.aspectRatio,gap:this.gap,layout:this.layout,gridSize:this.gridSize},onlyChildren:!0}))}},{key:"host",get:function(){return A(this)}}],[{key:"watchers",get:function(){return{screenShareParticipants:["screenShareParticipantsChanged"],plugins:["pluginsChanged"],pinnedParticipants:["pinnedParticipantsChanged"],meeting:["meetingChanged"]}}}]),e}();ba.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;height:100%;width:100%;overflow:hidden;flex-wrap:wrap;align-content:center;align-items:center;justify-content:center;color:rgb(var(--dyte-colors-text-1000, 255 255 255));transition:0.4s}dyte-participant-tile{aspect-ratio:initial;box-sizing:border-box}.webinar-stage{box-sizing:border-box;display:flex;align-content:center;align-items:center;justify-content:center;text-align:center}.webinar-stage h2{margin:var(--dyte-space-0, 0px);font-weight:normal}.livestream-stage{box-sizing:border-box;margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:flex;height:100%;flex-grow:1;align-content:center;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-md, 8px);text-align:center;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}";var ka=Object.freeze({__proto__:null,dyte_grid:ba}),_a=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onPageChanged=function(e){var t=e.currentPage,r=e.pageCount;n.pageCount=r,n.page=t},this.toggleGridPagination=function(){var e,t=n.meeting,r=t.self,i=t.participants,a=null===(e=r.config)||void 0===e?void 0:e.maxVideoStreams,o=a.mobile,s=a.desktop,c="sm"===n.size?o:s;i.joined.size<c?n.showPagination=!1:n.showPagination=!0}
2,this.onParticipantJoin=function(){n.pageCount=n.meeting.participants.pageCount,n.toggleGridPagination()},this.onParticipantLeave=function(){n.pageCount=n.meeting.participants.pageCount,n.toggleGridPagination()},this.prevPage=function(){if(null!=n.meeting){var e=n.meeting.participants;n.page>1?e.setPage(n.page-=1):"PAGINATED"===e.viewMode&&e.setViewMode("ACTIVE_GRID")}},this.nextPage=function(){if(null!=n.meeting){var e=n.meeting.participants;n.page>0&&n.page<n.pageCount?e.setPage(n.page+=1):e.count>0&&0===n.pageCount&&e.setViewMode("PAGINATED")}},this.meeting=void 0,this.states=void 0,this.size=void 0,this.variant="rounded",this.iconPack=ar,this.t=ir(),this.page=1,this.pageCount=0,this.activeCount=0,this.activeComputedCount=0,this.showPagination=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting),this.sizeChanged()}},{key:"disconnectedCallback",value:function(){if(null!=this.meeting){var e=this.meeting.participants;e.removeListener("pageChanged",this.onPageChanged),e.removeListener("viewModeChanged",this.onPageChanged),e.joined.removeListener("participantJoined",this.onParticipantJoin),e.joined.removeListener("participantLeft",this.onParticipantLeave)}}},{key:"meetingChanged",value:function(e){if(null!=e){var t=e.participants;this.page=t.currentPage,this.pageCount=t.pageCount,t.addListener("viewModeChanged",this.onPageChanged),t.addListener("pageChanged",this.onPageChanged),t.joined.addListener("participantJoined",this.onParticipantJoin),t.joined.addListener("participantLeft",this.onParticipantLeave),this.activeCount=this.meeting.participants.joined.size,this.activeComputedCount=this.meeting.participants.joined.size,this.toggleGridPagination()}}},{key:"sizeChanged",value:function(){this.toggleGridPagination()}},{key:"render",value:function(){var e=this;if(!("WEBINAR"===this.meeting.meta.viewType)&&this.showPagination)return T(C,null,T("dyte-button",{class:"prev",variant:"secondary",kind:"icon",disabled:0===this.pageCount,onClick:this.prevPage,"aria-label":this.t("Previous Page"),iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.chevron_left,iconPack:this.iconPack,t:this.t})),"grid"!==this.variant&&T("div",{class:"center"},T("span",{class:"page"},0===this.pageCount?T("dyte-tooltip",{label:this.t("Auto Layout"),iconPack:this.iconPack,t:this.t},T("dyte-button",{kind:"icon",class:"auto",iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.wand,iconPack:this.iconPack,t:this.t}))):this.page),0!==this.pageCount&&[T("span",{class:"slash"},"/"),T("span",{class:"pages"},this.pageCount)]),"grid"===this.variant&&this.pageCount>0&&T("div",{class:"dots"},(0,m.Z)(Array(this.pageCount)).map((function(t,n){return T("div",{key:"dot-".concat(n),class:{dot:!0,active:n+1===e.page}})}))),T("dyte-button",{class:"next",variant:"secondary",kind:"icon",disabled:0!==this.page&&this.page===this.pageCount,onClick:this.nextPage,"aria-label":this.t("Next Page"),iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.chevron_right,tabIndex:-1,"aria-hidden":!0,iconPack:this.iconPack,t:this.t})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],size:["sizeChanged"]}}}]),e}();_a.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;font-size:16px}:host([size='sm']){margin-left:var(--dyte-space-1, 4px);margin-right:var(--dyte-space-1, 4px);font-size:12px}:host([size='sm']) .center{margin-left:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-0, 0px)}:host([size='sm']) dyte-button{height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px)}:host([size='sm']) dyte-button dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}dyte-button{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
2dow)}.center{margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.center .page{color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88))}.center .slash{margin-left:var(--dyte-space-0\\.5, 2px);margin-right:var(--dyte-space-0\\.5, 2px)}.center .pages{align-self:flex-end;font-size:12px}:host([variant='rounded']){overflow:hidden;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}:host([variant='rounded']) dyte-button{border-radius:9999px;border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:transparent;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64));transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}:host([variant='rounded']) dyte-button:not([disabled]):hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='rounded']) dyte-button:not([disabled]):focus{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='grid']){margin-left:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-0, 0px)}:host([variant='grid']) dyte-button{position:absolute;top:50%;height:var(--dyte-space-20, 80px);width:var(--dyte-space-20, 80px);opacity:0.2;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}:host([variant='grid']) dyte-button:hover{opacity:1}:host([variant='grid']) dyte-button{transform:translateY(-50%)}:host([variant='grid']) dyte-button.prev{left:var(--dyte-space-0, 0px);border-top-right-radius:9999px;border-bottom-right-radius:9999px}:host([variant='grid']) dyte-button.next{right:var(--dyte-space-0, 0px);border-top-left-radius:9999px;border-bottom-left-radius:9999px}:host([variant='grid']) dyte-button.auto{left:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);border-top-right-radius:9999px;border-bottom-right-radius:9999px}:host([variant='grid']) .dots{position:absolute;left:50%;bottom:var(--dyte-space-3, 12px);display:flex;align-items:center;transform:translateX(-50%)}:host([variant='grid']) .dots .dot{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-2, 8px);width:var(--dyte-space-2, 8px);cursor:pointer;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([variant='grid']) .dots .dot:last-child{margin-right:var(--dyte-space-0, 0px)}:host([variant='grid']) .dots .dot.active{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}:host([variant='grid'][size='sm']) dyte-button{height:var(--dyte-space-14, 56px);width:var(--dyte-space-14, 56px);opacity:0.1}";var wa=Object.freeze({__proto__:null,dyte_grid_pagination:_a}),xa=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.variant="solid",this.disableRender=!1,this.meeting=void 0,this.config=Ue,this.states=void 0,this.iconPack=ar,this.t=ir(),this.size=void 0}return(0,c.Z)(e,[{key:"render",value:function(){var e={meeting:this.meeting,config:this.config,states:this.states,t:this.t,iconPack:this.iconPack,size:this.size};return T(C,null,!this.disableRender&&T(sr,{element:"dyte-header",defaults:e,onlyChildren:!0}),T("slot",null))}}]),e}();xa.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;height:var(--dyte-space-12, 48px);align-items:center;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}";var Sa=Object.freeze({__proto__:null,dyte_header:xa}),Ea=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.meeting=void 0,this.config=Ue,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("slot",null,T("div",{class:"ctr",part:"container"},T("dyte-logo",{meeting:this.meeting,config:this.config,t:this.t,part:"logo"}),T("dyte-spinner",{"aria-label":"Idle, waiting for meeting data",part:"spinner",iconPack:this.iconPack,t:this.t}))))}}]),e}();Ea.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.ctr{display:flex;flex-direction:column;align-items:center}dyte-logo{margin-bottom:var(--dyte-space-10, 40px);height:var(--dyte-space-12, 48px)}dyte-spinner{height:var(--dyte-space-12, 48px);width:var(--dyte-space-12, 48px);--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";var Ta=Object.freeze({__proto__:null,dyte_idle_screen:Ea}),Pa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;return null==e?"":e.length>t?"".concat(e.substring(0,t),"..."):e},Ca=function(e){return(null===e||void 0===e?void 0:e.trim().toLowerCase().startsWith("javascript:"))?"https://dyte.io":e},Ra=function(e){return""===(e=null===e||void 0===e?void 0:e.trim())?"Participant":e};function Za(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;
2return e.replace(/[^\u00BF-\u1FFF\u2C00-\uD7FF\w\s]/g,"").trim().split(/\s+/).slice(0,t).map((function(e){return e.charAt(0)})).join("").toUpperCase()}var Ma=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file";try{var n=new URL(e).pathname.split("/").pop();return"/"!==n?n:t}catch(r){return t}},Aa=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t,n){var r,i,a,o;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ca(t),r=null===n||void 0===n?void 0:n.name,e.next=4,fetch(t);case 4:if((i=e.sent).ok){e.next=8;break}return window.open(t,"_blank"),e.abrupt("return");case 8:return e.t0=URL,e.next=11,i.blob();case 11:e.t1=e.sent,a=e.t0.createObjectURL.call(e.t0,e.t1),(o=document.createElement("a")).href=a,o.download=null!==r&&void 0!==r?r:Ma(t,null===n||void 0===n?void 0:n.fallbackName),o.click();case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ia=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.close=I(this,"close",7),this.keypressListener=function(e){"Escape"===e.key&&n.close.emit()},this.handleOutsideClick=function(){return n.close.emit()},this.image=void 0,this.size=void 0,this.t=ir(),this.iconPack=ar}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){document.addEventListener("keydown",this.keypressListener),document.addEventListener("click",this.handleOutsideClick)}},{key:"disconnectedCallback",value:function(){document.removeEventListener("keydown",this.keypressListener),document.removeEventListener("click",this.handleOutsideClick)}},{key:"render",value:function(){var e=this;return T(C,{class:"scrollbar",onClick:function(e){return e.stopPropagation()}},T("div",{class:"header"},T("div",{class:"shared-by-user"},this.t("Shared by")," ",T("span",{class:"displayName"},Ra(Pa(this.image.displayName)))),T("div",{class:"actions"},T("dyte-button",{kind:"icon",variant:"secondary",onClick:function(){return e.close.emit()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.full_screen_minimize,iconPack:this.iconPack,t:this.t})),T("dyte-button",{onClick:function(){return Aa(e.image.link,{fallbackName:"image"})},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.download,slot:"start",iconPack:this.iconPack,t:this.t}),"Download"))),T("div",{class:"image-ctr"},T("img",{src:this.image.link})))}}]),e}();Ia.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{width:1140px;max-width:100%;box-sizing:border-box;display:flex;flex-direction:column;padding:var(--dyte-space-6, 24px);padding-top:var(--dyte-space-5, 20px);overflow-y:auto;color:rgb(var(--dyte-colors-text-1000, 255 255 255));z-index:40;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.displayName{font-weight:700}.image-ctr{margin-top:var(--dyte-space-2, 8px);box-sizing:border-box;display:flex;justify-content:center;overflow:hidden}.actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--dyte-space-2, 8px)}img{box-sizing:border-box;display:block;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.header{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--dyte-space-4, 16px)}.shared-by-user{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:host([size='sm']) .header{flex-direction:column}:host([size='sm']) .header .actions{margin-top:var(--dyte-space-4, 16px)}";var Oa=Object.freeze({__proto__:null,dyte_image_viewer:Ia}),La=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.leave=function(){n.stateUpdate.emit({activeLeaveConfirmation:!0}),br.activeLeaveConfirmation=!0},this.variant="button",this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){var e=this.t("leave");return T(C,{label:e},T("dyte-controlbar-button",{size:this.size,iconPack:this.iconPack,t:this.t,class:"leave",onClick:this.leave,icon:this.iconPack.call_end,label:e,variant:this.variant}))}}]),e}();La.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Da=Object.freeze({__proto__:null,dyte_leave_button:La}),Na=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.keyPressListener=function(e){"Escape"===e.key&&n.close()},this.isBreakoutRoomsActive=!1,this.isChildMeeting=!1,this.canJoinMainRoom=!1,this.close=function(){n.stateUpdate.emit({activeLeaveConfirmation:!1}),br.activeLeaveConfirmation=!1},this.handleLeave=function(){var e;null===(e=n.meeting)||void 0===e||e.leaveRoom(),n.close()},this.handleJoinMainRoom=function(){n.meeting.connectedMeetings.moveParticipants(n.meeting.meta.roomName,n.meeting.connectedMeetings.parentMeeting.id,[n.meeting.self.userId]),n.close()},this.handleEndMeeting=function(){var e;null===(e=n.meeting)||void 0===e||e.participants.kickAll(),n.close()},this.meeting=void 0,this.states=void 0,this.iconPack=ar,this.t=ir(),this.canEndMeeting=!1}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting),document.addEventListener("keydown",this.keyPressListener)}},{key:"componentDidLoad",value:function(){}},{key:"disconnectedCallback",value:function(){document.removeEventListener("keydown",this.keyPressListener)}},{key:"meetingChanged",value:function(e){null!=e&&(this.canEndMeeting=e.self.permissions.kickParticipant,this.isBreakoutRoomsActive=this.meeting.connectedMeetings.supportsConnectedMeetings&&this.meeting.connectedMeetings.isActive,this.isChildMeeting=this.meeting.connectedMeetings.supportsConnectedMeetings&&this.meeting.connectedMeetings.meetings.some((function(t){return t.id===e.meta.roomName})),this.canJoinMainRoom=this.meeting.self.permissions.connectedMeetings.canSwitchToParentMeeting)}},{key:"render",value:function(){return T(C,null,T("div",{class:"leave-modal"},T("div",{class:"header"},T("h2",{class:"title"},this.t("leave"))),T("p",{class:"message"},this.isBreakoutRoomsActive&&this.isChildMeeting?this.t("breakout_rooms.leave_confirmation"):this.t("leave_confirmation")),T("div",{class:"content"},T("dyte-button",{variant:"secondary",onClick:this.close,iconPack:this.iconPack,class:"secondary-btn",t:this.t},this.t("cancel")),this.isBreakoutRoomsActive&&this.isChildMeeting&&this.canJoinMainRoom&&T("dyte-button",{variant:"secondary",onClick:this.handleJoinMainRoom,iconPack:this.iconPack,class:"secondary-btn",t:this.t},this.t("breakout_rooms.leave_confirmation.main_room_btn")),T("dyte-button",{variant:this.canEndMeeting?"secondary":"danger",title:this.t("leave"),onClick:this.handleLeave,iconPack:this.iconPack,class:{"secondary-btn":this.canEndMeeting,"secondary-danger-btn":this.canEndMeeting},t:this.t},this.t("leave")),this.canEndMeeting&&T("dyte-button",{variant:"danger",onClick:this.handleEndMeeting,iconPack:this.iconPack,t:this.t},this.t("end_meeting_for_all")))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Na.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.leave-modal{width:var(--dyte-space-72, 288px)}@media (min-width: 768px){.leave-modal{width:var(--dyte-space-96, 384px)}}.leave-modal{position:relative;display:flex;flex-direction:column;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding:var(--dyte-space-8, 32px);color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.leave-modal .header h2{margin:var(--dyte-space-0, 0px)}.leave-modal .message{color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}.leave-modal .content{margin-top:var(--dyte-space-4, 16px);font-size:14px;display:flex;flex-wrap:wrap;gap:var(--dyte-space-4, 16px)}.leave-modal .content dyte-button{height:var(--dyte-space-9, 36px);min-width:var(--dyte-space-44, 176px);flex-grow:1}.leave-modal .content .secondary-btn{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.leave-modal .content .secondary-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.leave-modal .content .secondary-danger-btn{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var ja=Object.freeze({__proto__:null,dyte_leave_meeting:Na}),Ba=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.setIsLivestreaming=function(e){n.isLivestreaming="LIVESTREAMING"===e},this.meeting=void 0,this.size=void 0,this.t=ir(),this.isLivestreaming=void 0,this.iconPack=ar}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e,t;null===(t=null===(e=this.meeting)||void 0===e?void 0:e.livestream)||void 0===t||t.removeListener("livestreamUpdate",this.setIsLivestreaming)}},{key:"meetingChanged",value:function(e){var t,n;null!=e&&(this.setIsLivestreaming(null===(t=this.meeting.livestream)||void 0===t?void 0:t.state),null===(n=this.meeting.livestream)||void 0===n||n.on("livestreamUpdate",this.setIsLivestreaming))}},{key:"render",value:function(){if(Gr(this.meeting)&&this.isLivestreaming)return T(C,null,T("div",{class:"indicator","aria-label":this.t("This meeting is being livestreamed"),part:"indicator"},T("dyte-icon",{icon:this.iconPack.start_livestream}),"LIVE"))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Ba.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:block}:host[size='sm']{margin-left:var(--dyte-space-1, 4px);margin-right:var(--dyte-space-1, 4px)}.indicator{display:flex;flex-direction:row;align-items:center;min-width:var(--dyte-space-14, 56px) !important;font-size:14px;--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}dyte-icon{margin-right:var(--dyte-space-1, 4px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);-webkit-animation:blink 4s linear infinite;animation:blink 4s linear infinite}:host([size='sm']) dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}
2:host([size='sm']) .indicator span{display:none}@-webkit-keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}@keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}";var Ua=Object.freeze({__proto__:null,dyte_livestream_indicator:Ba}),Va=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.dyteAPIError=I(this,"dyteAPIError",7),this.livestreamStateListener=function(e){n.livestreamState=e,"LIVESTREAMING"!==e&&"IDLE"!==e||(n.stateUpdate.emit({activeMoreMenu:!1}),br.activeMoreMenu=!1)},this.isLoading=function(){return null==n.meeting||"STARTING"===n.livestreamState||"STOPPING"===n.livestreamState},this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.livestreamState="IDLE"}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){this.clearListeners()}},{key:"meetingChanged",value:function(e){var t,n;null!=e&&(this.livestreamState=null===(t=this.meeting.livestream)||void 0===t?void 0:t.state,null===(n=this.meeting.livestream)||void 0===n||n.on("livestreamUpdate",this.livestreamStateListener))}},{key:"toggleLivestream",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){var t,n;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("LIVESTREAMING"!==this.livestreamState){e.next=11;break}return e.prev=1,e.next=4,null===(t=this.meeting.livestream)||void 0===t?void 0:t.stop();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),this.dyteAPIError.emit({trace:this.t("livestream.stop"),message:this.t("Error while stopping livestream.")});case 9:e.next=19;break;case 11:return e.prev=11,e.next=14,null===(n=this.meeting.livestream)||void 0===n?void 0:n.start();case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(11),this.dyteAPIError.emit({trace:this.t("livestream.start"),message:this.t("Error while starting livestream.")});case 19:case"end":return e.stop()}}),e,this,[[1,6],[11,16]])})));return function(){return e.apply(this,arguments)}}()},{key:"clearListeners",value:function(){var e;null===(e=this.meeting.livestream)||void 0===e||e.removeListener("livestreamUpdate",this.livestreamStateListener)}},{key:"getLivestreamLabel",value:function(){switch(this.livestreamState){case"IDLE":return this.t("Go Live");case"LIVESTREAMING":return this.t("End Live");case"STARTING":return this.t("Starting");case"STOPPING":return this.t("Stopping");default:return this.t("Error")}}},{key:"getLivestreamIcon",value:function(){return"IDLE"===this.livestreamState?this.iconPack.start_livestream:this.iconPack.stop_livestream}},{key:"render",value:function(){var e=this;if(function(e){var t;return!!Gr(e)&&"LIVESTREAM"===e.meta.viewType&&(null===(t=null===e||void 0===e?void 0:e.self)||void 0===t?void 0:t.permissions.canLivestream)}(this.meeting))return T(C,null,T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,isLoading:this.isLoading(),class:{"active-livestream":"LIVESTREAMING"===this.livestreamState},onClick:function(){return e.toggleLivestream()},icon:this.getLivestreamIcon(),disabled:this.isLoading(),label:this.t(this.getLivestreamLabel()),variant:this.variant}))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Va.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Fa=Object.freeze({__proto__:null,dyte_livestream_toggle:Va}),za=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.meeting=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){var e,t=null===(e=this.meeting)||void 0===e?void 0:e.meta.meetingTitle;return null==t?null:T(C,{tabIndex:0,role:"banner","aria-label":t},T("dyte-tooltip",{label:t,part:"tooltip",iconPack:this.iconPack,t:this.t},T("div",{class:"title",part:"title"},t)))}}]),e}();za.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-3, 12px);margin-right:var(--dyte-space-3, 12px);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:16px;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.title{text-align:center;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:host([size='sm']){font-size:12px}";var Ha=Object.freeze({__proto__:null,dyte_meeting_title:za}),qa=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.audioUpdateListener=function(e){var t=e.audioEnabled;n.audioEnabled=t},this.selfJoinStateListener=function(){n.updateCanProduce(n.meeting)},this.selfStageLeftListener=function(){n.canProduceAudio=!1},this.selfJoinStateRejectedListener=function(){n.updateCanProduce(n.meeting)},this.mediaPermissionUpdateListener=function(e){var t=e.kind,r=e.message;"audio"===t&&(n.micPermission=r)},this.toggleMic=function(){var e,t,r,i,a,o,s,c,u,l,d,p;if(null===(e=n.meeting)||void 0===e||e.__internals__.logger.info("dyteMicToggle::toggleMic",{media:{audio:{enabled:Boolean(null===(r=null===(t=n.meeting)||void 0===t?void 0:t.self)||void 0===r?void 0:r.audioEnabled),permission:n.micPermission,canProduce:null===(o=null===(a=null===(i=n.meeting)||void 0===i?void 0:i.self)||void 0===a?void 0:a.permissions)||void 0===o?void 0:o.canProduceAudio}},webinar:{stageStatus:null===(c=null===(s=n.meeting)||void 0===s?void 0:s.self)||void 0===c?void 0:c.webinarStageStatus},livestream:{stageStatus:null===(l=null===(u=n.meeting)||void 0===u?void 0:u.stage)||void 0===l?void 0:l.status},moduleExists:{self:Boolean(null===(d=n.meeting)||void 0===d?void 0:d.self)}}),n.hasPermissionError()){var h={enabled:!0,kind:"audio"};return n.stateUpdate.emit({activePermissionsMessage:h}),br.activePermissionsMessage=h,!1}var f=null===(p=n.meeting)||void 0===p?void 0:p.self;null!=f&&n.canProduceAudio&&(f.audioEnabled?f.disableAudio():f.enableAudio())},this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.audioEnabled=!1,this.canProduceAudio=!1,this.micPermission="NOT_REQUESTED"}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e,t,n,r,i,a,o,s,c;null===(e=this.meeting)||void 0===e||e.self.removeListener("audioUpdate",this.audioUpdateListener),null===(t=this.meeting)||void 0===t||t.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null===(n=this.meeting)||void 0===n||n.self.removeListener("joinStageRequestAccepted",this.selfJoinStateListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("joinStageRequestRejected",this.selfJoinStateRejectedListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("stageJoined",this.selfJoinStateListener),null===(a=this.meeting)||void 0===a||a.self.removeListener("stageLeft",this.selfStageLeftListener),null===(o=this.meeting)||void 0===o||o.self.removeListener("removedFromStage",this.selfJoinStateListener),null===(c=null===(s=this.meeting)||void 0===s?void 0:s.stage)||void 0===c||c.removeListener("stageStatusUpdate",this.selfJoinStateListener)}},{key:"meetingChanged",value:function(e){if(null!=e){var t=e.self,n=e.stage;this.canProduceAudio="ALLOWED"===t.permissions.produceAudio,this.updateCanProduce(e),this.micPermission=e.self.mediaPermissions.audio||"NOT_REQUESTED",this.audioEnabled=t.audioEnabled,t.addListener("audioUpdate",this.audioUpdateListener),t.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),t.addListener("joinStageRequestAccepted",this.selfJoinStateListener),t.addListener("joinStageRequestRejected",this.selfJoinStateRejectedListener),t.addListener("stageJoined",this.selfJoinStateListener),t.addListener("stageLeft",this.selfStageLeftListener),t.addListener("removedFromStage",this.selfJoinStateListener),null===n||void 0===n||n.addListener("stageStatusUpdate",this.selfJoinStateListener)}}},{key:"updateCanProduce",value:function(e){var t=e.self,n=e.meta,r=e.stage,i="ALLOWED"===t.permissions.canProduceAudio,a="WEBINAR"===n.viewType,o="LIVESTREAM"===n.viewType;if(this.canProduceAudio=!1,i&&!o)this.canProduceAudio=!0;else if(a||o){i&&"OFF_STAGE"!==r.status&&"REQUESTED_TO_JOIN_STAGE"!==r.status&&(this.canProduceAudio=!0),"CAN_REQUEST"===t.permissions.canProduceAudio&&(a&&("ON_STAGE"===t.webinarStageStatus||"ACCEPTED_TO_JOIN_STAGE"===t.webinarStageStatus)||o&&("ON_STAGE"===r.status||"ACCEPTED_TO_JOIN_STAGE"===r.status))&&(this.canProduceAudio=!0)}}},{key:"hasPermissionError",value:function(){return"DENIED"===this.micPermission||"SYSTEM_DENIED"===this.micPermission}},{key:"getState",value:function(){var e="",t="",n={},r=this.hasPermissionError(),i="COULD_NOT_START"===this.micPermission;return this.audioEnabled&&!r?(e=this.t("mic_on"),t=this.iconPack.mic_on):(e=this.t("mic_off"),t=this.iconPack.mic_off,n["red-icon"]=!0),{tooltipLabel:i?this.t("Unable to capture audio"):"SYSTEM_DENIED"===this.micPermission?this.t("perm_sys_denied"):"DENIED"===this.micPermission?this.t("perm_browser_denied"):this.audioEnabled?this.t("Disable Mic"):this.t("Enable Mic"),label:e,icon:t,classList:n,showWarning:r||i,disable:r}}},{key:"render",value:function(){if(!this.canProduceAudio)return null;var e=this.getState(),t=e.tooltipLabel,n=e.label,r=e.icon,i=e.classList,a=e.showWarning,o=e.disable;return T(C,{title:n},T("dyte-tooltip",{kind:"block",label:t,part:"tooltip",iconPack:this.iconPack,t:this.t},T("dyte-controlbar-button",{part:"controlbar-button",icon:r,label:n,size:this.size,iconPack:this.iconPack,t:this.t,variant:this.variant,class:i,onClick:this.toggleMic,showWarning:a,disabled:o})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();qa.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}:host(.audioDisabled) :slotted(dyte-icon){--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Ga=Object.freeze({__proto__:null,dyte_mic_toggle:qa}),Wa=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.layout="row",this.participants=[],this.pinnedParticipants=[],this.screenShareParticipants=[],this.plugins=[],this.aspectRatio="16:9",this.gap=8,this.size=void 0,this.meeting=void 0,this.states=void 0,this.config=Ue,this.iconPack=ar,this.t=ir(),this.gridSize=ya,this.activeTab=void 0,this.initialised=void 0}
2return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){this.initialised=!1,this.screenShareParticipantsChanged(this.screenShareParticipants),this.pluginsChanged(this.plugins),this.initialised=!0}},{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.meeting.spotlight)||void 0===e||e.removeListener("activeTabUpdate",this.spotlightTabUpdateListener)}},{key:"meetingChanged",value:function(e){var t,n,r,i,a=this;null!=e&&(void 0!=(null===(t=e.spotlight)||void 0===t?void 0:t.selfActiveTab)&&this.onSpotlightTabUpdate(null===(n=e.spotlight.selfActiveTab)||void 0===n?void 0:n.type,null===(r=e.spotlight.selfActiveTab)||void 0===r?void 0:r.id),this.spotlightTabUpdateListener=function(e){a.onSpotlightTabUpdate(null===e||void 0===e?void 0:e.type,null===e||void 0===e?void 0:e.id)},null===(i=e.spotlight)||void 0===i||i.addListener("activeTabUpdate",this.spotlightTabUpdateListener))}},{key:"screenShareParticipantsChanged",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(this.initialised||null==this.activeTab)&&(null==this.activeTab&&e.length>0?this.setActiveTab({type:"screenshare",participant:e[0]}):this.revalidateActiveTab())}},{key:"pluginsChanged",value:function(e){if(this.initialised||null==this.activeTab)if(e.length>0){var t=e.length-1;this.setActiveTab({type:"plugin",plugin:e[t]})}else this.revalidateActiveTab()}},{key:"revalidateActiveTab",value:function(){if(null!=this.activeTab)if("screenshare"===this.activeTab.type){var e=this.activeTab.participant;this.screenShareParticipants.some((function(t){return t.id===e.id}))||this.reassignActiveTab()}else{var t=this.activeTab.plugin;this.plugins.some((function(e){return e.id===t.id}))||this.reassignActiveTab()}}},{key:"setActiveTab",value:function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.activeTab=e;var r="screenshare"===e.type?e.participant.id:e.plugin.id;n&&(null===(t=this.meeting.spotlight)||void 0===t||t.setSelfActiveTab({type:e.type,id:r},0))}},{key:"reassignActiveTab",value:function(){if(this.screenShareParticipants.length>0)this.setActiveTab({type:"screenshare",participant:this.screenShareParticipants[0]});else if(this.plugins.length>0){var e=this.plugins.length-1;this.setActiveTab({type:"plugin",plugin:this.plugins[e]})}}},{key:"onSpotlightTabUpdate",value:function(e,t){if(void 0!=e&&void 0!=t)switch(e){case"plugin":var n=this.plugins.find((function(e){return e.id===t}));void 0!=n&&this.setActiveTab({type:"plugin",plugin:n},!1);break;case"screenshare":var r=this.screenShareParticipants.find((function(e){return e.id===t}));void 0!=r&&this.setActiveTab({type:"screenshare",participant:r},!1)}}},{key:"getTabs",value:function(){var e=this.screenShareParticipants.map((function(e){return{type:"screenshare",participant:e}})),t=this.plugins.map((function(e){return{type:"plugin",plugin:e}}));return e.concat(t)}},{key:"render",value:function(){var e,t=this,n={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t};return T(C,null,T("main",{id:"main-view",part:"main-view"},(null===(e=this.getTabs())||void 0===e?void 0:e.length)>1&&T("dyte-tab-bar",Object.assign({activeTab:this.activeTab,tabs:this.getTabs(),onTabChange:function(e){return t.setActiveTab(e.detail)}},n)),T("div",{id:"tabs",key:"tabs"},this.screenShareParticipants.map((function(e){var r,i;return T(sr,{element:"dyte-screenshare-view",defaults:n,props:{participant:e,key:e.id,style:{display:"screenshare"===(null===(r=t.activeTab)||void 0===r?void 0:r.type)&&(null===(i=t.activeTab)||void 0===i?void 0:i.participant.id)===e.id?"flex":"none"}},childProps:{participant:e,isScreenShare:!0},deepProps:!0})})),this.plugins.map((function(e){var r,i;return T(sr,{element:"dyte-plugin-main",defaults:n,props:{plugin:e,key:e.id,style:{display:"plugin"===(null===(r=t.activeTab)||void 0===r?void 0:r.type)&&(null===(i=t.activeTab)||void 0===i?void 0:i.plugin.id)===e.id?"flex":"none"}}})})))),T(sr,{element:"dyte-mixed-grid",defaults:n,childProps:{part:"participants-grid",class:this.gridSize.mixed?"grid-width-".concat(this.gridSize.mixed):"grid-width-lg",participants:this.participants,pinnedParticipants:this.pinnedParticipants,screenShareParticipants:this.screenShareParticipants,plugins:this.plugins,aspectRatio:this.aspectRatio,gap:this.gap,size:"sm",layout:"row"},onlyChildren:!0}))}},{key:"host",get:function(){return A(this)}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],screenShareParticipants:["screenShareParticipantsChanged"],plugins:["pluginsChanged"]}}}]),e}();Wa.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block;height:100%;width:100%;display:flex}main{display:flex;flex:1 1 0%;padding-left:var(--dyte-space-4, 16px)}:host([layout='column']) main{padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}main dyte-tab-bar{margin-right:var(--dyte-space-4, 16px);box-sizing:border-box;display:flex;height:100%;width:var(--dyte-space-16, 64px);flex-direction:column}main #tabs{height:100%;flex:1 1 0%}dyte-button{z-index:10}.grid-width-sm{width:25%}.grid-width-md{width:50%}.grid-width-lg{width:66.666667%}.col{display:flex;flex-direction:column;align-items:center}.tab{display:flex;height:var(--dyte-space-16, 64px);width:var(--dyte-space-16, 64px);align-items:center;justify-content:center;margin-bottom:var(--dyte-space-2, 8px);font-size:12px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.tab.active{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}.tab img{height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px);border-radius:var(--dyte-border-radius-sm, 4px)}:host([size='sm']){flex-direction:column}:host([size='sm']) .grid-width-lg,:host([size='sm']) .grid-width-md{height:50%;width:100%;max-width:100%}:host([size='sm']) .grid-width-sm{height:33.333333%;width:100%;max-width:100%}:host([size='sm']) main{display:flex;flex:1 1 0%;flex-direction:column;padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}:host([size='sm']) dyte-tab-bar{height:var(--dyte-space-12, 48px);width:100%;flex-direction:row}:host([size='sm']) #tabs{flex:1 1 0%}:host([size='sm']) .tab{margin:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-2, 8px)}:host([layout='column']){flex-direction:column}:host([layout='column']) main{display:flex;flex:1 1 0%}:host([layout='column']) .grid-width-lg,:host([layout='column']) .grid-width-md{height:50%;max-width:100%;width:100%}:host([layout='column']) .grid-width-sm{height:33.333333%;max-width:100%;width:100%}@media (orientation: portrait){:host{flex-direction:column}:host .grid-width-lg{height:50%;width:100%;max-width:100%}:host .grid-width-md{height:33.333333%;width:100%;max-width:100%}:host .grid-width-sm{height:25%;width:100%;max-width:100%}:host main{flex:1 1 0%;flex-direction:column;padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}:host([size='md']) main{flex:1 1 0%;flex-direction:column;padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}:host dyte-tab-bar{height:var(--dyte-space-16, 64px);width:100%;flex-direction:row}:host #tabs{flex:1 1 0%}:host .tab{margin:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-2, 8px)}}";var Ja=Object.freeze({__proto__:null,dyte_mixed_grid:Wa}),$a=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.toggleMoreMenu=function(){n.stateUpdate.emit({activeMoreMenu:!br.activeMoreMenu}),br.activeMoreMenu=!br.activeMoreMenu},this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){var e=this,t=this.t("More"),n=this.states||br,r=!0===(null===n||void 0===n?void 0:n.activeMoreMenu)?this.iconPack.chevron_down:this.iconPack.chevron_up;return T(C,{title:t},T("dyte-controlbar-button",{size:this.size,iconPack:this.iconPack,t:this.t,onClick:function(){return e.toggleMoreMenu()},icon:r,label:t,part:"controlbar-button"}))}}]),e}();$a.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Ka=Object.freeze({__proto__:null,dyte_more_toggle:$a}),Qa=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.onMuteAll=function(){n.stateUpdate.emit({activeMuteAllConfirmation:!0})},this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){var e;if(!(null===(e=this.meeting)||void 0===e?void 0:e.self.permissions.canAllowParticipantAudio)
2)return null;var t=this.t("mute_all");return T(C,{title:t},T("dyte-tooltip",{kind:"block",label:t,part:"tooltip"},T("dyte-controlbar-button",{part:"controlbar-button",icon:this.iconPack.speaker_off,label:t,size:this.size,iconPack:this.iconPack,t:this.t,variant:this.variant,onClick:this.onMuteAll})))}}]),e}();Qa.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Ya=Object.freeze({__proto__:null,dyte_mute_all_button:Qa}),Xa=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.onClose=function(){n.stateUpdate.emit({activeMuteAllConfirmation:!1}),br.activeMuteAllConfirmation=!1},this.onMuteAll=function(){var e;null===(e=n.meeting)||void 0===e||e.participants.disableAllAudio(n.allowUnmute),n.onClose()},this.meeting=void 0,this.states=void 0,this.iconPack=ar,this.t=ir(),this.allowUnmute=!0}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("div",{class:"leave-modal"},T("div",{class:"header"},T("h2",{class:"title"},this.t("mute_all.header"))),T("p",{class:"message"},this.t("mute_all.description")),T("div",{class:"content"},T("div",{class:"leave-meeting"},T("dyte-button",{variant:"secondary",title:this.t("Close"),onClick:this.onClose,iconPack:this.iconPack,t:this.t},this.t("cancel")),T("dyte-button",{variant:"danger",title:this.t("mute_all"),onClick:this.onMuteAll,iconPack:this.iconPack,t:this.t},this.t("mute_all"))))))}}]),e}();Xa.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leave-modal{position:relative;display:flex;flex-direction:column;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));padding:var(--dyte-space-4, 16px);color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.leave-modal .header h2{margin:var(--dyte-space-0, 0px)}.leave-modal .content{font-size:14px}.leave-message p{margin-top:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-3, 12px)}.leave-meeting{display:flex;flex-direction:row;justify-content:space-between;gap:var(--dyte-space-2, 8px)}.leave-meeting dyte-button{flex:1 1 0%}.end-meeting{margin-top:var(--dyte-space-2, 8px)}.body{margin-bottom:var(--dyte-space-4, 16px)}label{display:flex;align-items:center}input[type='checkbox']{margin-right:var(--dyte-space-2, 8px);accent-color:rgb(var(--dyte-colors-brand-500, 33 96 253))}";var eo=Object.freeze({__proto__:null,dyte_mute_all_confirmation:Xa}),to=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.participant=void 0,this.meeting=void 0,this.size=void 0,this.maxLength=20,this.isScreenShare=!1,this.iconPack=ar,this.t=ir(),this.length=13}return(0,c.Z)(e,[{key:"sizeChanged",value:function(e){this.length="sm"===e?8:13}},{key:"formatNameTag",value:function(e,t){return this.isScreenShare?t?"".concat(this.t("Screen")," - ").concat(Pa(e,this.length-3)," (").concat(this.t("you"),")"):"".concat(this.t("Screen")," - ").concat(Pa(e,this.length)):t?"".concat(Pa(e,this.length-3)," (").concat(this.t("you"),")"):Pa(e,this.length)}},{key:"render",value:function(){var e,t,n,r=Ra((null===(e=this.participant)||void 0===e?void 0:e.name)||""),i=(null===(t=this.participant)||void 0===t?void 0:t.id)===(null===(n=this.meeting)||void 0===n?void 0:n.self.id);return T(C,{title:r},T("slot",{name:"start"}),T("span",{class:"name"},this.formatNameTag(r,i)),T("slot",{name:"end"}))}}],[{key:"watchers",get:function(){return{size:["sizeChanged"]}}}]),e}();to.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;padding-top:var(--dyte-space-1, 4px);padding-bottom:var(--dyte-space-1, 4px);padding-left:var(--dyte-space-1\\.5, 6px);padding-right:var(--dyte-space-1\\.5, 6px);font-size:14px;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88))}span.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}::slotted(dyte-audio-visualizer[slot='start']){margin-right:var(--dyte-space-1\\.5, 6px)}::slotted(dyte-audio-visualizer[slot='end']){margin-left:var(--dyte-space-1\\.5, 6px)}:host([size='sm']){font-size:12px;--tw-bg-opacity:0.6}";var no=Object.freeze({__proto__:null,dyte_name_tag:to}),ro=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onMediaScoreUpdate=function(e){var t=e.kind,r=e.isScreenshare,i=e.score;("video"===t||n.isScreenShare&&r)&&(n.score=i)},this.participant=void 0,this.meeting=void 0,this.iconPack=ar,this.t=ir(),this.isScreenShare=!1,this.score=10}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.participantChanged(this.participant)}},{key:"participantChanged",value:function(e){e&&e.addListener("mediaScoreUpdate",this.onMediaScoreUpdate)}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.participant)||void 0===e||e.removeListener("mediaScoreUpdate",this.onMediaScoreUpdate)}},{key:"render",value:function(){if(this.meeting&&this.meeting.self.userId===this.participant.userId)return null;var e=Math.round(this.score/2),t="good";if(e>3)return null;switch(e<1&&(e=1),e){case 3:case 2:t="poor";break;case 1:t="poorest"}return T(C,null,T("dyte-icon",{icon:this.iconPack["signal_".concat(e)],class:t}),T("dyte-icon",{icon:this.iconPack.signal_5,class:"bg-signal"}))}}],[{key:"watchers",get:function(){return{participant:["participantChanged"]}}}]),e}();ro.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:block;height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px)}dyte-icon{position:absolute;top:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);z-index:10;height:100%;width:100%;--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}dyte-icon.good{--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}dyte-icon.poor{--tw-text-opacity:1;color:rgba(var(--dyte-colors-warning, 255 205 7) / var(--tw-text-opacity))}dyte-icon.poorest{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([size='md']){height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}:host([size='sm']){height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}.bg-signal{position:absolute;top:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);z-index:0;color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}";var io,ao=Object.freeze({__proto__:null,dyte_network_indicator:ro});!function(e){e.REQUEST_RECEIVED="REQUEST_RECEIVED",e.REQUEST_SENT="REQUEST_SENT",e.INCOMING_REQUEST_ACCEPTED="INCOMING_REQUEST_ACCEPTED",e.OUTGOING_REQUEST_ACCEPTED="OUTGOING_REQUEST_ACCEPTED",e.INCOMING_REQUEST_ENDED="INCOMING_REQUEST_ENDED",e.OUTGOING_REQUEST_ENDED="OUTGOING_REQUEST_ENDED"}(io||(io={}));var oo=console,so={joined:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",left:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",message:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_message.mp3"},co=function(){function e(){(0,s.Z)(this,e),this.audio=document.createElement("audio"),this.audio.volume=.3}return(0,c.Z)(e,[{key:"play",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;this.playing||(this.playing=!0,this.audio.src=so[e],this.audio.volume=.3,null===(t=this.audio.play())||void 0===t||t.catch((function(t){oo.error("[dyte-notifications] play() failed\n",{sound:e,duration:r},t)})),setTimeout((function(){n.playing=!1}),r))}},{key:"setDevice",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var n,r,i;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(i=null===(r=null===(n=this.audio)||void 0===n?void 0:n.setSinkId)||void 0===r?void 0:r.call(n,t))||void 0===i?void 0:i.catch((function(e){oo.error("[dyte-notifications] setSinkId() error\n",e)}));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),uo=2e3,lo=Object.freeze({notifications:{participant_joined:!0,participant_left:!0,participant_joined_waitlist:!0,chat:!0,polls:!0,webinar:!0,tab_sync:!0},notification_sounds:{participant_joined:!0,participant_left:!0,chat:!0,polls:!0,webinar:!0,participant_joined_waitlist:!0},notification_duration:{participant_joined:2100,participant_left:2100,participant_joined_waitlist:4e3,chat:uo,polls:uo,webinar:uo,tab_sync:uo},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10});function po(e){return Object.keys(e).filter((function(t){return e[t]}))}var ho=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.permissions=lo,this.enabledSounds=po(lo.notification_sounds),this.addStagePeersListeners=function(e){e.participants.joined.addListener("participantJoined",n.participantJoinedListener),e.meta.addListener("disconnected",n.networkDisconnectedListener),e.meta.addListener("connected",n.networkConnectedListener),e.participants.joined.addListener("participantLeft",n.participantLeftListener)},this.removeStagePeersListeners=function(e){e.participants.joined.removeListener("participantJoined",n.participantJoinedListener),e.meta.removeListener("disconnected",n.networkDisconnectedListener),e.meta.removeListener("connected",n.networkConnectedListener),e.participants.joined.removeListener("participantLeft",n.participantLeftListener)},this.onRemoteUpdate=function(e){var t=e.payload,r=e.type;if(r===io.INCOMING_REQUEST_ACCEPTED){var i=n.meeting.participants.joined.get(t.request.remotePeerId);n.add({id:"message-".concat(Math.random().toString(36)),icon:n.iconPack.chat,message:"Granted remote control to ".concat(i.name),duration:uo})}if(r===io.OUTGOING_REQUEST_ACCEPTED){var a=n.meeting.participants.joined.get(t.request.hostPeerId);n.add({id:"message-".concat(Math.random().toString(36)),icon:n.iconPack.chat,message:"".concat(a.name," has granted remote control."),duration:uo})}if(r===io.REQUEST_RECEIVED){var o=n.meeting.participants.joined.get(t.request.remotePeerId);n.add({id:"message-".concat(Math.random().toString(36)),icon:n.iconPack.chat,message:"".concat(o.name," has requested for remote control."),duration:uo})}if(r!==io.INCOMING_REQUEST_ENDED&&r!==io.OUTGOING_REQUEST_ENDED||n.add({id:"message-".concat(Math.random().toString(36)),icon:n.iconPack.chat,message:"Existing remote control has been terminated.",duration:uo}),r===io.REQUEST_SENT){var s=n.meeting.participants.joined.get(t.request.hostPeerId);n.add({id:"message-".concat(Math.random().toString(36)),icon:n.iconPack.chat,message:"Sent remote control request to ".concat(s.name),duration:uo})}},this.onDyteNotification=function(e){n.add(e.detail);var t=e.detail.playSound;void 0!=t&&n.audio.play(t)},this.onRecordingUpdate=function(e){"RECORDING"===e?n.add({id:"recording-started",icon:n.iconPack.recording,message:n.t("recording.started"),duration:uo}):"STOPPING"===e&&n.add({id:"recording-stopped",icon:n.iconPack.stop_recording,message:n.t("recording.stopped"),duration:uo})},this.meeting=void 0,this.states=void 0,this.config=Ue,this.t=ir(),this.size=void 0,this.iconPack=ar,this.notifications=[]}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){"undefined"!==typeof document&&(null===document||void 0===document||document.addEventListener("dyteNotification",this.onDyteNotification)),this.meetingChanged(this.meeting),this.configChanged(this.config),this.statesChanged(this.states)}},{key:"clearListeners",value:function(e){var t,n,r,i,a,o,s,c,u,l="LIVESTREAM"===e.meta.viewType;(l&&"ON_STAGE"===(null===(t=e.stage)||void 0===t?void 0:t.status)||!l)&&this.removeStagePeersListeners(e),this.chatUpdateListener&&(null===(n=e.chat)||void 0===n||n.removeListener("chatUpdate",this.chatUpdateListener)),this.pollUpdateListener&&(null===(r=e.polls)||void 0===r||r.removeListener("pollsUpdate",this.pollUpdateListener)),this.socketDisconnectedListener&&e.meta.removeListener("socketDisconnected",this.socketDisconnectedListener),this.socketReconnectFailureListener&&e.meta.removeListener("socketReconnectFailure",this.socketReconnectFailureListener),this.socketReconnectedListener&&e.meta.removeListener("socketReconnected",this.socketReconnectedListener),this.socketReconnectingListener&&e.meta.removeListener("socketReconnecting",this.socketReconnectingListener),this.socketFailureListener&&e.meta.removeListener("socketFailure",this.socketFailureListener),this.stageRequestAccepted&&(null===(i=e.stage)||void 0===i||i.removeListener("stageRequestApproved",this.stageRequestAccepted)),this.stageRequestRejected&&(null===(a=e.stage)||void 0===a||a.removeListener("stageRequestRejected",this.stageRequestRejected)),this.newStageRequests&&(null===(o=e.stage)||void 0===o||o.removeListener("newStageRequest",this.newStageRequests)),this.stageStatusUpdateListener&&(null===(s=e.stage)||void 0===s||s.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)),null===(c=e.remote)||void 0===c||c.removeListener("remoteUpdate",this.onRemoteUpdate),null===(u=e.recording)||void 0===u||u.removeListener("recordingUpdate",this.onRecordingUpdate),clearTimeout(this.disconnectTimeout)}},{key:"disconnectedCallback",value:function(){var e;"undefined"!==typeof document&&(null===document||void 0===document||document.removeEventListener("dyteNotification",this.onDyteNotification)),null!=this.meeting&&(this.clearListeners(this.meeting),this.waitlistedParticipantJoinedListener&&this.meeting.participants.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.spotlightTabUpdateListener&&(null===(e=this.meeting.spotlight)||void 0===e||e.removeListener("activeTabUpdate",this.spotlightTabUpdateListener)),this.peerRequestToJoinStateListener&&this.meeting.participants.joined.removeListener("peerRequestToJoinStage",this.peerRequestToJoinStateListener),this.peerAcceptedToJoinStageListener&&this.meeting.participants.joined.removeListener("peerAcceptedToJoinStage",this.peerAcceptedToJoinStageListener),this.peerRejectedToJoinStageListener&&this.meeting.participants.joined.removeListener("peerRejectedToJoinStage",this.peerRejectedToJoinStageListener))}},{key:"meetingChanged",value:function(e,t){var n,r,i,a,o,s,c,u,l,d=this;if(clearTimeout(this.disconnectTimeout),void 0!==t&&this.clearListeners(t),null!=e){var p="LIVESTREAM"===e.meta.viewType;this.audio=new co;var v=this.permissions,m=v.notifications,g=v.notification_duration,y=v.notification_sounds;this.participantJoinedListener=function(e){m.participant_joined&&d.add({id:"".concat(e.id,"-joined"),message:"".concat(Ra(e.name)," just joined"),image:e.picture,duration:g.participant_joined}),y.participant_joined&&d.canPlayParticipantJoinedSound()&&d.audio.play("joined")},this.participantLeftListener=function(e){m.participant_left&&d.add({id:"".concat(e.id,"-left"),message:"".concat(Ra(e.name)," left"),image:e.picture,duration:g.participant_left}),y.participant_left&&d.canPlayParticipantJoinedSound()&&d.audio.play("left")},this.waitlistedParticipantJoinedListener=function(e){var t="".concat(e.id,"-joined-waitlist");d.add({id:t,message:"".concat(Ra(e.name)," is requesting to join the meeting"),image:e.picture,duration:g.participant_joined_waitlist,button:{text:"Accept",variant:"secondary",onClick:function(){var n=(0,f.Z)((0,h.Z)().mark((function n(){return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.meeting.participants.acceptWaitingRoomRequest
2(e.id);case 2:d.remove(t);case 3:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}()}}),y.participant_joined_waitlist&&d.canPlayParticipantJoinedSound()&&d.audio.play("message")},this.chatUpdateListener=function(t){var n=t.message,r=Di(n);if(null!=r){if(r.userId===e.self.userId)return;"text"===r.type&&(m.chat&&d.add({id:"message-".concat(Math.random().toString(36)),icon:d.iconPack.chat,message:"".concat(r.displayName,": ").concat(Pa(r.message,20)),duration:g.chat}),y.chat&&d.canPlayChatSound()&&d.audio.play("message"))}},this.pollUpdateListener=function(e){var t=e.polls;!1!==e.newPoll&&(m.polls&&d.meeting.self.userId!==t[t.length-1].createdByUserId&&d.add({id:"poll-".concat(Math.random().toString(36)),icon:d.iconPack.poll,message:"New poll created by ".concat(t[t.length-1].createdBy),duration:g.polls}),y.polls&&d.meeting.self.userId!==t[t.length-1].createdByUserId&&d.canPlayChatSound()&&d.audio.play("message"))},this.deviceUpdateListener=function(e){var t=e.device;e.preview||("audiooutput"===t.kind?(d.audio.setDevice(t.deviceId),d.add({id:"speaker-switched-".concat(t.deviceId),message:"Connected to ".concat(t.label),icon:d.iconPack.speaker,duration:5e3})):"videoinput"===t.kind?d.add({id:"camera-switched-".concat(t.deviceId),message:"Connected to ".concat(t.label),icon:d.iconPack.speaker,duration:5e3}):d.add({id:"mic-switched-".concat(t.deviceId),message:"Connected to ".concat(t.label),icon:d.iconPack.mic_on,duration:5e3}))},this.networkDisconnectedListener=function(){d.remove("network"),d.add({id:"network",icon:d.iconPack.disconnected,message:d.t("Connection lost. Trying to reconnect..."),duration:2e4}),d.disconnectTimeout=setTimeout((function(){d.add({id:"network-lost",icon:d.iconPack.disconnected,message:d.t("Taking too long to reconnect..."),button:{text:d.t("End Meeting"),variant:"danger",onClick:function(){var e;return null===(e=d.meeting)||void 0===e?void 0:e.leaveRoom()}}})}),2e4)},this.networkConnectedListener=function(){d.remove("network"),d.remove("network-lost"),d.add({id:"network",icon:d.iconPack.wifi,message:d.t("Connection restored"),duration:3e3}),clearTimeout(d.disconnectTimeout)},this.socketUpdateListener=function(e){var t=e.event,n=e.attempt;d.remove("socket"),"reconnected"===t?(d.remove("socketReconnecting"),d.add({id:"socket",icon:d.iconPack.wifi,message:d.t("Connection restored"),duration:3e3})):"disconnected"===t?d.add({id:"socket",icon:d.iconPack.disconnected,message:d.t("Connection lost"),duration:3e3}):"reconnecting"===t?d.add({id:"socketReconnecting",icon:d.iconPack.disconnected,message:d.t("Connection lost. Please check your network connection.")}):"reconnectFailure"===t?n>5&&(d.remove("socketReconnecting"),d.add({id:"socketReconnecting",icon:d.iconPack.disconnected,message:d.t("Taking too long to reconnect. Please check your network connection."),button:{text:d.t("End Meeting"),variant:"danger",onClick:function(){var e;return null===(e=d.meeting)||void 0===e?void 0:e.leaveRoom()}}})):"failed"===t&&(d.remove("socketReconnecting"),d.add({id:"socketFailed",icon:d.iconPack.disconnected,message:d.t("Could not reconnect. Please leave the meeting and try refreshing the window.")}),d.add({id:"leaveMeeting",icon:d.iconPack.warning,message:d.t("Automatically leaving the meeting in 10 seconds.")}),setTimeout((function(){var e;null===(e=d.meeting)||void 0===e||e.leaveRoom("disconnected")}),1e4))},this.spotlightTabUpdateListener=function(t){if(m.tab_sync)switch(t.type){case"plugin":var n=e.plugins.active.toArray().find((function(e){return e.id==t.id}));void 0!=n&&d.add({id:"spotlight",message:"Plugin switched to ".concat(n.name),duration:g.participant_joined});break;case"screenshare":var r=e.participants.joined.toArray().filter((function(e){return e.screenShareEnabled})).find((function(e){return e.id==t.id}));void 0!=r&&d.add({id:"spotlight",message:"Now watching ".concat(r.name,"'s screen"),duration:g.webinar})}},this.peerRequestToJoinStateListener=function(e){var t=e.id;if(m.webinar){var n=d.meeting.participants.joined.get(t);void 0!==n&&(d.add({id:"webinar-request-".concat(t),message:"".concat(n.name," is requesting to be on stage"),duration:g.webinar,button:{text:"Accept",variant:"primary",onClick:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.meeting.participants.acceptAllRequestToJoinStageRequests([{id:t,requestToJoinType:"REQUEST_TO_PRESENT"}]);case 2:d.remove("webinar-request-".concat(t));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}),y.webinar&&d.audio.play("joined"))}},this.peerAcceptedToJoinStageListener=function(e){if(m.webinar){var t=d.meeting.participants.joined.get(e.id);void 0!==t&&(d.add({id:"webinar-accepted-".concat(e.id),message:"Approved ".concat(t.name,"'s request to join stage."),duration:g.webinar}),y.webinar&&d.audio.play("joined"))}},this.peerRejectedToJoinStageListener=function(e){if(m.webinar){var t=d.meeting.participants.joined.get(e.id);void 0!==t&&d.add({id:"webinar-rejected-".concat(e.id),message:"Rejected ".concat(t.name,"'s request to join stage."),duration:g.webinar})}},this.stageRequestAccepted=function(){d.add({id:"stage-request-accepted",message:"Request to join accepted",duration:3e3})},this.stageRequestRejected=function(){d.add({id:"stage-request-rejected",message:"Request to join rejected",duration:3e3})},this.newStageRequests=function(e){var t=e.count;d.add({id:"new-stage-request",message:"You have ".concat(t," pending request").concat(1===t?"":"s"),duration:3e3})},this.stageStatusUpdateListener=function(t){"ON_STAGE"===t?d.addStagePeersListeners(e):d.removeStagePeersListeners(e)},this.socketReconnectedListener=function(){return d.socketUpdateListener({event:"reconnected"})},this.socketDisconnectedListener=function(){return d.socketUpdateListener({event:"disconnected"})},this.socketReconnectingListener=function(){return d.socketUpdateListener({event:"reconnecting"})},this.socketFailureListener=function(){return d.socketUpdateListener({event:"failed"})},this.socketReconnectFailureListener=function(e){var t=e.attempt;return d.socketUpdateListener({event:"reconnectFailure",attempt:t})};var b=e.self.getCurrentDevices();null!=b.speaker&&this.audio.setDevice(b.speaker.deviceId),p?null===(n=e.stage)||void 0===n||n.on("stageStatusUpdate",this.stageStatusUpdateListener):this.addStagePeersListeners(e),e.participants.joined.addListener("peerRequestToJoinStage",this.peerRequestToJoinStateListener),e.participants.joined.addListener("peerAcceptedToJoinStage",this.peerAcceptedToJoinStageListener),e.participants.joined.addListener("peerRejectedToJoinStage",this.peerRejectedToJoinStageListener),this.canAcceptWaitingRequests()&&e.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),!Ri(e)&&(null===(r=e.chat)||void 0===r||r.addListener("chatUpdate",this.chatUpdateListener)),null===(i=e.polls)||void 0===i||i.addListener("pollsUpdate",this.pollUpdateListener),e.self.addListener("deviceUpdate",this.deviceUpdateListener),e.meta.addListener("socketReconnected",this.socketReconnectedListener),e.meta.addListener("socketDisconnected",this.socketDisconnectedListener),e.meta.addListener("socketReconnecting",this.socketReconnectingListener),e.meta.addListener("socketFailure",this.socketFailureListener),e.meta.addListener("socketReconnectFailure",this.socketReconnectFailureListener),null===(a=e.remote)||void 0===a||a.addListener("remoteUpdate",this.onRemoteUpdate),null===(o=e.spotlight)||void 0===o||o.addListener("activeTabUpdate",this.spotlightTabUpdateListener),null===(s=e.recording)||void 0===s||s.addListener("recordingUpdate",this.onRecordingUpdate),null===(c=e.stage)||void 0===c||c.addListener("stageRequestApproved",this.stageRequestAccepted),null===(u=e.stage)||void 0===u||u.addListener("stageRequestRejected",this.stageRequestRejected),e.self.permissions.acceptPresentRequests&&(null===(l=e.stage)||void 0===l||l.addListener("newStageRequest",this.newStageRequests))}}},{key:"configChanged",value:function(e){null!=e&&null!=(null===e||void 0===e?void 0:e.config)&&(this.permissions=function(e){var t=Object.assign({},lo);return null==e||(Object.assign(t.notification_sounds,e.notification_sounds),Object.assign(t.notifications,e.notifications),Object.assign(t.notification_duration,e.notification_duration),t.participant_chat_message_sound_notification_limit=e.participant_chat_message_sound_notification_limit,t.participant_joined_sound_notification_limit=e.participant_joined_sound_notification_limit),t}(e.config),this.enabledSounds=po(this.permissions.notification_sounds))}},{key:"statesChanged",value:function(e){var t;if(null!=e){var n,r=!(null===(t=null===e||void 0===e?void 0:e.prefs)||void 0===t?void 0:t.muteNotificationSounds),i=(0,o.Z)(this.enabledSounds);try{for(i.s();!(n=i.n()).done;){var a=n.value;a in this.permissions.notification_sounds&&(this.permissions.notification_sounds[a]=r)}}catch(s){i.e(s)}finally{i.f()}}}},{key:"apiErrorListener",value:function(e){var t=e.detail,n=t.trace,r=t.message;this.add({id:n,message:r,duration:uo,icon:this.iconPack.warning})}},{key:"add",value:function(e){"visible"===document.visibilityState&&this.notifications.length<5&&(this.notifications=[].concat((0,m.Z)(this.notifications),[e]))}},{key:"remove",value:function(e){this.notifications=this.notifications.filter((function(t){return t.id!==e}))}},{key:"handleDismiss",value:function(e){var t=this;e.stopPropagation();var n=e.detail,r=this.host.shadowRoot.querySelector('[data-id="'.concat(n,'"]'));null===r||void 0===r||r.classList.add("exit"),setTimeout((function(){je((function(){t.remove(n)}))}),400)}},{key:"canPlayParticipantJoinedSound",value:function(){return void 0==this.permissions.participant_joined_sound_notification_limit||this.permissions.participant_joined_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_joined_sound_notification_limit}},{key:"canPlayChatSound",value:function(){return void 0==this.permissions.participant_chat_message_sound_notification_limit||this.permissions.participant_chat_message_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_chat_message_sound_notification_limit}},{key:"canAcceptWaitingRequests",value:function(){return this.permissions.notifications.participant_joined_waitlist&&this.meeting.self.permissions.acceptWaitingRequests}},{key:"render",value:function(){var e=this;return T(C,null,this.notifications.map((function(t){return T("dyte-notification",{size:e.size,key:t.
2id,"data-id":t.id,notification:t,onDyteNotificationDismiss:function(t){return e.handleDismiss(t)},iconPack:e.iconPack,t:e.t})})))}},{key:"host",get:function(){return A(this)}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],config:["configChanged"],states:["statesChanged"]}}}]),e}();ho.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:absolute;top:var(--dyte-space-4, 16px);right:var(--dyte-space-4, 16px);bottom:var(--dyte-space-4, 16px);left:var(--dyte-space-4, 16px);top:auto;display:flex;flex-direction:column;pointer-events:none;z-index:100}dyte-notification{margin-top:var(--dyte-space-2, 8px)}";var fo=Object.freeze({__proto__:null,dyte_notifications:ho}),vo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.disconnectMeeting=function(e){null!=e&&null!=n.countListener&&(e.participants.joined.removeListener("participantJoined",n.countListener),e.participants.joined.removeListener("participantLeft",n.countListener))},this.meeting=void 0,this.iconPack=ar,this.t=ir(),this.participantCount=0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){this.disconnectMeeting(this.meeting)}},{key:"meetingChanged",value:function(e,t){var n=this;this.disconnectMeeting(t),null!=e&&(this.countListener=function(){n.participantCount=e.participants.joined.size+(e.self.roomJoined?1:0)},this.countListener(),e.participants.joined.addListener("participantJoined",this.countListener),e.participants.joined.addListener("participantLeft",this.countListener))}},{key:"render",value:function(){return qr(this.meeting)?null:T(C,{tabIndex:0,role:"log","aria-label":"".concat(this.participantCount," ").concat(this.t("participants"))},T("dyte-icon",{icon:this.iconPack.people,tabIndex:-1,"aria-hidden":!0,part:"icon",iconPack:this.iconPack,t:this.t}),this.participantCount)}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();vo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:inline-flex;height:var(--dyte-space-10, 40px);-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center}:host([size='sm']){margin-left:var(--dyte-space-1, 4px);margin-right:var(--dyte-space-1, 4px);font-size:12px}dyte-icon{margin-right:var(--dyte-space-1, 4px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}:host([size='sm']) dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}";var mo=Object.freeze({__proto__:null,dyte_participant_count:vo}),go=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onVideoUpdate=function(e){n.videoState=e},this.onPinned=function(e){var t=e.isPinned;n.isPinned=t},this.videoState=void 0,this.isPinned=!1,this.nameTagPosition="bottom-left",this.isPreview=!1,this.participant=void 0,this.states=void 0,this.config=Ue,this.variant="solid",this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.participantsChanged(this.participant)}},{key:"componentDidLoad",value:function(){this.videoStateChanged(this.videoState)}},{key:"disconnectedCallback",value:function(){null!=this.participant&&(this.participant.removeListener("videoUpdate",this.onVideoUpdate),this.participant.removeListener("pinned",this.onPinned),this.participant.removeListener("unpinned",this.onPinned))}},{key:"participantsChanged",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!=t&&(this.videoState={videoEnabled:t.videoEnabled,videoTrack:t.videoTrack},this.isPinned=t.isPinned,t.addListener("videoUpdate",this.onVideoUpdate),t.addListener("pinned",this.onPinned),t.addListener("unpinned",this.onPinned));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"videoStateChanged",value:function(e){if(null!=e&&null!=this.videoEl)if(e.videoEnabled){var t=new MediaStream;t.addTrack(e.videoTrack),this.videoEl.srcObject=t}else this.videoEl.srcObject=void 0}},{key:"isMirrored",value:function(){var e;if(null!=this.participant&&("preview"in this.participant||this.isPreview)){var t=this.states||br,n=null===(e=null===t||void 0===t?void 0:t.prefs)||void 0===e?void 0:e.mirrorVideo;if("boolean"===typeof n)return n}return!1}},{key:"render",value:function(){var e,t,n,r,i=this;return T(C,null,T("video",{ref:function(e){return i.videoEl=e},class:(0,a.Z)({visible:null===(e=this.videoState)||void 0===e?void 0:e.videoEnabled,mirror:this.isMirrored()},null!==(r=null===(n=null===(t=this.config)||void 0===t?void 0:t.config)||void 0===n?void 0:n.videoFit)&&void 0!==r?r:"cover",!0),autoPlay:!0,playsInl
2ine:!0,muted:!0}),this.isPinned&&T("dyte-icon",{class:"pinned-icon",icon:this.iconPack.pin,"aria-label":this.t("Pinned"),iconPack:this.iconPack,t:this.t}),T("slot",null))}}],[{key:"watchers",get:function(){return{participant:["participantsChanged"],videoState:["videoStateChanged"]}}}]),e}();go.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:16 / 9;height:var(--dyte-space-56, 224px);overflow:hidden;border-radius:var(--dyte-border-radius-lg, 12px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));transition-property:var(--dyte-transition-property, all);transition-duration:150ms}@media (prefers-reduced-motion){:host{--dyte-transition-property:none}}:host([size='sm'][variant='solid']) ::slotted(dyte-name-tag){left:var(--dyte-space-2, 8px);bottom:var(--dyte-space-2, 8px);height:var(--dyte-space-4, 16px)}video{display:none;position:absolute;height:100%;width:100%;border-radius:var(--dyte-border-radius-lg, 12px)}video.contain{-o-object-fit:contain;object-fit:contain}video.cover{-o-object-fit:cover;object-fit:cover}video.visible{display:block}video::-webkit-media-controls{display:none !important}:host([variant='gradient']) ::slotted(dyte-audio-visualizer){position:absolute;top:var(--dyte-space-2, 8px);right:var(--dyte-space-2, 8px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));padding:var(--dyte-space-2, 8px)}:host([variant='gradient']) ::slotted(dyte-name-tag){bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);display:flex;width:100%;align-items:center;justify-content:center;text-align:center;background-color:transparent;background-image:linear-gradient(to top, var(--tw-gradient-stops));--tw-gradient-from:rgb(var(--dyte-colors-background-1000, 8 8 8));--tw-gradient-to:rgba(var(--dyte-colors-background-1000, 8 8 8) / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:transparent}video.mirror{transform:scaleX(-1)}@media (orientation: portrait){:host{height:var(--dyte-space-44, 176px)}}";var yo=Object.freeze({__proto__:null,dyte_participant_setup:go}),bo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onSearchInput=function(e){n.search=e.target.value},this.meeting=void 0,this.states=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.t=ir(),this.search=""}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){this.meeting}},{key:"meetingChanged",value:function(e){}},{key:"render",value:function(){var e={meeting:this.meeting,states:this.states||br,config:this.config,size:this.size,iconPack:this.iconPack,t:this.t};return T(C,null,T("div",{class:"search",part:"search"},T("dyte-icon",{icon:this.iconPack.search,part:"search-icon",iconPack:this.iconPack,t:this.t}),T("input",{type:"search",autocomplete:"off",placeholder:"Search",onInput:this.onSearchInput,part:"search-input"})),T("div",{class:"ctr scrollbar",part:"container"},T(sr,{element:"dyte-participants-waiting-list",defaults:e}),T(sr,{element:"dyte-participants-stage-queue",defaults:e}),T(sr,{element:"dyte-participants-stage-list",defaults:e,props:{search:this.search}}),T(sr,{element:"dyte-participants-viewer-list",defaults:e,props:{search:this.search}})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();bo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{display:flex;height:100%;width:100%;flex-direction:column;font-size:14px}*{box-sizing:border-box}.ctr{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);box-sizing:border-box;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);padding-top:var(--dyte-space-0, 0px);padding-bottom:var(--dyte-space-0, 0px);overflow-y:auto;flex-grow:1;flex-basis:0}.search{position:-webkit-sticky;position:sticky;box-sizing:border-box;display:flex;align-items:center;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));margin-left:var(--dyte-space-3, 12px);margin-right:var(--dyte-space-3, 12px);margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-0, 0px)}.search dyte-icon{margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}.search input{box-sizing:border-box;height:var(--dyte-space-9, 36px);width:100%;padding-right:var(--dyte-space-2, 8px);border-width:var(--dyte-border-width-none, 0);border-style:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));outline:2px solid transparent;outline-offset:2px;border-radius:var(--dyte-border-radius-sm, 4px);font-size:14px}.search input::-moz-placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.search input::placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}:host([size='md']) .search{margin-top:var(--dyte-space-4, 16px) !important;margin-bottom:var(--dyte-space-4, 16px) !important}:host([size='sm']) .search{margin-top:var(--dyte-space-4, 16px) !important;margin-bottom:var(--dyte-space-4, 16px) !important}";var ko=Object.freeze({__proto__:null,dyte_participants:bo}),_o=function(){function e(){(0,s.Z)(this,e),this.audio=document.createElement("audio"),this.audio.autoplay=!0,this.audioStream=new MediaStream,this.audio.srcObject=this.audioStream,this.audioTracks=[]}return(0,c.Z)(e,[{key:"addTrack",value:function(e,t){this.audioTracks.some((function(t){return t.id===e}))||(this.audioTracks.push({id:e,track:t}),this.audioStream.addTrack(t),this.play())}},{key:"removeTrack",value:function(e){var t=this.audioTracks.find((function(t){return t.id===e}));null!=t&&(this.audioStream.removeTrack(t.track),this.audioTracks=this.audioTracks.filter((function(t){return t.id!==e})))}},{key:"play",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){var t,n=this;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.audio.srcObject=this.audioStream,e.next=3,null===(t=this.audio.play())||void 0===t?void 0:t.catch((function(e){"NotAllowedError"===e.name?null!=n._onError&&n._onError():"AbortError"!==e.name&&oo.error("[dyte-audio] play() error\n",e)}));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setDevice",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var n,r,i;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(i=null===(r=(n=this.audio).setSinkId)||void 0===r?void 0:r.call(n,t))||void 0===i?void 0:i.catch((function(e){oo.error("[dyte-audio] setSinkId() error\n",e)}));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onError",value:function(e){this._onError=e}}]),e}(),wo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.dialogClose=I(this,"dialogClose",7),this.onDyteDialogClose=function(){n.showPlayDialog=!1,n.dialogClose.emit()},this.meeting=void 0,this.iconPack=ar,this.t=ir(),this.showPlayDialog=!1}
2return(0,c.Z)(e,[{key:"componentDidLoad",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e;null!=this.meeting&&(this.audioUpdateListener&&this.meeting.participants.joined.removeListener("audioUpdate",this.audioUpdateListener),this.screenShareUpdateListener&&this.meeting.participants.joined.removeListener("screenShareUpdate",this.screenShareUpdateListener),this.participantLeftListener&&this.meeting.participants.joined.removeListener("participantLeft",this.participantLeftListener),this.deviceUpdateListener&&this.meeting.self.removeListener("deviceUpdate",this.deviceUpdateListener),this.stageStatusUpdateListener&&(null===(e=this.meeting.stage)||void 0===e||e.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)))}},{key:"handleAudioError",value:function(){var e=this;this.audio=new _o,this.audio.onError((function(){e.showPlayDialog=!0})),this.audio.play()}},{key:"meetingChanged",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var n,r,i,a,s,c,u=this;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t){e.next=17;break}if("LIVESTREAM"===t.meta.viewType&&"ON_STAGE"!==t.stage.status?(this.stageStatusUpdateListener=function(e){"ON_STAGE"===e&&u.handleAudioError()},null===(n=t.stage)||void 0===n||n.on("stageStatusUpdate",this.stageStatusUpdateListener)):this.handleAudioError(),null==(r=t.self.getCurrentDevices()).speaker){e.next=6;break}return e.next=6,this.audio.setDevice(r.speaker.deviceId);case 6:this.audioUpdateListener=function(e){var t=e.id,n=e.audioEnabled,r=e.audioTrack,i="audio-".concat(t);n&&null!=r?u.audio.addTrack(i,r):u.audio.removeTrack(i)},i=t.participants.joined.toArray(),a=(0,o.Z)(i);try{for(a.s();!(s=a.n()).done;)c=s.value,this.audioUpdateListener(c)}catch(l){a.e(l)}finally{a.f()}this.participantLeftListener=function(e){var t=e.id;u.audio.removeTrack("audio-".concat(t)),u.audio.removeTrack("screenshare-".concat(t))},this.screenShareUpdateListener=function(e){var t=e.id,n=e.screenShareEnabled,r=e.screenShareTracks,i="screenshare-".concat(t);n&&null!=r.audio?u.audio.addTrack(i,r.audio):u.audio.removeTrack(i)},this.deviceUpdateListener=function(e){var t=e.device;e.preview||"audiooutput"===t.kind&&u.audio.setDevice(t.deviceId)},t.participants.joined.addListener("audioUpdate",this.audioUpdateListener),t.participants.joined.addListener("screenShareUpdate",this.screenShareUpdateListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener),t.self.addListener("deviceUpdate",this.deviceUpdateListener);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return T(C,null,this.showPlayDialog&&T("dyte-dialog",{open:!0,onDyteDialogClose:this.onDyteDialogClose,hideCloseButton:!0,iconPack:this.iconPack,t:this.t},T("div",{class:"modal"},T("h3",null,this.t("audio_playback.title")),T("p",null,this.t("audio_playback.description")),T("dyte-button",{kind:"wide",onClick:function(){e.audio.play(),e.onDyteDialogClose()},title:this.t("audio_playback"),iconPack:this.iconPack,t:this.t},this.t("audio_playback")))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();wo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.modal{box-sizing:border-box;width:100%;max-width:var(--dyte-space-96, 384px);padding:var(--dyte-space-4, 16px);border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.modal h3{margin:var(--dyte-space-0, 0px);padding:var(--dyte-space-0, 0px);font-size:24px;font-weight:500}.modal p{margin-top:var(--dyte-space-4, 16px);margin-bottom:var(--dyte-space-6, 24px)}.modal dyte-button{width:100%}";var xo=Object.freeze({__proto__:null,dyte_participants_audio:wo}),So=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.updateParticipants=function(){n.getParticipants(n.search)},this.shouldShowStageList=function(){var e,t,r;"LIVESTREAM"===(null===(e=n.meeting)||void 0===e?void 0:e.meta.viewT
2ype)?n.showStageList="ON_STAGE"===(null===(r=null===(t=n.meeting)||void 0===t?void 0:t.stage)||void 0===r?void 0:r.status):n.showStageList=!0},this.meeting=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.view="sidebar",this.t=ir(),this.search="",this.participants=[],this.showStageList=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting),this.searchChanged(this.search)}},{key:"disconnectedCallback",value:function(){var e,t,n=this.meeting,r=n.participants,i=n.self;null!=this.meeting&&(this.participantJoinedListener&&this.meeting.participants.joined.removeListener("participantJoined",this.participantJoinedListener),this.participantLeftListener&&this.meeting.participants.joined.removeListener("participantLeft",this.participantLeftListener),r.joined.removeListener("peerStartedPresenting",this.updateParticipants),r.joined.removeListener("peerStoppedPresenting",this.updateParticipants),i.removeListener("stageJoined",this.updateParticipants),i.removeListener("stageLeft",this.updateParticipants),i.removeListener("removedFromStage",this.updateParticipants),null===(t=null===(e=this.meeting)||void 0===e?void 0:e.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.shouldShowStageList))}},{key:"meetingChanged",value:function(e){var t,n=this;null!=e&&(this.participantJoinedListener=function(e){if("WEBINAR"!==n.meeting.meta.viewType||"ON_STAGE"===e.webinarStageStatus){var t=n.search.toLowerCase();e.name.toLowerCase().includes(t)&&e.id.toLowerCase().includes(t)&&(n.participants=[].concat((0,m.Z)(n.participants.filter((function(t){return t.id!==e.id}))),[e]))}},this.participantLeftListener=function(e){n.participants=n.participants.filter((function(t){return t.id!==e.id}))},e.participants.joined.addListener("participantJoined",this.participantJoinedListener),e.participants.joined.addListener("participantLeft",this.participantLeftListener),e.participants.joined.addListener("peerStartedPresenting",this.updateParticipants),e.participants.joined.addListener("peerStoppedPresenting",this.updateParticipants),e.self.addListener("stageJoined",this.updateParticipants),e.self.addListener("stageLeft",this.updateParticipants),e.self.addListener("removedFromStage",this.updateParticipants),this.shouldShowStageList(),null===(t=null===e||void 0===e?void 0:e.stage)||void 0===t||t.on("stageStatusUpdate",this.shouldShowStageList))}},{key:"searchChanged",value:function(e){this.getParticipants(e)}},{key:"getParticipants",value:function(e){var t=[this.meeting.self].concat((0,m.Z)(this.meeting.participants.joined.toArray()));"WEBINAR"===this.meeting.meta.viewType&&(t=t.filter((function(e){return"ON_STAGE"===e.webinarStageStatus}))),this.participants=""===e?t:t.filter((function(t){var n;return(null!==(n=t.name)&&void 0!==n?n:t.id).toLowerCase().includes(e.toLowerCase())}))}},{key:"render",value:function(){var e=this;if(this.showStageList)return T(C,null,T("div",{class:"participants-container"},T("div",{class:"heading-count",part:"heading-count"},this.t("participants")," (",this.participants.length,")"),T("ul",{class:"participants",part:"participants"},this.participants.map((function(t){return T("dyte-participant",{role:"listitem",key:t.id,meeting:e.meeting,participant:t,view:e.view,t:e.t,iconPack:e.iconPack})})),0===this.participants.length&&T("div",{class:"empty-message",part:"empty-message"},this.search.length>0?this.t("Couldn't find a participant with the specified name or ID."):this.t("It looks like nobody is here.")))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],search:["searchChanged"]}}}]),e}();So.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;width:100%;flex-direction:column;font-size:14px}.participants-container{margin-bottom:var(--dyte-space-4, 16px);width:100%}h3,.heading-count{margin:var(--dyte-space-0, 0px);display:flex;align-items:center;justify-content:center;padding:var(--dyte-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-0, 0px);padding:var(--dyte-space-0, 0px)}.empty-message{margin-top:var(--dyte-space-4, 16px);margin-bottom:var(--dyte-space-4, 16px);text-align:center;font-size:12px;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}dyte-participant{width:100%}";var Eo=Object.freeze({__proto__:null,dyte_participants_stage_list:So}),To=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.peerPresentingUpdateListener=function(){n.stageRequestedParticipants=[n.meeting.self].concat((0,m.Z)(n.meeting.participants.joined.toArray())).filter((function(e){return"REQUESTED_TO_JOIN_STAGE"===e.webinarStageStatus}))},this.updateStageRequestedParticipants=function(){n.stageRequestedParticipants=n.meeting.participants.joined.toArray().filter((function(e){return"REQUESTED_TO_JOIN_STAGE"===e.webinarStageStatus}))},this.acceptStageRequest=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var r,i,a;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("WEBINAR"!==n.meeting.meta.viewT
2ype){e.next=9;break}if(r=t.id,void 0===(i=n.meeting.participants.joined.get(r))){e.next=6;break}return e.next=6,i.acceptJoinStageRequest();case 6:n.updateStageRequestedParticipants(),e.next=13;break;case 9:if("LIVESTREAM"!==n.meeting.meta.viewType){e.next=13;break}return a=t.userId,e.next=13,n.meeting.stage.grantAccess([a]);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.rejectStageRequest=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var r,i,a;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("WEBINAR"!==n.meeting.meta.viewType){e.next=9;break}if(r=t.id,void 0===(i=n.meeting.participants.joined.get(r))){e.next=6;break}return e.next=6,i.rejectRequestToJoinStage();case 6:n.updateStageRequestedParticipants(),e.next=13;break;case 9:if("LIVESTREAM"!==n.meeting.meta.viewType){e.next=13;break}return a=t.userId,e.next=13,n.meeting.stage.denyAccess([a]);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.acceptAllStageRequest=(0,f.Z)((0,h.Z)().mark((function e(){var t;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("WEBINAR"!==n.meeting.meta.viewType){e.next=7;break}return t=n.meeting.participants.joined.toArray().filter((function(e){return"REQUESTED_TO_JOIN_STAGE"===e.webinarStageStatus})).map((function(e){return{id:e.id,requestToJoinType:"REQUEST_TO_PRESENT"}})),e.next=4,n.meeting.participants.acceptAllRequestToJoinStageRequests(t);case 4:n.updateStageRequestedParticipants(),e.next=10;break;case 7:if("LIVESTREAM"!==n.meeting.meta.viewType){e.next=10;break}return e.next=10,n.meeting.stage.grantAccess(n.stageRequestedParticipants.map((function(e){return e.userId})));case 10:case"end":return e.stop()}}),e)}))),this.denyAllStageRequest=(0,f.Z)((0,h.Z)().mark((function e(){var t,r;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("WEBINAR"!==n.meeting.meta.viewType){e.next=7;break}return r=n.meeting.participants.joined.toArray().filter((function(e){return"REQUESTED_TO_JOIN_STAGE"===e.webinarStageStatus})),e.next=4,Promise.all(r.map(function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.rejectRequestToJoinStage();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 4:n.updateStageRequestedParticipants(),e.next=10;break;case 7:if("LIVESTREAM"!==n.meeting.meta.viewType){e.next=10;break}return e.next=10,null===(t=n.meeting.stage)||void 0===t?void 0:t.denyAccess(n.stageRequestedParticipants.map((function(e){return e.userId})));case 10:case"end":return e.stop()}}),e)}))),this.shouldShowStageRequests=function(){return n.meeting.self.permissions.acceptPresentRequests&&n.stageRequestedParticipants.length>0},this.updateRequestList=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var r,i,a,o;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("WEBINAR"!==n.meeting.meta.viewType){e.next=4;break}n.stageRequestedParticipants=null===(r=[n.meeting.self].concat((0,m.Z)(n.meeting.participants.joined.toArray())))||void 0===r?void 0:r.filter((function(e){return"REQUESTED_TO_JOIN_STAGE"===e.webinarStageStatus})),e.next=28;break;case 4:if("LIVESTREAM"!==n.meeting.meta.viewType){e.next=28;break}if(t){e.next=27;break}return e.next=8,null===(i=n.meeting.stage)||void 0===i?void 0:i.getAccessRequests();case 8:if(e.t2=a=e.sent,e.t1=null===e.t2,e.t1){e.next=12;break}e.t1=void 0===a;case 12:if(!e.t1){e.next=16;break}e.t3=void 0,e.next=17;break;case 16:e.t3=a.stageRequests;case 17:if(e.t4=o=e.t3,e.t0=null!==e.t4,!e.t0){e.next=21;break}e.t0=void 0!==o;case 21:if(!e.t0){e.next=25;break}e.t5=o,e.next=26;break;case 25:e.t5=[];case 26:t=e.t5;case 27:n.stageRequestedParticipants=t.map((function(e){return Object.assign(Object.assign({},e),{name:e.displayName})}));case 28:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.meeting=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.view="sidebar",this.t=ir(),this.stageRequestedParticipants=[]}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e=this.meeting,t=e.participants,n=e.self;this.participantLeftListener&&t.joined.removeListener("participantLeft",this.participantLeftListener),this.peerRequestToJoinStageListener&&t.joined.removeListener("peerRequestToJoinStage",this.peerRequestToJoinStageListener),this.peerAcceptedToJoinStageListener&&t.joined.removeListener("peerAcceptedToJoinStage",this.peerAcceptedToJoinStageListener),this.peerRejectedToJoinStageListener&&t.joined.removeListener("peerRejectedToJoinStage",this.peerRejectedToJoinStageListener),t.joined.removeListener("peerStartedPresenting",this.peerPresentingUpdateListener),t.joined.removeListener("peerStoppedPresenting",this.peerPresentingUpdateListener),n.removeListener("stageJoined",this.peerPresentingUpdateListener),n.removeListener("stageLeft",this.peerPresentingUpdateListener),n.removeListener("removedFromStage",this.peerPresentingUpdateListener)}},{key:"meetingChanged",value:function(e){var t,n=this;null!=e&&(this.participantLeftListener=function(e){n.stageRequestedParticipants=n.stageRequestedParticipants.filter((function(t){return t.id!==e.id}))},this.peerRequestToJoinStageListener=function(t){var r=t.id;n.stageRequestedParticipants=n.stageRequestedParticipants.filter((function(e){return e.id!=r}));var i=e.participants.joined.get(r);void 0!==i&&(n.stageRequestedParticipants=[].concat((0,m.Z)(n.stageRequestedParticipants),[i]))},this.peerAcceptedToJoinStageListener=function(e){var t=e.id;n.stageRequestedParticipants=n.stageRequestedParticipants.filter((function(e){return e.id!=t}))},this.peerRejectedToJoinStageListener=function(e){var t=e.id;n.stageRequestedParticipants=n.stageRequestedParticipants.filter((function(e){return e.id!=t}))},this.updateRequestList(),e.participants.joined.addListener("peerRequestToJoinStage",this.peerRequestToJoinStageListener),e.participants.joined.addListener("peerAcceptedToJoinStage",this.peerAcceptedToJoinStageListener),e.participants.joined.addListener("peerRejectedToJoinStage",this.peerRejectedToJoinStageListener),e.participants.joined.addListener("peerStartedPresenting",this.peerPresentingUpdateListener),e.participants.joined.addListener("peerStoppedPresenting",this.peerPresentingUpdateListener),null===(t=e.stage)||void 0===t||t.on("stageAccessRequestUpdate",this.updateRequestList),e.participants.joined.addListener("participantLeft",this.participantLeftListener),e.self.addListener("stageJoined",this.peerPresentingUpdateListener),e.self.addListener("stageLeft",this.peerPresentingUpdateListener),e.self.addListener("removedFromStage",this.peerPresentingUpdateListener))}},{key:"render",value:function(){var e=this;if("sidebar"===this.view&&this.shouldShowStageRequests())return T("div",{class:"stage-requested-participants"},T("div",{class:"heading-count",part:"staged-heading-count"},this.t("stage_request.header_title")," (",this.stageRequestedParticipants.length,")"),T("ul",{class:"participants",part:"staged-participants"},this.stageRequestedParticipants.map((function(t){return T("li",{class:"waiting-participant",key:t.id},T("div",{class:"participant-details"},T("dyte-avatar",{participant:t,size:"sm",iconPack:e.iconPack,t:e.t}),T("p",{class:"name",title:t.name},t.name)),T("div",{class:"waitlist-controls"},T("dyte-tooltip",{label:e.t("stage_request.deny_request"),variant:"secondary",iconPack:e.iconPack,t:e.t},T("dyte-button",{variant:"secondary",kind:"icon",onClick:function(){return e.rejectStageRequest(t)},iconPack:e.iconPack,t:e.t},T("dyte-icon",{class:"deny",icon:e.iconPack.dismiss,iconPack:e.iconPack,t:e.t}))),T("dyte-tooltip",{label:e.t("stage_request.accept_request"),variant:"secondary",iconPack:e.iconPack,t:e.t},T("dyte-button",{variant:"secondary",kind:"icon",iconPack:e.iconPack,t:e.t,onClick:function(){return e.acceptStageRequest(t)}},T("dyte-icon",{class:"accept",icon:e.iconPack.checkmark})))))}))),T("div",{class:"bulk-actions"},T("dyte-button",{class:"accept-all-button",variant:"secondary",iconPack:this.iconPack,t:this.t,onClick:this.acceptAllStageRequest},this.t("stage_request.accept_all")),T("dyte-button",{class:"deny-all-button",variant:"danger",iconPack:this.iconPack,t:this.t,onClick:this.denyAllStageRequest},this.t("stage_request.deny_all"))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();To.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-top:var(--dyte-space-2, 8px);display:flex;width:100%;flex-direction:column;font-size:14px}.stage-requested-participants{margin-bottom:var(--dyte-space-8, 32px)}.stage-requested-participants .bulk-actions{display:flex;gap:var(--dyte-space-2, 8px)}.stage-requested-participants .bulk-actions .accept-all-button{--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}.stage-requested-participants .bulk-actions dyte-button{flex:1 1 0%}h3,.heading-count{margin:var(--dyte-space-0, 0px);
2display:flex;align-items:center;justify-content:center;padding:var(--dyte-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--dyte-space-2, 8px);padding:var(--dyte-space-0, 0px)}.waiting-participant{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);display:flex;align-items:center;color:rgb(var(--dyte-colors-text-on-brand-1000, var(--dyte-colors-text-1000, 255 255 255)))}.waiting-participant .participant-details{margin-right:auto;display:flex;align-items:center}.waiting-participant .participant-details dyte-avatar{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);flex-shrink:0;font-size:14px}.waiting-participant .participant-details .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 1080px){.waiting-participant .participant-details .name{max-width:var(--dyte-space-40, 160px)}}.waiting-participant .waitlist-controls{display:flex}.waiting-participant .waitlist-controls dyte-button{margin-left:var(--dyte-space-2, 8px);cursor:pointer;border-radius:var(--dyte-border-radius-sm, 4px)}.waiting-participant .waitlist-controls dyte-icon.accept{--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}.waiting-participant .waitlist-controls dyte-icon.deny{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Po=Object.freeze({__proto__:null,dyte_participants_stage_queue:To}),Co=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.updateStageRequests=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var r,i,a;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=22;break}return e.next=3,null===(r=n.meeting.stage)||void 0===r?void 0:r.getAccessRequests();case 3:if(e.t2=i=e.sent,e.t1=null===e.t2,e.t1){e.next=7;break}e.t1=void 0===i;case 7:if(!e.t1){e.next=11;break}e.t3=void 0,e.next=12;break;case 11:e.t3=i.stageRequests;case 12:if(e.t4=a=e.t3,e.t0=null!==e.t4,!e.t0){e.next=16;break}e.t0=void 0!==a;case 16:if(!e.t0){e.next=20;break}e.t5=a,e.next=21;break;case 20:e.t5=[];case 21:t=e.t5;case 22:n.stageRequestedParticipants=t;case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.updateCanView=function(){n.canViewParticipants=zi(n.meeting)},this.variant="button",this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.participantsActive=!1,this.waitlistedParticipants=[],this.stageRequestedParticipants=[],this.canViewParticipants=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e=this;this.meetingChanged(this.meeting),this.statesChanged(this.states),kr("sidebar",(function(){return e.statesChanged()}))}},{key:"disconnectedCallback",value:function(){var e,t,n;null!=this.meeting&&(null===(t=null===(e=this.meeting)||void 0===e?void 0:e.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.updateCanView),this.waitlistedParticipantJoinedListener&&this.meeting.participants.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&this.meeting.participants.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener),this.peerRequestToJoinStateListener&&this.meeting.participants.joined.removeListener("peerRequestToJoinStage",this.peerRequestToJoinStateListener),this.peerAcceptedToJoinStageListener&&this.meeting.participants.joined.removeListener("peerAcceptedToJoinStage",this.peerAcceptedToJoinStageListener),this.peerRejectedToJoinStageListener&&this.meeting.participants.joined.removeListener("peerRejectedToJoinStage",this.peerRejectedToJoinStageListener),this.peerRejectedToJoinStageListener&&this.meeting.participants.joined.addListener("peerStoppedPresenting",this.peerRejectedToJoinStageListener),null===(n=this.meeting.stage)||void 0===n||n.removeListener("stageAccessRequestUpdate",this.updateStageRequests))}},{key:"meetingChanged",value:function(e){var t,n=this;null!=e&&(this.canViewParticipants=zi(e),null===(t=null===e||void 0===e?void 0:e.stage)||void 0===t||t.on("stageStatusUpdate",this.updateCanView),e.self.permissions.acceptWaitingRequests&&(this.waitlistedParticipants=e.participants.waitlisted.toArray(),this.waitlistedParticipantJoinedListener=function(e){n.waitlistedParticipants.some((function(t){return t.id===e.id}))||(n.waitlistedParticipants=[].concat((0,m.Z)(n.waitlistedParticipants),[e]))},this.waitlistedParticipantLeftListener=function(e){n.waitlistedParticipants=n.waitlistedParticipants.filter((function(t){return t.id!==e.id}))},e.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),e.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener)),this.meeting.self.permissions.acceptPresentRequests&&("WEBINAR"===this.meeting.meta.viewT
2ype&&(this.peerRequestToJoinStateListener=function(t){var r=t.id;n.stageRequestedParticipants=n.stageRequestedParticipants.filter((function(e){return e.id!=r}));var i=e.participants.joined.get(r);void 0!==i&&n.stageRequestedParticipants.push(i)},this.peerAcceptedToJoinStageListener=function(e){var t=e.id;n.stageRequestedParticipants=n.stageRequestedParticipants.filter((function(e){return e.id!=t}))},this.peerRejectedToJoinStageListener=function(e){var t=e.id;n.stageRequestedParticipants=n.stageRequestedParticipants.filter((function(e){return e.id!=t}))},this.stageRequestedParticipants=this.meeting.participants.joined.toArray().filter((function(e){return"REQUESTED_TO_JOIN_STAGE"===e.webinarStageStatus})),e.participants.joined.addListener("peerRequestToJoinStage",this.peerRequestToJoinStateListener),e.participants.joined.addListener("peerAcceptedToJoinStage",this.peerAcceptedToJoinStageListener),e.participants.joined.addListener("peerRejectedToJoinStage",this.peerRejectedToJoinStageListener),e.participants.joined.addListener("peerStoppedPresenting",this.peerRejectedToJoinStageListener)),"LIVESTREAM"===this.meeting.meta.viewType&&(this.updateStageRequests(),null===e||void 0===e||e.stage.on("stageAccessRequestUpdate",this.updateStageRequests))))}},{key:"statesChanged",value:function(e){var t=e||br;null!=t&&(this.participantsActive=!0===t.activeSidebar&&"participants"===t.sidebar)}},{key:"toggleParticipantsTab",value:function(){var e=this.states||br;this.participantsActive=!((null===e||void 0===e?void 0:e.activeSidebar)&&"participants"===(null===e||void 0===e?void 0:e.sidebar)),br.activeSidebar=this.participantsActive,br.sidebar=this.participantsActive?"participants":"none",this.stateUpdate.emit({activeSidebar:this.participantsActive,sidebar:this.participantsActive?"participants":"none",activeMoreMenu:!1}),br.activeMoreMenu=!1}},{key:"render",value:function(){var e=this;if(this.canViewParticipants){var t=this.t("participants"),n=this.waitlistedParticipants.length+this.stageRequestedParticipants.length;return T(C,{title:t},0!==n&&!this.participantsActive&&T("div",{class:"waiting-participants-count",part:"waiting-participants-count"},T("span",null,n<=100?n:"99+")),T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,class:{active:this.participantsActive},onClick:function(){return e.toggleParticipantsTab()},icon:this.iconPack.participants,label:t,variant:this.variant}))}}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],states:["statesChanged"]}}}]),e}();Co.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:block}.waiting-participants-count{position:absolute;right:var(--dyte-space-3, 12px);box-sizing:border-box;padding:var(--dyte-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;display:flex;height:var(--dyte-space-5, 20px);min-width:var(--dyte-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}:host([variant='horizontal']){display:flex;flex-direction:row-reverse;align-items:center}:host([variant='horizontal']) .waiting-participants-count{right:var(--dyte-space-4, 16px);top:auto}";var Ro=Object.freeze({__proto__:null,dyte_participants_toggle:Co}),Zo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.updateStageViewers=function(){n.getViewers(n.search)},this.shouldShowViewers=function(){return"WEBINAR"===n.meeting.meta.viewType},this.meeting=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.view="sidebar",this.search="",this.t=ir(),this.stageViewers=[]}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting),this.searchChanged(this.search)}},{key:"meetingChanged",value:function(e){var t=this;null!=e&&(this.participantJoinedListener=function(e){if("ON_STAGE"!==e.webinarStageStatus){var n=t.search.toLowerCase();e.name.toLowerCase().includes(n)&&e.id.toLowerCase().includes(n)&&(t.stageViewers=[].concat((0,m.Z)(t.stageViewers.filter((function(t){return t.id!==e.id}))),[e]))}},this.participantLeftListener=function(e){t.stageViewers=t.stageViewers.filter((function(t){return t.id!==e.id}))},e.participants.joined.addListener("participantJoined",this.participantJoinedListener),e.participants.joined.addListener("participantLeft",this.participantLeftListener),e.participants.joined.addListener("peerStartedPresenting",this.updateStageViewers),e.participants.joined.addListener("peerStoppedPresenting",this.updateStageViewers),e.self.addListener("stageJoined",this.updateStageViewers),e.self.addListener("stageLeft",this.updateStageViewers),e.self.addListener("removedFromStage",this.updateStageViewers))}},{key:"searchChanged",value:function(e){this.getViewers(e)}},{key:"disconnectedCallback",value:function(){var e=this.meeting,t=e.participants,n=e.self;this.participantJoinedListener&&this.meeting.participants.joined.removeListener("participantJoined",this.participantJoinedListener),this.participantLeftListener&&this.meeting.participants.joined.removeListener("participantLeft",this.participantLeftListener),t.joined.removeListener("peerStartedPresenting",this.updateStageViewers),t.joined.removeListener("peerStoppedPresenting",this.updateStageViewers),n.removeListener("stageJoined",this.updateStageViewers),n.removeListener("stageLeft",this.updateStageViewers),n.removeListener("removedFromStage",this.updateStageViewers)}},{key:"getViewers",value:function(e){var t=[this.meeting.self].concat((0,m.Z)(this.meeting.participants.joined.toArray())).filter((function(e){return"ON_STAGE"!==e.webinarStageStatus}));this.stageViewers=""===e?t:t.filter((function(t){var n;return(null!==(n=t.name)&&void 0!==n?n:t.id).toLowerCase().includes(e.toLowerCase())}))}},{key:"render",value:function(){var e=this;if("sidebar"===this.view&&this.shouldShowViewers())return T("div",{class:"list"},T("div",{class:"heading-count",part:"heading-count"},this.t("Viewers")," (",this.stageViewers.length,")"),T("ul",{class:"participants",part:"participants"},this.stageViewers.map((function(t){if("ON_STAGE"!==t.webinarStageStatus)return T("dyte-participant",{role:"listitem",key:t.id,meeting:e.meeting,participant:t,view:e.view,iconPack:e.iconPack,t:e.t})})),0===this.stageViewers.length&&T("div",{class:"empty-message",part:"empty-message"},this.search.length>0?this.t("Couldn't find a viewer with the specified name or ID."):this.t("It looks like nobody is here."))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],search:["searchChanged"]}}}]),e}();Zo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;width:100%;flex-direction:column;font-size:14px}.list{margin-bottom:var(--dyte-space-4, 16px);display:flex;flex-direction:column}h3,.heading-count{margin:var(--dyte-space-0, 0px);align-items:center;justify-content:center;padding:var(--dyte-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-0, 0px);padding:var(--dyte-space-0, 0px)}.empty-message{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);text-align:center;font-size:12px;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}";var Mo=Object.freeze({__proto__:null,dyte_participants_viewer_list:Zo}),Ao=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.acceptWaitingRoomRequest=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.meeting.participants.acceptWaitingRoomRequest
2(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.acceptAllWaitingRoomRequests=(0,f.Z)((0,h.Z)().mark((function e(){var t;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.waitlistedParticipants.map((function(e){return n.meeting.participants.acceptWaitingRoomRequest(e.id)})),e.next=3,Promise.all(t);case 3:case"end":return e.stop()}}),e)}))),this.rejectWaitingRoomRequest=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.meeting.participants.rejectWaitingRoomRequest(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.shouldShowWaitlist=function(){return"LIVESTREAM"!==n.meeting.meta.viewType&&(n.meeting.self.permissions.acceptWaitingRequests&&0!==n.waitlistedParticipants.length)},this.meeting=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.view="sidebar",this.t=ir(),this.waitlistedParticipants=[]}return(0,c.Z)(e,[{key:"disconnectedCallback",value:function(){var e=this.meeting.participants;this.waitlistedParticipantJoinedListener&&e.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&e.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener)}},{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"meetingChanged",value:function(e){var t=this;null!=e&&(this.waitlistedParticipants=e.participants.waitlisted.toArray(),this.waitlistedParticipantJoinedListener=function(e){t.waitlistedParticipants.some((function(t){return t.id===e.id}))||(t.waitlistedParticipants=[].concat((0,m.Z)(t.waitlistedParticipants),[e]))},this.waitlistedParticipantLeftListener=function(e){t.waitlistedParticipants=t.waitlistedParticipants.filter((function(t){return t.id!==e.id}))},e.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),e.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener))}},{key:"render",value:function(){var e=this;if("sidebar"===this.view&&this.shouldShowWaitlist())return T("div",{class:"waiting-participants"},T("div",{class:"heading-count",part:"waitlisted-heading-count"},this.t("waitlist.header_title")," (",this.waitlistedParticipants.length,")"),T("ul",{class:"participants",part:"waitlisted-participants"},this.waitlistedParticipants.map((function(t){return T("li",{class:"waiting-participant",key:t.id},T("div",{class:"participant-details"},T("dyte-avatar",{participant:t,size:"sm",iconPack:e.iconPack,t:e.t}),T("p",{class:"name",title:t.name},t.name)),T("div",{class:"waitlist-controls"},T("dyte-tooltip",{label:e.t("waitlist.deny_request"),variant:"secondary",iconPack:e.iconPack,t:e.t},T("dyte-button",{variant:"secondary",kind:"icon",iconPack:e.iconPack,t:e.t,onClick:function(){return e.rejectWaitingRoomRequest(t.id)}},T("dyte-icon",{class:"deny",icon:e.iconPack.dismiss,iconPack:e.iconPack,t:e.t}))),T("dyte-tooltip",{label:e.t("waitlist.accept_request"),variant:"secondary",iconPack:e.iconPack,t:e.t},T("dyte-button",{variant:"secondary",kind:"icon",iconPack:e.iconPack,t:e.t,onClick:function(){return e.acceptWaitingRoomRequest(t.id)}},T("dyte-icon",{class:"accept",icon:e.iconPack.checkmark,iconPack:e.iconPack,t:e.t})))))}))),T("dyte-button",{class:"accept-all-button",variant:"secondary",kind:"wide",iconPack:this.iconPack,t:this.t,onClick:this.acceptAllWaitingRoomRequests},this.t("waitlist.accept_all")))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Ao.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-top:var(--dyte-space-4, 16px);margin-bottom:calc(var(--dyte-space-2, 8px) * -1);display:flex;width:100%;flex-direction:column;font-size:14px}.waiting-participants{margin-bottom:var(--dyte-space-8, 32px)}.waiting-participants .accept-all-button{--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}h3,.heading-count{margin:var(--dyte-space-0, 0px);
2display:flex;align-items:center;justify-content:center;padding:var(--dyte-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--dyte-space-2, 8px);padding:var(--dyte-space-0, 0px)}.waiting-participant{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);display:flex;align-items:center;color:rgb(var(--dyte-colors-text-on-brand-1000, var(--dyte-colors-text-1000, 255 255 255)))}.waiting-participant .participant-details{margin-right:auto;display:flex;align-items:center}.waiting-participant .participant-details dyte-avatar{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);flex-shrink:0;font-size:14px}.waiting-participant .participant-details .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 1080px){.waiting-participant .participant-details .name{max-width:var(--dyte-space-40, 160px)}}.waiting-participant .waitlist-controls{display:flex}.waiting-participant .waitlist-controls dyte-button{margin-left:var(--dyte-space-2, 8px);cursor:pointer;border-radius:var(--dyte-border-radius-sm, 4px)}.waiting-participant .waitlist-controls dyte-icon.accept{--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}.waiting-participant .waitlist-controls dyte-icon.deny{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Io=Object.freeze({__proto__:null,dyte_participants_waiting_list:Ao}),Oo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.continue=function(){n.stateUpdate.emit({activePermissionsMessage:{enabled:!1}}),br.activePermissionsMessage={enabled:!1}},this.reload=function(){"undefined"!==typeof window&&window.location.reload()},this.meeting=void 0,this.t=ir(),this.iconPack=ar,this.device=void 0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"meetingChanged",value:function(e){null!=e&&(this.device=e.self.device)}},{key:"getLink",value:function(e){var t;switch(e){case"audio":t="microphone";break;case"video":t="camera";break;default:t="screenshare"}var n="Allow+".concat(t,"+access");if(null!=this.device){var r=this.device;n+="+"+r.browserName,r.isMobile&&(n+="+mobile")}return"https://www.google.com/search?q="+n}},{key:"isDeniedBySystem",value:function(){var e,t=null===(e=this.meeting)||void 0===e?void 0:e.self.mediaPermissions;return null!=t&&!!Object.values(t).includes("SYSTEM_DENIED")}},{key:"render",value:function(){var e,t,n,r,i=this.isDeniedBySystem();return T(C,null,T("h2",null,T("dyte-icon",{class:"text-icon",icon:this.iconPack.warning,iconPack:this.iconPack,t:this.t}),i?this.t("perm_sys_denied.".concat(null!==(e=br.activePermissionsMessage.kind)&&void 0!==e?e:"audio")):this.t("perm_denied_title.".concat(null!==(t=br.activePermissionsMessage.kind)&&void 0!==t?t:"audio"))),T("p",null,this.t("perm_denied_text.".concat(null!==(n=br.activePermissionsMessage.kind)&&void 0!==n?n:"audio"))),i&&T("p",null,this.t("perm.sys_denied.message")),!i&&T("a",{class:"need-help-link",href:this.getLink(null!==(r=br.activePermissionsMessage.kind)&&void 0!==r?r:"audio"),target:"_blank",rel:"noreferrer external noreferrer noopener"},T("dyte-icon",{class:"text-icon",icon:this.iconPack.attach,iconPack:this.iconPack,t:this.t}),this.t("Need help on how to do this?")),T("div",{class:"actions"},T("dyte-button",{size:"lg",kind:"wide",variant:"secondary",onClick:this.continue,iconPack:this.iconPack,t:this.t},this.t("Continue as it is")),T("dyte-button",{size:"lg",kind:"wide",onClick:this.reload,iconPack:this.iconPack,t:this.t},this.t("Reload"))),T("slot",null))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Oo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);box-sizing:border-box;display:block;width:560px;padding:var(--dyte-space-6, 24px);border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.actions{display:flex;align-items:center;gap:var(--dyte-space-2, 8px)}.text-icon{display:inline-block;vertical-align:middle}h2{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-4, 16px)}h2 .text-icon{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}p{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-4, 16px)}.need-help-link{display:inline-block;text-underline-offset:2px;--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-400, 53 110 253) / var(--tw-text-opacity))}.need-help-link:hover{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-600, 13 81 253) / var(--tw-text-opacity))}a dyte-icon{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}:host([size='sm']) .actions{flex-direction:column;align-items:flex-start;justify-content:center}:host([size='sm']) .action{width:100%;padding-top:var(--dyte-space-2, 8px);padding-bottom:var(--dyte-space-2, 8px)}.actions{margin-top:var(--dyte-space-6, 24px)}.actions dyte-button{flex:1 1 0%}";var Lo=Object.freeze({__proto__:null,dyte_permissions_message:Oo}),Do=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.variant="button",this.meeting=void 0,this.states=void 0,this.config=Ue,this.iconPack=ar,this.size=void 0,this.t=ir(),this.pipEnabled=!1,this.pipSupported=!1}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){}},{key:"statesChanged",value:function(e){var t=e||br;null!=(null===t||void 0===t?void 0:t.activePipMode)&&(this.pipEnabled=t.activePipMode)}},{key:"meetingChanged",value:function(e){var t;if(null!==e){this.pipSupported=va.isSupported()&&(null===(t=e.self.config)||void 0===t?void 0:t.pipMode);var n=this.states||br;this.pipEnabled=n.activePipMode}}},{key:"togglePip",value:function(){!0!==(this.states||br).activePipMode?(va.updateMediaSession(ua.CAMERA,this.meeting.self.videoEnabled),va.updateMediaSession(ua.MIC,this.meeting.self.audioEnabled),va.enable(),this.stateUpdate.emit({activePipMode:!0})):(va.disable(),this.stateUpdate.emit({activePipMode:!1})),this.stateUpdate.emit({activeMoreMenu:!1}),br.activeMoreMenu=!1}},{key:"render",value:function(){var e=this;if(this.pipSupported)return T(C,{tabIndex:0,role:"log","aria-label":"Picture-in-Picture mode"},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,onClick:function(){return e.togglePip()},icon:this.pipEnabled?this.iconPack.pip_on:this.iconPack.pip_off,label:this.pipEnabled?this.t("pip_off"):this.t("pip_on"),variant:this.variant}))}}],[{key:"watchers",get:function(){return{states:["statesChanged"],meeting:["meetingChanged"]}}}]),e}();Do.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var No=Object.freeze({__proto__:null,dyte_pip_toggle:Do}),jo=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.meeting=void 0,this.plugin=void 0,this.iconPack=ar,this.t=ir(),this.canClosePlugin=!1,this.canControl=!0,this.viewModeEnabled=!1}return(0,c.Z)(e,[{key:"componentDidLoad",value:function(){this.meetingChanged(this.meeting),this.pluginChanged(this.plugin)}},{key:"meetingChanged",value:function(e){var t,n=this;if(null!=e){var r=e.self.permissions,i=r.isV2?r.plugins.canEditConfig:r.plugins.canEditAcl;if(void 0!==r.plugins.config){Object.keys(r.plugins.config||{}).forEach((function(e){r.plugins.config[e.toLowerCase()]=r.plugins.config[e]}));var a=this.plugin.id.replace(new RegExp("-","g"),""),o="whitelist"===((null===(t=r.plugins.config[a])||void 0===t?void 0:t.defaultAccess)||"blacklist");this.plugin.enabledBy===e.self.userId||i?this.canControl=!0:o&&(this.canControl=!1),this.viewModeEnabled=!this.canControl}je((function(){n.canClosePlugin=e.self.permissions.plugins.canClose}))}}},{key:"pluginChanged",value:function(e){var t=this;this.toggleViewModeListener=function(e){t.viewModeEnabled=e},null!=e&&(e.addPluginView(this.iframeEl),e.addListener("toggleViewMode",this.toggleViewModeListener))}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.plugin)||void 0===e||e.removeListener("toggleViewMode",this.toggleViewModeListener)}},{key:"render",value:function(){var e=this;return null==this.plugin?null:T(C,null,T("header",{part:"header"},T("div",null,this.plugin.name),this.canClosePlugin&&T("div",null,T("dyte-button",{kind:"icon",onClick:function(){return e.plugin.deactivate()},part:"button",iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.dismiss,iconPack:this.iconPack,t:this.t})))),T("div",{class:"iframe-container"},!this.canControl&&(this.viewModeEnabled?T("div",{class:"block-inputs"}):null),T("iframe",{ref:function(t){return e.iframeEl=t},part:"iframe"})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],plugin:["pluginChanged"]}}}]),e}();jo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;height:100%;width:100%;flex-direction:column;overflow:hidden;border-radius:var(--dyte-border-radius-lg, 12px);color:rgb(var(--dyte-colors-text-1000, 255 255 255))}header{display:flex;height:var(--dyte-space-8, 32px);align-items:center;justify-content:space-between;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}header>div{display:flex;align-items:center}dyte-button{display:flex;height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);flex-direction:column;align-items:center;border-radius:9999px}dyte-button dyte-icon{height:var(--dyte-space-3, 12px);width:var(--dyte-space-3, 12px)}iframe{display:block;flex:1 1 0%;margin:var(--dyte-space-0, 0px);border-width:var(--dyte-border-width-none, 0);border-style:none;padding:var(--dyte-space-0, 0px);outline:2px solid transparent;outline-offset:2px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-video-bg, 24 24 24) / var(--tw-bg-opacity))}.iframe-container{position:relative;height:100%;width:100%}.block-inputs{position:absolute;z-index:10;height:100%;width:100%;border-left-width:var(--dyte-border-width-none, 0);border-top-width:var(--dyte-border-width-lg, 4px);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-border-opacity))}iframe{height:100%;width:100%}";var Bo=Object.freeze({__proto__:null,dyte_plugin_main:jo}),Uo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.close=function(){n.stateUpdate.emit({activeSidebar:!1,sidebar:"none"}),br.activeSidebar=!1,br.sidebar="none"},this.meeting=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.t=ir(),this.plugins=[],this.canStartPlugins=!1,this.canClosePlugin=!1,this.activatedPluginsId=[]}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.meeting)||void 0===e||e.plugins.all.removeListener("stateUpdate",this.updateActivePlugins)}},{key:"meetingChanged",value:function(e){var t=this;null!=e&&(this.canStartPlugins=e.self.permissions.plugins.canStart,this.canClosePlugin=e.self.permissions.plugins.canClose,this.plugins=e.plugins.all.toArray().filter((function(t){var n;return!(null===(n=e.self.config.disabledPlugins)||void 0===n?void 0:n.includes(t.id))})),this.updateActivePlugins=function(){t.activatedPluginsId=e.plugins.active.toArray().map((function(e){return e.id}))},this.updateActivePlugins(),e.plugins.all.addListener("stateUpdate",this.updateActivePlugins))}},{key:"render",value:function(){var e=this;return T(C,null,T("ul",{class:"scrollbar"},this.plugins.map((function(t){return T("li",{key:t.name,class:"plugin"},T("div",{class:"metadata"},T("img",{src:t.picture}),T("div",{class:"name"},t.name)),!e.activatedPluginsId.includes(t.id)&&e.canStartPlugins&&T("div",{class:"buttons"},T("dyte-button",{kind:"icon",size:"lg",iconPack:e.iconPack,t:e.t,onClick:function(){t.activate(),e.close()},"aria-label":"".concat(e.t("Activate")," ").concat(t.name)},T("dyte-icon",{icon:e.iconPack.rocket,tabIndex:-1,"aria-hidden":!0,iconPack:e.iconPack,t:e.t}))),e.activatedPluginsId.includes(t.id)&&e.canClosePlugin&&T("div",{class:"buttons"},T("dyte-button",{kind:"icon",size:"lg",onClick:function(){t.deactivate()},iconPack:e.iconPack,t:e.t,"aria-label":"".concat(e.t("Close")," ").concat(t.name)},T("dyte-icon",{icon:e.iconPack.dismiss,tabIndex:-1,"aria-hidden":!0,iconPack:e.iconPack,t:e.t}))))}))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Uo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}h3{margin-left:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-0, 0px);margin-top:var(--dyte-space-4, 16px);margin-bottom:var(--dyte-space-4, 16px);display:block;padding:var(--dyte-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));text-align:center}ul{overflow-y:auto;padding:var(--dyte-space-0, 0px);flex-grow:1;flex-basis:0}.metadata{display:flex;align-items:center}.metadata img{height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);border-radius:var(--dyte-border-radius-sm, 4px)}.metadata .name{margin-left:var(--dyte-space-2, 8px);font-weight:500}.plugin{display:flex;align-items:center;justify-content:space-between;padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px);padding-top:var(--dyte-space-2, 8px);padding-bottom:var(--dyte-space-2, 8px)}.plugin .buttons{display:flex;align-items:center}dyte-button:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
2dow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-ring-opacity));--tw-ring-offset-width:2px;--tw-ring-offset-color:rgb(var(--dyte-colors-background-1000, 8 8 8))}";var Vo=Object.freeze({__proto__:null,dyte_plugins:Uo}),Fo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.updateCanView=function(){n.canViewPlugins=Hi(n.meeting)},this.variant="button",this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.pluginsActive=!1,this.canViewPlugins=!1}return(0,c.Z)(e,[{key:"disconnectedCallback",value:function(){var e,t;null===(t=null===(e=this.meeting)||void 0===e?void 0:e.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.updateCanView)}},{key:"connectedCallback",value:function(){var e=this;this.statesChanged(this.states),this.meetingChanged(this.meeting),kr("sidebar",(function(){return e.statesChanged()}))}},{key:"meetingChanged",value:function(e){var t;null!=e&&(this.canViewPlugins=Hi(e),null===(t=null===e||void 0===e?void 0:e.stage)||void 0===t||t.on("stageStatusUpdate",this.updateCanView))}},{key:"statesChanged",value:function(e){var t=e||br;null!=t&&(this.pluginsActive=!0===t.activeSidebar&&"plugins"===t.sidebar)}},{key:"togglePlugins",value:function(){var e=this.states||br;this.pluginsActive=!((null===e||void 0===e?void 0:e.activeSidebar)&&"plugins"===(null===e||void 0===e?void 0:e.sidebar)),this.stateUpdate.emit({activeSidebar:this.pluginsActive,sidebar:this.pluginsActive?"plugins":"none",activeMoreMenu:!1}),br.activeSidebar=this.pluginsActive,br.sidebar=this.pluginsActive?"plugins":"none",br.activeMoreMenu=!1}},{key:"render",value:function(){var e=this;if(this.canViewPlugins){var t=this.t("plugins");return T(C,{title:t},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,class:{active:this.pluginsActive},onClick:function(){return e.togglePlugins()},icon:this.iconPack.rocket,label:t,variant:this.variant}))}}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],states:["statesChanged"]}}}]),e}();Fo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var zo=Object.freeze({__proto__:null,dyte_plugins_toggle:Fo}),Ho=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];null!=e&&e.scrollTo({top:e.scrollHeight,behavior:t?"smooth":"auto"})},qo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onPollsUpdate=function(e){n.polls=(0,m.Z)(e.polls)},this.meeting=void 0,this.config=Ue,this.size=void 0,this.iconPack=ar,this.t=ir(),this.create=!1,this.polls=void 0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e;null!=this.meeting&&(null===(e=this.meeting.polls)||void 0===e||e.removeListener("pollsUpdate",this.onPollsUpdate))}},{key:"meetingChanged",value:function(e){var t=this;void 0!=e&&(e&&!e.polls||(this.polls=(0,m.Z)(e.polls.items),e.polls.addListener("pollsUpdate",this.onPollsUpdate),this.onCreate=function(){var n=(0,f.Z)((0,h.Z)().mark((function n(r){return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.create=!1,n.next=3,e.polls.create(r.question,r.options,r.anonymous,r.hideVotes);case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),this.onVote=function(){var t=(0,f.Z)((0,h.Z)().mark((function t(n,r){return(0,h.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.polls.vote(n,r);case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()))}},{key:"toggleCreateState",value:function(){this.create=!this.create}},{key:"componentDidRender",value:function(){Ho(this.pollEl)}},{key:"render",value:function(){var e=this;return T(C,null,T("div",{class:"ctr",part:"container"},T("div",{class:"polls-view scrollbar",ref:function(t){return e.pollEl=t},part:"polls"},this.polls.map((function(t){var n;return T("dyte-poll",{key:t.id,poll:t,onDyteVotePoll:function(t){e.onVote(t.detail.id,t.detail.index)},self:null===(n=e.meeting)||void 0===n?void 0:n.self.userId,iconPack:e.iconPack,t:e.t,permissions:e.meeting.self.permissions})})),this.create&&T("dyte-poll-form",{part:"poll-form",onDyteCreatePoll:function(t){e.onCreate(t.detail)},iconPack:this.iconPack,t:this.t})),this.meeting.self.permissions.polls.canCreate&&T("dyte-button",{kind:"wide",onClick:function(){return e.toggleCreateState()},variant:this.create?"secondary":"primary",part:"button",iconPack:this.iconPack,t:this.t},this.create?this.t("Cancel Poll Creation"):this.t("Create New Poll"))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();qo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{margin-top:var(--dyte-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px}*{box-sizing:border-box}.ctr{box-sizing:border-box;padding:var(--dyte-space-3, 12px);padding-top:var(--dyte-space-0, 0px);
2display:flex;flex:1 1 0%;flex-direction:column}.polls-view{overflow-y:auto;flex:1 1 0%;flex-basis:0}";var Go=Object.freeze({__proto__:null,dyte_polls:qo}),Wo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.onPollsUpdate=function(e){!0===e.newPoll&&(n.unreadPollsCount+=1)},this.updateCanView=function(){n.canViewPolls=Fi(n.meeting)},this.variant="button",this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.pollsActive=!1,this.unreadPollsCount=0,this.canViewPolls=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e=this;this.meetingChanged(this.meeting),this.statesChanged(this.states),kr("sidebar",(function(){return e.statesChanged()}))}},{key:"disconnectedCallback",value:function(){var e,t,n;null===(e=this.meeting.polls)||void 0===e||e.removeListener("pollsUpdate",this.onPollsUpdate),null===(n=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===n||n.removeListener("stageStatusUpdate",this.updateCanView)}},{key:"meetingChanged",value:function(e){var t;e&&e.polls&&(this.unreadPollsCount=e.polls.items.length,this.meeting.polls.addListener("pollsUpdate",this.onPollsUpdate),this.canViewPolls=Fi(e),null===(t=null===e||void 0===e?void 0:e.stage)||void 0===t||t.on("stageStatusUpdate",this.updateCanView))}},{key:"statesChanged",value:function(e){var t=e||br;null!=t&&(this.pollsActive=!0===t.activeSidebar&&"polls"===t.sidebar)}},{key:"togglePollsTab",value:function(){var e=this.states||br;this.unreadPollsCount=0,this.pollsActive=!((null===e||void 0===e?void 0:e.activeSidebar)&&"polls"===(null===e||void 0===e?void 0:e.sidebar)),this.stateUpdate.emit({activeSidebar:this.pollsActive,sidebar:this.pollsActive?"polls":"none",activeMoreMenu:!1}),br.activeSidebar=this.pollsActive,br.sidebar=this.pollsActive?"polls":"none",br.activeMoreMenu=!1}},{key:"render",value:function(){var e=this;if(this.canViewPolls){var t=this.t("polls");return T(C,{title:t},0!==this.unreadPollsCount&&!this.pollsActive&&T("div",{class:"unread-count",part:"unread-count"},T("span",null,this.unreadPollsCount<=100?this.unreadPollsCount:"99+")),T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,class:{active:this.pollsActive},onClick:function(){return e.togglePollsTab()},icon:this.iconPack.poll,label:t,variant:this.variant}))}}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],states:["statesChanged"]}}}]),e}();Wo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:block}.unread-count{position:absolute;right:var(--dyte-space-3, 12px);box-sizing:border-box;padding:var(--dyte-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;display:flex;height:var(--dyte-space-5, 20px);min-width:var(--dyte-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}:host([variant='horizontal']){display:flex;flex-direction:row-reverse;align-items:center}:host([variant='horizontal']) .unread-count{right:var(--dyte-space-4, 16px);top:auto}";var Jo=Object.freeze({__proto__:null,dyte_polls_toggle:Wo}),$o=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.setIsRecording=function(e){n.isRecording="RECORDING"===e},this.meeting=void 0,this.size=void 0,this.t=ir(),this.iconPack=ar,this.isRecording=void 0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.meeting)||void 0===e||e.recording.removeListener("recordingUpdate",this.updateRecordingStatus)}},{key:"meetingChanged",value:function(e){var t=this;null!=e&&(this.setIsRecording(e.recording.recordingState),this.updateRecordingStatus=function(e){t.setIsRecording(e)},e.recording.addListener("recordingUpdate",this.updateRecordingStatus))}},{key:"render",value:function(){return T(C,null,this.isRecording&&T("div",{class:"indicator","aria-label":this.t("This meeting is being recorded"),part:"indicator"},T("dyte-icon",{icon:this.iconPack.recording,"aria-hidden":!0,tabIndex:-1,part:"icon",iconPack:this.iconPack,t:this.t}),T("span",null,this.t("REC"))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();$o.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:block}:host[size='sm']{margin-left:var(--dyte-space-1, 4px);margin-right:var(--dyte-space-1, 4px)}.indicator{display:flex;flex-direction:row;align-items:center;font-size:14px;--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}dyte-icon{margin-right:var(--dyte-space-1, 4px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);-webkit-animation:blink 4s linear infinite;animation:blink 4s linear infinite}:host([size='sm']) dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}
2:host([size='sm']) .indicator span{display:none}@-webkit-keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}@keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}";var Ko=Object.freeze({__proto__:null,dyte_recording_indicator:$o}),Qo=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.dyteAPIError=I(this,"dyteAPIError",7),this.toggleRecording=(0,f.Z)((0,h.Z)().mark((function e(){var t,r;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.isLoading()&&!n.disabled){e.next=2;break}return e.abrupt("return");case 2:e.t0=n.recordingState,e.next="IDLE"===e.t0?5:"RECORDING"===e.t0?15:("STARTING"===e.t0||e.t0,25);break;case 5:return e.prev=5,e.next=8,null===(t=n.meeting)||void 0===t?void 0:t.recording.start();case 8:return e.abrupt("return");case 11:e.prev=11,e.t1=e.catch(5),n.dyteAPIError.emit({trace:n.t("recording.start"),message:n.t("Error while starting recording.")});case 14:return e.abrupt("return");case 15:return e.prev=15,e.next=18,null===(r=n.meeting)||void 0===r?void 0:r.recording.stop();case 18:return e.abrupt("return");case 21:e.prev=21,e.t2=e.catch(15),n.dyteAPIError.emit({trace:n.t("recording.stop"),message:n.t("Error while stopping recording.")});case 24:case 25:return e.abrupt("return");case 26:case"end":return e.stop()}}),e,null,[[5,11],[15,21]])}))),this.isLoading=function(){return null==n.meeting||"STARTING"===n.recordingState||"STOPPING"===n.recordingState},this.variant="button",this.meeting=void 0,this.t=ir(),this.iconPack=ar,this.size=void 0,this.disabled=!1,this.recordingState=void 0,this.canRecord=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e;this.recordingStateUpdateListener&&(null===(e=this.meeting)||void 0===e||e.recording.removeListener("recordingUpdate",this.recordingStateUpdateListener))}},{key:"meetingChanged",value:function(e){var t=this;null!=e&&(this.recordingState=e.recording.recordingState,this.canRecord=!0===e.self.permissions.canRecord,this.recordingStateUpdateListener=function(e){t.recordingState=e},e.recording.addListener("recordingUpdate",this.recordingStateUpdateListener))}},{key:"getLabel",value:function(){switch(this.recordingState){case"IDLE":return this.t("Record");case"RECORDING":return this.t("Stop Recording");case"STARTING":return this.t("Starting");case"STOPPING":return this.t("Stopping");default:return this.t("Loading")}}},{key:"getIcon",value:function(){switch(this.recordingState){case"IDLE":case"STARTING":case"STOPPING":default:return this.iconPack.recording;case"RECORDING":return this.iconPack.stop_recording}}},{key:"render",value:function(){if(this.canRecord)return T(C,{title:this.t("Record")},T("dyte-controlbar-button",{size:this.size,iconPack:this.iconPack,t:this.t,onClick:this.toggleRecording,icon:this.getIcon(),isLoading:this.isLoading(),label:this.t(this.getLabel()),variant:this.variant,disabled:this.disabled}))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Qo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Yo=Object.freeze({__proto__:null,dyte_recording_toggle:Qo}),Xo=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.acceptedRequestId=void 0,this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"disconnectedCallback",value:function(){}},{key:"meetingChanged",value:function(e){var t,n,r,i,a;null!=e&&!Boolean(this.acceptedRequestId)&&Boolean(null===(r=null===(n=null===(t=this.meeting)||void 0===t?void 0:t.remote)||void 0===n?void 0:n.active)||void 0===r?void 0:r.id)&&
2(this.acceptedRequestId=null===(a=null===(i=this.meeting.remote)||void 0===i?void 0:i.active)||void 0===a?void 0:a.id)}},{key:"render",value:function(){var e,t,n,r,i=this;return Boolean(null===(t=null===(e=null===this||void 0===this?void 0:this.meeting)||void 0===e?void 0:e.remote)||void 0===t?void 0:t.incomingRequests.toArray().length)?T(C,null,T("h3",null,this.t("The following people have requested remote control to your screen share")),T("p",null,this.t("Please select whom you want to give access to")),T("div",{class:"scrollbar"},null===(r=null===(n=null===this||void 0===this?void 0:this.meeting)||void 0===n?void 0:n.remote)||void 0===r?void 0:r.incomingRequests.toArray().map((function(e){var t=i.meeting.participants.joined.get(e.remotePeerId);return T("label",{onClick:function(){i.acceptedRequestId=e.id},class:"participant",htmlFor:t.id},T("input",{type:"radio",checked:i.acceptedRequestId===e.id,name:"remote-access-participant",value:e.id}),T("dyte-avatar",{participant:t,size:"sm"}),t.name)}))),T("div",{id:"actions"},T("dyte-button",{disabled:!Boolean(this.acceptedRequestId),iconPack:this.iconPack,t:this.t,onClick:function(){var e,t;null===(t=null===(e=i.meeting)||void 0===e?void 0:e.remote)||void 0===t||t.acceptControl(i.acceptedRequestId),i.stateUpdate.emit({activeRemoteAccessManager:!1})}},this.t("Grant access")))):T(C,null,T("p",{class:"empty-message"},this.t("There are no remote requests, yet.")))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Xo.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{box-sizing:border-box;display:block;width:512px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--dyte-space-6, 24px);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--dyte-border-radius-md, 8px);line-height:1.25}.deny-access{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3,p{margin:var(--dyte-space-0, 0px);padding:var(--dyte-space-0, 0px)}h3{margin-bottom:var(--dyte-space-4, 16px);font-size:20px;line-height:1.5}p{margin-top:var(--dyte-space-4, 16px);margin-bottom:var(--dyte-space-4, 16px);font-size:14px}p.empty-message{text-align:center;font-size:16px}label>input{margin-right:var(--dyte-space-2, 8px)}input{background-color:transparent;accent-color:rgb(var(--dyte-colors-brand-500, 33 96 253))}#allow-requests-label{display:flex;align-items:center;font-size:12px}#actions{margin-top:var(--dyte-space-4, 16px);display:flex;align-items:center}dyte-button{flex:1 1 0%;border-radius:var(--dyte-border-radius-sm, 4px);font-size:12px}#participants-list{margin-top:var(--dyte-space-4, 16px);margin-bottom:var(--dyte-space-4, 16px);display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);border-radius:var(--dyte-border-radius-md, 8px);max-height:var(--dyte-space-56, 224px);overflow-y:auto}.participant{box-sizing:border-box;display:flex;height:var(--dyte-space-14, 56px);align-items:center;padding-left:var(--dyte-space-1, 4px);padding-right:var(--dyte-space-1, 4px);padding-top:var(--dyte-space-3, 12px);padding-bottom:var(--dyte-space-3, 12px);border-bottom:var(--dyte-border-width-sm, 1px) solid rgb(var(--dyte-colors-background-700, 44 44 44))}.participant:last-child{border-bottom-width:var(--dyte-border-width-none, 0)}.participant{cursor:pointer;font-size:14px}.participant input{margin-right:var(--dyte-space-3, 12px)}dyte-avatar{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px)}";var es=Object.freeze({__proto__:null,dyte_remote_access_manager:Xo}),ts=function(){return"undefined"!==typeof navigator&&"undefined"!==typeof navigator.mediaDevices&&"getDisplayMedia"in navigator.mediaDevices},ns=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.dyteAPIError=I(this,"dyteAPIError",7),this.selfScreenShareListener=function(e){var t=e.screenShareEnabled;n.screenShareEnabled=t;var r=n.screenShareCount+(t?1:-1);n.screenShareCount=Math.max(r,0),n.getState(),n.meeting.__internals__.logger.info("dyteScreenShare::screenShareUpdate",{media:{screenshare:{enabled:n.screenShareEnabled,count:n.screenShareCount}}})},this.screenShareListener=function(e){var t=e.screenShareEnabled,r=n.screenShareCount+(t?1:-1);n.screenShareCount=Math.max(r,0),n.getState(),n.meeting.__internals__.logger.info("dyteScreenShare::screenShareUpdate",{media:{screenshare:{enabled:n.screenShareEnabled,count:n.screenShareCount}}})},this.participantLeftListener=function(e){e.screenShareEnabled&&(n.screenShareCount=Math.max(n.screenShareCount-1,0),n.getState(),n.meeting.__internals__.logger.info("dyteScreenShare::screenShareUpdate",{media:{screenshare:{enabled:n.screenShareEnabled,count:n.screenShareCount}}}))},this.selfJoinStateListener=function(){n.updateCanProduce(n.meeting)},this.selfStageLeftListener=function(){n.canScreenShare=!1},this.selfJoinStateRejectedListener=function(){n.updateCanProduce(n.meeting)},this.mediaPermissionUpdateListener=function(e){var t=e.kind,r=e.message;if("screenshare"===t&&(n.shareScreenPermission=r,n.getState(),"COULD_NOT_START"===r&&n.dyteAPIError.emit({trace:n.t("screenshare.permissions"),message:n.t("An error occured while starting screenshare.")}),n.hasPermissionError())){var i={enabled:!0,kind:"screenshare"};n.stateUpdate.emit({activePermissionsMessage:i}),br.activePermissionsMessage=i}},this.reachedMaxScreenShares=function(){return n.maxScreenShareCount>0&&n.screenShareCount>=n.maxScreenShareCount},this.toggleScreenShare=(0,f.Z)((0,h.Z)().mark((function e(){var t,r,i;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.hasPermissionError()){e.next=5;break}return r={enabled:!0,kind:"screenshare"},n.stateUpdate.emit({activePermissionsMessage:r}),br.activePermissionsMessage=r,e.abrupt("return",!1);case 5:if(i=null===(t=n.meeting)||void 0===t?void 0:t.self,!n.screenShareEnabled){e.next=9;break}return i.disableScreenShare(),e.abrupt("return");case 9:if(null!=i&&n.canScreenShare&&!n.reachedMaxScreenShares()&&!n.hasPermissionError()){e.next=11;break}return e.abrupt("return");case 11:return e.next=13,i.enableScreenShare();case 13:n.stateUpdate.emit({activeMoreMenu:!1}),br.activeMoreMenu=!1;case 15:case"end":return e.stop()}}),e)}))),this.states=void 0,this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.maxScreenShareCount=-1,this.screenShareCount=0,this.screenShareEnabled=!1,this.canScreenShare=!1,this.shareScreenPermission="NOT_REQUESTED",this.screenShareState={tooltipLabel:this.t("share_screen_start"),label:this.t("share_screen_start"),icon:this.iconPack.share_screen_start,classList:{},showWarning:!1,disable:!1}}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){ts()?this.meetingChanged(this.meeting):oo.error("[dyte-screenshare-toggle] Device does not support screensharing.")}},{key:"disconnectedCallback",value:function(){var e,t,n,r,i,a,o,s,c,u,l;null===(e=this.meeting)||void 0===e||e.participants.joined.removeListener("screenShareUpdate",this.screenShareListener),null===(t=this.meeting)||void 0===t||t.participants.joined.removeListener("participantLeft",this.participantLeftListener),null===(n=this.meeting)||void 0===n||n.self.removeListener("screenShareUpdate",this.selfScreenShareListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("joinStageRequestAccepted",this.selfJoinStateListener),null===(a=this.meeting)||void 0===a||a.self.removeListener("joinStageRequestRejected",this.selfJoinStateRejectedListener),null===(o=this.meeting)||void 0===o||o.self.removeListener("stageJoined",this.selfJoinStateListener),null===(s=this.meeting)||void 0===s||s.self.removeListener("stageLeft",this.selfStageLeftListener),null===(c=this.meeting)||void 0===c||c.self.removeListener("removedFromStage",this.selfJoinStateListener),null===(l=null===(u=this.meeting)||void 0===u?void 0:u.stage)||void 0===l||l.removeListener("stageStatusUpdate",this.selfJoinStateListener)}},{key:"meetingChanged",value:function(e){if(null!=e){var t=e.self,n=e.stage;this.updateCanProduce(e),this.maxScreenShareCount=t.config.maxScreenShareCount,this.screenShareEnabled=t.screenShareEnabled;var r,i=0,a=(0,o.Z)(e.participants.joined.toArray());try{for(a.s();!(r=a.n()).done;){r.value.screenShareEnabled&&i++}}catch(s){a.e(s)}finally{a.f()}this.screenShareCount=i,this.getState(),e.__internals__.logger.info("dyteScreenShare::initialise",{media:{screenshare:{enabled:this.screenShareEnabled,count:this.screenShareCount,maxAllowedCount:this.maxScreenShareCount}}}),e.participants.joined.addListener("screenShareUpdate",this.screenShareListener),e.participants.joined.addListener("participantLeft",this.participantLeftListener),t.addListener("screenShareUpdate",this.selfScreenShareListener),t.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),t.addListener("joinStageRequestAccepted",this.selfJoinStateListener),t.addListener("joinStageRequestRejected",this.selfJoinStateRejectedListener),t.addListener("stageJoined",this.selfJoinStateListener),t.addListener("stageLeft",this.selfStageLeftListener),t.addListener("removedFromStage",this.selfJoinStateListener),null===n||void 0===n||n.addListener("stageStatusUpdate",this.selfJoinStateListener)}}},{key:"updateCanProduce",value:function(e){var t=e.self,n=e.meta,r=e.stage,i="ALLOWED"===t.permissions.canProduceScreenshare,a="WEBINAR"===n.viewType,o="LIVESTREAM"===n.viewType;if(this.canScreenShare=!1,i&&!o)this.canScreenShare=!0;else if(a||o){i&&"OFF_STAGE"!==r.status&&"REQUESTED_TO_JOIN_STAGE"!==r.status&&(this.canScreenShare=!0),"CAN_REQUEST"===t.permissions.canProduceScreenshare&&(a&&("ON_STAGE"===t.webinarStageStatus||"ACCEPTED_TO_JOIN_STAGE"===t.webinarStageStatus)||o&&("ON_STAGE"===r.status||"ACCEPTED_TO_JOIN_STAGE"===r.status))&&(this.canScreenShare=!0)}}},{key:"hasPermissionError",value:function(){return"SYSTEM_DENIED"===this.shareScreenPermission}},{key:"getState",value:function(){var e="",t="",n="",r={},i=this.hasPermissionError()&&!this.screenShareEnabled,a=this.reachedMaxScreenShares()&&!this.screenShareEnabled,o="COULD_NOT_START"===this.shareScreenPermission;this.screenShareEnabled&&!i?(t=this.t("share_screen_stop"),n=this.iconPack.share_screen_stop,r["red-icon"]=!0):(t=this.t("share_screen_start"),n=this.iconPack.share_screen_start),"SYSTEM_DENIED"===this.shareScreenPermission?(e=this.t("perm_sys_denied"),r["red-icon"]=!0):e=t,a&&(e=this.t("Maximum screen share limit reached")),o&&(e=this.t("An error occurred while screen sharing, please try again.")),this.screenShareState={tooltipLabel:e,label:t,icon:n,classList:r,disable:i||a,showWarning:i||a||o}}},{key:"render",value:function(){return ts()&&this.canScreenShare?T(C,{title:this.screenShareState.label},T("dyte-tooltip",{placement:"top",kind:"block",label:this.screenShareState.tooltipLabel,delay:600,part:"tooltip",iconPack:this.iconPack,t:this.t},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,variant:this.variant,label:this.screenShareState.label,icon:this.screenShareState.icon,class:this.screenShareState.classList,onClick:this.toggleScreenShare,disabled:this.screenShareState.disable,showWarning:this.screenShareState.showWarning}))):null}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();ns.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var rs=Object.freeze({__proto__:null,dyte_screen_share_toggle:ns}),is=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.fullScreenListener=function(){n.isFullScreen=oa()},this.onRemoteUpdate=function(e){var t,r,i=e.payload,a=e.type,o="";if(a===io.INCOMING_REQUEST_ACCEPTED){var s=n.meeting.participants.joined.get(i.request.remotePeerId);o="".concat(s.name," is controlling your screen.")}if(a===io.OUTGOING_REQUEST_ACCEPTED){var c=n.meeting.participants.joined.get(i.request.hostPeerId);o="You are controlling ".concat(c.name,"'s screen.")}a!==io.INCOMING_REQUEST_ENDED&&a!==io.OUTGOING_REQUEST_ENDED||(o=""),a!==io.REQUEST_RECEIVED||Boolean(null===(r=null===(t=n.meeting)||void 0===t?void 0:t.remote)||void 0===r?void 0:r.active)||n.stateUpdate.emit({activeRemoteAccessManager:!0}),n.remoteControlInfo=o},this.onMouseEvent=function(e){var t,r;n.shouldSkipEventTrigger()||(e.stopPropagation(),e.preventDefault(),null===(r=null===(t=n.meeting)||void 0===t?void 0:t.remote)||void 0===r||r.mouseEvent(e,n.videoEl))},this.onKeyDown=function(e){var t,r;n.shouldSkipEventTrigger()||null===(r=null===(t=n.meeting)||void 0===t?void 0:t.remote)||void 0===r||r.ke
2yboardEvent(e)},this.toggleFullScreen=function(){n.isFullScreen?(aa(),n.isFullScreen=!1):(ia(n.host),n.isFullScreen=!0)},this.hideFullScreenButton=!1,this.nameTagPosition="bottom-left",this.participant=void 0,this.meeting=void 0,this.variant="solid",this.size=void 0,this.iconPack=ar,this.t=ir(),this.videoExpanded=!1,this.screenShareEnabled=!1,this.isFullScreen=!1,this.remoteControlInfo=void 0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){null===window||void 0===window||window.addEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.addEventListener("webkitfullscreenchange",this.fullScreenListener)}},{key:"componentDidLoad",value:function(){this.participantChanged(this.participant)}},{key:"disconnectedCallback",value:function(){var e,t,n;this.screenShareListener&&(null===(e=this.participant)||void 0===e||e.removeListener("screenShareUpdate",this.screenShareListener)),null===(n=null===(t=this.meeting)||void 0===t?void 0:t.remote)||void 0===n||n.removeListener("remoteUpdate",this.onRemoteUpdate),null===window||void 0===window||window.removeEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.removeEventListener("webkitfullscreenchange",this.fullScreenListener)}},{key:"participantChanged",value:function(e){var t,n,r,i,a,o=this;null!=e&&(this.screenShareListener=function(e){var t=e.screenShareEnabled,n=e.screenShareTracks,r=t&&null!=n.video;if(je((function(){o.screenShareEnabled=r})),r){var i=new MediaStream;i.addTrack(n.video),null!=o.videoEl&&(o.videoEl.srcObject=i,o.videoEl.play())}else null!=o.videoEl&&(o.videoEl.srcObject=void 0)},this.screenShareListener(e),Boolean(null===(n=null===(t=this.meeting)||void 0===t?void 0:t.remote)||void 0===n?void 0:n.active)&&[this.meeting.remote.active.hostPeerId,this.meeting.remote.active.remotePeerId].includes(null===e||void 0===e?void 0:e.id)&&this.onRemoteUpdate({payload:{request:this.meeting.remote.active},type:(null===(r=this.meeting.remote.active)||void 0===r?void 0:r.hostPeerId)===this.meeting.self.id?"INCOMING_REQUEST_ACCEPTED":"OUTGOING_REQUEST_ACCEPTED"}),e.addListener("screenShareUpdate",this.screenShareListener),null===(a=null===(i=this.meeting)||void 0===i?void 0:i.remote)||void 0===a||a.addListener("remoteUpdate",this.onRemoteUpdate))}},{key:"shouldSkipEventTrigger",value:function(){var e,t,n;return null==this.meeting||null==this.participant||(!Boolean(null===(e=this.meeting.remote)||void 0===e?void 0:e.active)||!Boolean(this.meeting.participants.joined.get(null===(t=this.meeting.remote)||void 0===t?void 0:t.active.hostPeerId))||(null===(n=this.meeting.remote)||void 0===n?void 0:n.active.hostPeerId)!=this.participant.id)}},{key:"render",value:function(){var e,t,n,r,i,a,o,s,c=this,u=(null===(e=this.participant)||void 0===e?void 0:e.id)===(null===(t=this.meeting)||void 0===t?void 0:t.self.id),l=this.isFullScreen?this.t("Exit Fullscreen"):this.t("Fullscreen Screen Share"),d=this.isFullScreen?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize;return T(C,{class:{isSelf:u}},Boolean((null===(r=null===(n=this.meeting)||void 0===n?void 0:n.remote)||void 0===r?void 0:r.active)&&this.remoteControlInfo)&&T("div",{id:"remote-control-self",key:"remote-control-self"},T("p",{class:"remote-control-message"},this.remoteControlInfo),T("dyte-button",{onClick:function(){var e;return null===(e=c.meeting.remote)||void 0===e?void 0:e.endControl()},iconPack:this.iconPack,t:this.t},(null===(a=null===(i=this.meeting.remote)||void 0===i?void 0:i.active)||void 0===a?void 0:a.hostPeerId)===this.meeting.self.id?"Revoke access":"Stop")),T("div",{key:"video-container",id:"video-container",class:{expand:this.videoExpanded},contentEditable:Boolean(null===(o=this.meeting.remote)||void 0===o?void 0:o.active),onKeyDown:this.onKeyDown},T("video",{ref:function(e){return c.videoEl=e},class:{visible:this.screenShareEnabled,"fit-in-container":this.participant.supportsRemoteControl},playsInline:!0,autoPlay:!0,muted:!0,id:"screen-share-video-".concat(this.participant.id),onMouseMove:this.onMouseEvent,onClick:this.onMouseEvent,onContextMenu:this.onMouseEvent})),T("div",{id:"controls",key:"controls"},!this.hideFullScreenButton&&!u&&sa()&&T("dyte-tooltip",{label:l,iconPack:this.iconPack,t:this.t},T("dyte-button",{id:"full-screen-btn",kind:"icon",onClick:this.toggleFullScreen,title:l,iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:d,"aria-hidden":!0,tabIndex:-1,iconPack:this.iconPack,t:this.t}))),!0===(null===(s=this.participant)||void 0===s?void 0:s.supportsRemoteControl)&&T("dyte-menu",{id:"menu",key:"menu",iconPack:this.iconPack,t:this.t},T("dyte-button",{variant:"secondary",kind:"icon",slot:"trigger",iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.more_vertical,iconPack:this.iconPack,t:this.t})),T("dyte-menu-list",{iconPack:this.iconPack,t:this.t},!u&&T("dyte-menu-item",{style:{cursor:this.participant.supportsRemoteControl?"pointer":"not-allowed"},iconPack:this.iconPack,t:this.t,onClick:function(){var e,t;(null===(e=c.participant)||void 0===e?void 0:e.supportsRemoteControl)&&(null===(t=c.meeting.remote)||void 0===t||t.requestControl(c.participant.id))}},"Request remote control"),u&&T("dyte-menu-item",{iconPack:this.iconPack,t:this.t,onClick:function(){return c.stateUpdate.emit({activeRemoteAccessManager:!0})}},"Manage remote control requests")))),u&&T("div",{id:"self-message",key:"self-message"},T("h3",null,this.t("Your screen is being shared")),T("div",{class:"actions"},null!=this.meeting&&T("dyte-button",{variant:"danger",onClick:function(){c.meeting.self.disableScreenShare()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.share_screen_stop,slot:"start",iconPack:this.iconPack,t:this.t}),this.t("share_screen_stop")),T("dyte-button",{variant:"secondary",id:"expand-btn",iconPack:this.iconPack,t:this.t,onClick:function(){c.videoExpanded=!c.videoExpanded}},T("dyte-icon",{icon:this.videoExpanded?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize,slot:"start",iconPack:this.iconPack,t:this.t}),this.videoExpanded?this.t("Minimize Preview"):this.t("Expand Preview")))),T("slot",null))}},{key:"host",get:function(){return A(this)}}],[{key:"watchers",get:function(){return{participant:["participantChanged"]}}}]),e}();is.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);height:100%;width:100%;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--dyte-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-video-bg, 24 24 24) / var(--tw-bg-opacity))}::slotted(dyte-name-tag){position:absolute;
2left:var(--dyte-space-3, 12px);bottom:var(--dyte-space-3, 12px);opacity:0.8}#video-container{position:absolute;display:block;height:100%;width:100%}#video-container .fit-in-container{-o-object-fit:fill;object-fit:fill}video{height:100%;width:100%;-o-object-fit:contain;object-fit:contain}:host([variant='gradient']) ::slotted(dyte-audio-visualizer){position:absolute;top:var(--dyte-space-2, 8px);right:var(--dyte-space-2, 8px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));padding:var(--dyte-space-2, 8px)}:host([variant='gradient']) ::slotted(dyte-name-tag){bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);display:flex;width:100%;align-items:center;justify-content:center;text-align:center;background-color:transparent;background-image:linear-gradient(to top, var(--tw-gradient-stops));--tw-gradient-from:rgb(var(--dyte-colors-background-1000, 8 8 8));--tw-gradient-to:rgba(var(--dyte-colors-background-1000, 8 8 8) / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:transparent}:host([size='sm'][variant='gradient']) ::slotted(dyte-audio-visualizer){height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}video.visible{-webkit-animation:video-fadein 0.4s ease;animation:video-fadein 0.4s ease}#controls{display:none;position:absolute;top:var(--dyte-space-3, 12px);right:var(--dyte-space-3, 12px);align-items:center;justify-content:flex-end;gap:var(--dyte-space-2, 8px)}:host(:hover) #controls,:host(:active) #controls,:host(:focus-visible) #controls{display:flex}#full-screen-btn{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3{margin-top:var(--dyte-space-10, 40px);margin-bottom:var(--dyte-space-6, 24px);text-align:center;font-size:20px;font-weight:500}:host([size='sm']) h3{font-size:16px}#self-message{padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}:host(.isSelf) #self-view{flex:1 1 0%}:host(.isSelf) #video-container{position:static;aspect-ratio:auto;height:auto;width:50%;max-width:var(--dyte-space-96, 384px);border-radius:var(--dyte-border-radius-md, 8px);transition:0.6s ease}:host(.isSelf) #video-container.expand{width:60%;max-width:100%}.actions{display:flex;align-items:center;justify-content:center;gap:var(--dyte-space-2, 8px)}:host([size='sm'].isSelf) #video-container,:host([size='md'].isSelf) #video-container,:host([size='sm'].isSelf) #expand-btn,:host([size='md'].isSelf) #expand-btn{display:none}p{margin:var(--dyte-space-0, 0px);padding:var(--dyte-space-0, 0px)}.remote-control{z-index:10;height:100%;max-height:100%;flex:0 1 auto}#remote-control-self{position:absolute;top:var(--dyte-space-0, 0px);left:50%;z-index:10;width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:100%;box-sizing:border-box;display:flex;height:var(--dyte-space-8, 32px);align-items:center;overflow:hidden;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-warning, 255 205 7) / var(--tw-bg-opacity));font-size:12px;color:rgb(var(--dyte-colors-text-1000, 255 255 255));transform:translateX(-50%)}#remote-control-self p{padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);padding-top:var(--dyte-space-2, 8px);padding-bottom:var(--dyte-space-2, 8px)}#remote-control-self dyte-button{height:100%;border-radius:var(--dyte-border-radius-none, 0);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-bg-opacity));font-size:12px}:host([size='sm']) #remote-control-self{height:auto;flex-direction:column}:host([size='sm']) #remote-control-self dyte-button{width:100%;padding-top:var(--dyte-space-1, 4px);padding-bottom:var(--dyte-space-1, 4px)}:host([name-tag-position='bottom-right']) ::slotted(dyte-name-tag){left:auto;right:var(--dyte-space-3, 12px)}:host([name-tag-position='bottom-center']) ::slotted(dyte-name-tag){left:auto;right:auto}:host([name-tag-position='top-left']) ::slotted(dyte-name-tag){top:var(--dyte-space-3, 12px);bottom:auto}:host([name-tag-position='top-right']) ::slotted(dyte-name-tag){top:var(--dyte-space-3, 12px);right:var(--dyte-space-3, 12px);left:auto;bottom:auto}:host([name-tag-position='top-center']) ::slotted(dyte-name-tag){left:auto;right:auto;bottom:auto;top:var(--dyte-space-3, 12px)}@-webkit-keyframes video-fadein{0%{opacity:0;transform:scale(1.4) translateY(20px)}100%{opacity:1;transform:scale(1) translateY(0)}}@keyframes video-fadein{0%{opacity:0;transform:scale(1.4) translateY(20px)}100%{opacity:1;transform:scale(1) translateY(0)}}::slotted(dyte-network-indicator){position:absolute;right:var(--dyte-space-3, 12px);bottom:var(--dyte-space-3, 12px)}";var as=Object.freeze({__proto__:null,dyte_screenshare_view:is}),os=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.keyPressListener=function(e){"Escape"===e.key&&n.close()},this.selfJoinStageListener=function(){n.updateCanProduce(n.meeting)},this.selfStageLeftListener=function(){n.canProduceVideo=!1},this.selfJoinStageRejectedListener=function(){n.updateCanProduce(n.meeting)},this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.activeTab="connection",this.isMobileMainVisible=!1,this.networkStatus="good",this.canProduceVideo=!1}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){document.addEventListener("keydown",this.keyPressListener),this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e,t,n,r,i,a;this.keyPressListener&&document.removeEventListener("keydown",this.keyPressListener),this.poorConnectionListener&&(null===(e=this.meeting)||void 0===e||e.meta.removeListener("poorConnection",this.poorConnectionListener)),this.selfJoinStageListener&&(null===(t=this.meeting)||void 0===t||t.self.removeListener("joinStageRequestAccepted",this.selfJoinStageListener)),this.selfJoinStageRejectedListener&&(null===(n=this.meeting)||void 0===n||n.self.removeListener("joinStageRequestRejected",this.selfJoinStageRejectedListener)),this.selfJoinStageListener&&(null===(r=this.meeting)||void 0===r||r.self.removeListener("stageJoined",this.selfJoinStageListener)),this.selfStageLeftListener&&(null===(i=this.meeting)||void 0===i||i.self.removeListener("stageLeft",this.selfStageLeftListener)),this.selfJoinStageListener&&(null===(a=this.meeting)||void 0===a||a.self.removeListener("removedFromStage",this.selfJoinStageListener))}},{key:"meetingChanged",value:function(e){var t=this;null!=e&&(this.updateCanProduce(e),this.canProduceVideo?this.activeTab="video":this.activeTab="audio",this.poorConnectionListener=function(e){var n=e.score;n<7?t.networkStatus="poor":n<4&&(t.networkStatus="poorest"),setTimeout((function(){t.networkStatus="good"}),5e3)},e.meta.addListener("poorConnection",this.poorConnectionListener),e.self.addListener("joinStageRequestAccepted",this.selfJoinStageListener),e.self.addListener("joinStageRequestRejected",this.selfJoinStageRejectedListener),e.self.addListener("stageJoined",this.selfJoinStageListener),e.self.addListener("stageLeft",this.selfStageLeftListener),e.self.addListener("removedFromStage",this.selfJoinStageListener))}},{key:"updateCanProduce",value:function(e){var t=e.self,n=e.meta,r=e.stage,i="ALLOWED"===t.permissions.canProduceVideo,a="WEBINAR"===n.viewType,o="LIVESTREAM"===n.viewType;if(a||o){var s="CAN_REQUEST"===t.permissions.canProduceVideo;(i||s&&(a&&("ON_STAGE"===t.webinarStageStatus||"ACCEPTED_TO_JOIN_STAGE"===t.webinarStageStatus)||o&&("ON_STAGE"===r.status||"ACCEPTED_TO_JOIN_STAGE"===r.status)))&&(this.canProduceVideo=!0)}else this.canProduceVideo=i}},{key:"changeTab",value:function(e){this.activeTab=e,"sm"===this.size&&(this.isMobileMainVisible||(this.isMobileMainVisible=!0))}},{key:"close",value:function(){this.stateUpdate.emit({activeSettings:!1}),br.activeSettings=!1}},{key:"render",value:function(){var e=this;if(null==this.meeting)return null;var t={meeting:this.meeting,states:this.states||br,iconPack:this.iconPack,t:this.t};return T(C,null,T("aside",{class:{hide:this.isMobileMainVisible},part:"menu"},T("header",null,T("h2",null,this.t("settings"))),T("button",{type:"button",class:{active:"audio"===this.activeTab},onClick:function(){return e.changeTab("audio")}},this.t("audio"),T("div",{class:"right"},T("dyte-icon",{icon:this.iconPack.mic_on,iconPack:this.iconPack,t:this.t}),"sm"===this.size&&T("dyte-icon",{icon:this.iconPack.chevron_right,iconPack:this.iconPack,t:this.t}))),this.canProduceVideo&&T("button",{type:"button",class:{active:"video"===this.activeTab},onClick:function(){return e.changeTab("video")}},this.t("video"),T("div",{class:"right"},T("dyte-icon",{icon:this.iconPack.video_on,iconPack:this.iconPack,t:this.t}),"sm"===this.size&&T("dyte-icon",{icon:this.iconPack.chevron_right,iconPack:this.iconPack,t:this.t}))),T("button",{type:"none",title:"Your network condition is ".concat(this.networkStatus)},this.t("connection"),T("div",{class:"right"},T("dyte-icon",{icon:this.iconPack.wifi,class:this.networkStatus,iconPack:this.iconPack,t:this.t})))),T("main",{class:{active:this.isMobileMainVisible},part:"main-content"},"sm"===this.size&&T("header",null,T("dyte-button",{kind:"icon",class:"back-btn",onClick:function(){return e.isMobileMainVisible=!1},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.chevron_left,iconPack:this.iconPack,t:this.t})),T("h2",null,this.t("audio"===this.activeTab?"audio":"video"))),"audio"===this.activeTab&&T("dyte-settings-audio",Object.assign({},t)),"video"===this.activeTab&&T("dyte-settings-video",Object.assign({},t))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();os.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:flex;overflow:hidden;border-radius:var(--dyte-border-radius-md, 8px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255))}header{display:flex;align-items:center;justify-content:space-between;padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}.title{font-size:20px;line-height:1}.back-btn,.dismiss-btn{border-radius:var(--dyte-border-radius-sm, 4px);background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
2dow)}.back-btn:hover,.dismiss-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}aside{box-sizing:border-box;display:flex;min-width:var(--dyte-space-56, 224px);flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));padding-left:var(--dyte-space-2, 8px)}aside button{margin-top:var(--dyte-space-4, 16px);box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:space-between;border-top-left-radius:var(--dyte-border-radius-sm, 4px);border-bottom-left-radius:var(--dyte-border-radius-sm, 4px);padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px);padding-top:var(--dyte-space-3, 12px);padding-bottom:var(--dyte-space-3, 12px);background-color:transparent;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));cursor:default;font-size:16px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
2dow);border-width:var(--dyte-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px}aside button .right{display:flex;align-items:center}aside button .right dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}aside button .right dyte-icon:last-child{margin-left:var(--dyte-space-4, 16px)}aside button[type='button']{cursor:pointer;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}aside button[type='button']:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}aside button[type='button']{border-right:var(--dyte-border-width-md, 2px) solid transparent}aside button.active{--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-border-opacity));background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.2)}aside button.active:hover{background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.2)}dyte-icon.poor{--tw-text-opacity:1;color:rgba(var(--dyte-colors-warning, 255 205 7) / var(--tw-text-opacity))}dyte-icon.poorest{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}dyte-icon.good{--tw-text-opacity:1;color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-text-opacity))}main{display:flex;flex:1 1 0%;align-items:center;justify-content:center;padding-left:var(--dyte-space-6, 24px);padding-right:var(--dyte-space-6, 24px);box-sizing:border-box;width:100%}.dismiss-btn{position:absolute;top:var(--dyte-space-3, 12px);right:var(--dyte-space-3, 12px);height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}:host([size='sm']) aside{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}:host([size='sm']) .dismiss-btn{top:var(--dyte-space-5, 20px);right:var(--dyte-space-4, 16px)}:host([size='sm']) aside{width:100%;padding-left:var(--dyte-space-0, 0px)}:host([size='sm']) aside button{border-radius:var(--dyte-border-radius-none, 0)}:host([size='sm']) aside button.active{border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:transparent}:host([size='sm']) aside button.active:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([size='sm']) aside.hide{display:none}:host([size='sm']) main{display:none;padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}:host([size='sm']) main header{justify-content:center}:host([size='sm']) main header dyte-button{position:absolute;left:var(--dyte-space-4, 16px)}:host([size='sm']) main.active{display:block}";var ss=Object.freeze({__proto__:null,dyte_settings:os}),cs=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.variant="button",this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"toggleSettings",value:function(){var e;this.stateUpdate.emit({activeSettings:!(null===(e=this.states)||void 0===e?void 0:e.activeSettings),activeMoreMenu:!1}),br.activeSettings=!br.activeSettings,br.activeMoreMenu=!1}},{key:"render",value:function(){var e=this,t=this.t("settings");return T(C,{title:t},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,onClick:function(){return e.toggleSettings()},icon:this.iconPack.settings,label:t,variant:this.variant}))}}]),e}();cs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var us=Object.freeze({__proto__:null,dyte_settings_toggle:cs}),ls=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.join=(0,f.Z)((0,h.Z)().mark((function e(){var t,r;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""===n.displayName.trim()||n.isJoining){e.next=6;break}return n.isJoining=!0,null===(t=n.meeting)||void 0===t||t.self.setName(n.displayName),ur.setItem("dyte-display-name",n.displayName),e.next=6,null===(r=n.meeting)||void 0===r?void 0:r.joinRoom();case 6:case"end":return e.stop()}}),e)}))),this.meeting=void 0,this.size=void 0,this.config=Ue,this.iconPack=ar,this.t=ir(),this.displayName=void 0,this.isJoining=!1,this.canEditName=!0}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"meetingChanged",value:function(e){var t,n;null!=e&&(this.canEditName=null===(t=e.self.permissions.canEditDisplayName)||void 0===t||t,this.displayName=(null===(n=e.self.name)||void 0===n?void 0:n.trim())||"")}},{key:"render",value:function(){var e,t,n,r=this,i=""===(null===(e=this.displayName)||void 0===e?void 0:e.trim()),a={meeting:this.meeting,config:this.config,states:br,size:this.size,iconPack:this.iconPack,t:this.t};return T(C,null,T("div",{class:"container"},T(sr,{element:"dyte-participant-tile",defaults:a,props:{participant:null===(t=this.meeting)||void 0===t?void 0:t.self,size:"md"},childProps:{participant:null===(n=this.meeting)||void 0===n?void 0:n.self,size:"md"},deepProps:!0}),T("div",{class:"metadata"},""===this.displayName.trim()?T("div",{class:"name"},this.t("setup_screen.join_in_as")):T("div",{class:"label"},T("p",null,this.t("setup_screen.joining_as")),T("div",{class:"name"},Pa(this.displayName,20))),this.canEditName&&T("input",{placeholder:this.t("setup_screen.your_name"),value:this.displayName,autoFocus:!0,onInput:function(e){r.displayName=e.target.value},onKeyDown:function(e){"Enter"===e.key&&r.join()}}),T("dyte-button",{size:"lg",kind:"wide",onClick:this.join,disabled:i,iconPack:this.iconPack,t:this.t},this.isJoining?T("dyte-spinner",{iconPack:this.iconPack,t:this.t}):this.t("join")))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();ls.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);box-sizing:border-box;padding:var(--dyte-space-4, 16px);height:100%;min-height:100%;width:100%;display:flex;place-items:center;justify-content:center;--dyte-controlbar-button-background-color:rgb(var(--dyte-colors-background-700, 44 44 44))}.container{width:100%;max-width:1080px;display:flex;align-items:center;justify-content:space-evenly}.metadata{width:100%;max-width:var(--dyte-space-80, 320px)}.label{display:flex;flex-direction:column;align-items:center}.label p{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-2, 8px);font-size:14px}.name{margin:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-6, 24px);text-align:center;font-size:28px;font-weight:500;letter-spacing:-0.025em;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}input{margin-bottom:var(--dyte-space-6, 24px);display:block;height:var(--dyte-space-10, 40px);width:100%;max-width:var(--dyte-space-80, 320px);border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);color:rgb(var(--dyte-colors-text-1000, 255 255 255));box-sizing:border-box;font-size:16px;outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}input::-moz-placeholder{color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}input::placeholder{color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}input{border:var(--dyte-border-width-sm, 1px) solid rgb(var(--dyte-colors-background-600, 60 60 60))}input:focus{--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-border-opacity))}dyte-spinner{color:rgb(var(--dyte-colors-text-1000, 255 255 255));--icon-size:var(--dyte-space-8, 32px)}:host([size='sm']) .container,:host([size='md']) .container{height:100%;flex-direction:column;justify-content:space-evenly}dyte-camera-toggle{margin-left:var(--dyte-space-1\\.5, 6px)}dyte-participant-tile{height:auto;width:100%;max-width:var(--dyte-space-96, 384px)}";var ds=Object.freeze({__proto__:null,dyte_setup_screen:ls}),ps=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.close=function(){n.stateUpdate.emit({activeSidebar:!1,sidebar:n.defaultSection}),br.sidebar=n.tab},this.enabledSections=["none"],this.defaultSection="chat",this.meeting=void 0,this.states=void 0,this.config=Ue,this.iconPack=ar,this.t=ir(),this.size=void 0,this.view="default",this.tab=this.defaultSection}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e=this;this.viewChanged(this.view),this.statesChanged(this.states),this.meetingChanged(this.meeting),kr("sidebar",(function(){return e.statesChanged()}))}},{key:"disconnectedCallback",value:function(){var e,t;this.keydownListener&&document.removeEventListener("keydown",this.keydownListener),null===(t=null===(e=this.meeting)||void 0===e?void 0:e.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.updateEnabledSections)}},{key:"meetingChanged",value:function(e){var t,n;this.updateEnabledSections(e),null===(n=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===n||n.on("stageStatusUpdate",this.updateEnabledSections)}},{key:"statesChanged",value:function(e){var t=e||br;null!=(null===t||void 0===t?void 0:t.sidebar)&&(this.tab=t.sidebar)}},{key:"viewChanged",value:function(e){var t=this;"full-screen"===e&&(this.keydownListener=function(e){"Escape"===e.key&&t.close()},document.addEventListener("keydown",this.keydownListener))}},{key:"filterSections",value:function(e){if(!this.meeting.self.config)return e;var t=this.meeting.self.config;return e.filter((function(e){return t.controlBar.elements[e]}))}},{key:"viewSection",value:function(e){this.tab=e,this.stateUpdate.emit({activeSidebar:!0,sidebar:this.tab}),br.activeSidebar=!0,br.sidebar=this.tab}},{key:"updateEnabledSections",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.meeting,t=["none"];Vi(e)&&t.push("chat"),zi(e)&&t.push("participants"),Hi(e)&&t.push("plugins"),Fi(e)&&t.push("polls"),this.enabledSections=t}},{key:"render",value:function(){var e,t=this,n={meeting:this.meeting,config:this.config,states:this.states||br,size:this.size,t:this.t,iconPack:this.iconPack};return!1===(null===(e=this.states)||void 0===e?void 0:e.activeSidebar)||"none"===this.tab?null:T(C,null,"full-screen"===this.view&&[T("h3",{class:"title"},this.t("About Call")),T("div",{id:"mobile-header"},this.filterSections(this.enabledSections).map((function(e){return T("dyte-button",{key:e,variant:"ghost",class:{active:t.tab===e},onClick:function(){return t.viewSection(e)},iconPack:t.iconPack,t:t.t},t.t(e))})))],T("dyte-button",{variant:"ghost",kind:"icon",class:"close",onClick:this.close,"aria-label":this.t("Close"),iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.dismiss,iconPack:this.iconPack,t:this.t})),"full-screen"!==this.view&&T("h3",{class:"title"},this.t(this.tab)),"chat"===this.tab&&T(sr,{element:"dyte-chat",defaults:n}),"polls"===this.tab&&T(sr,{element:"dyte-polls",defaults:n}),"participants"===this.tab&&T(sr,{element:"dyte-participants",defaults:n}),"plugins"===this.tab&&T(sr,{element:"dyte-plugins",defaults:n}))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],states:["statesChanged"],view:["viewChanged"]}}}]),e}();ps.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;box-sizing:border-box;display:flex;width:100%;max-width:var(--dyte-space-80, 320px);flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden}.close{position:absolute;top:var(--dyte-space-3, 12px);left:var(--dyte-space-3, 12px)}.title{margin-left:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-0, 0px);margin-top:var(--dyte-space-5, 20px);margin-bottom:var(--dyte-space-5, 20px);-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:var(--dyte-space-0, 0px);text-align:center;font-size:16px;font-weight:400}#mobile-header{margin-top:var(--dyte-space-2, 8px);display:flex;align-items:center;justify-content:space-evenly;border-bottom:var(--dyte-border-width-sm, 1px) solid rgb(var(--dyte-colors-background-600, 60 60 60))}#mobile-header dyte-button{border-bottom:var(--dyte-border-width-md, 2px) solid transparent;border-radius:var(--dyte-border-radius-none, 0)}#mobile-header dyte-button:hover{background-color:transparent}#mobile-header dyte-button.active{border-color:rgb(var(--dyte-colors-brand-400, 53 110 253))}dyte-chat,dyte-participants,dyte-plugins{flex:1}:host([view='sidebar']){margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);border-radius:var(--dyte-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}
2:host([view='full-screen']){position:absolute;top:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);z-index:50;max-width:100%;border:none}";var hs=Object.freeze({__proto__:null,dyte_sidebar:ps}),fs=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.setHostDimensions=function(){var e=n.host,t=e.clientWidth,r=e.clientHeight;n.dimensions={width:t,height:r}},this.participants=[],this.aspectRatio="16:9",this.gap=8,this.size=void 0,this.meeting=void 0,this.states=void 0,this.config=Ue,this.iconPack=ar,this.t=ir(),this.dimensions={width:0,height:0}}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.resizeObserver=new Hr(this.setHostDimensions),this.resizeObserver.observe(this.host)}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()}},{key:"render",value:function(){var e={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},t=ma({dimensions:this.dimensions,count:this.participants.length,aspectRatio:this.aspectRatio,gap:this.gap}),n=t.width,r=t.height,i=t.getPosition;return T(C,null,this.participants.map((function(t,a){var o=i(a),s=o.top,c=o.left;return T(sr,{element:"dyte-participant-tile",defaults:e,props:{participant:t,style:{position:"absolute",top:"".concat(s,"px"),left:"".concat(c,"px"),width:"".concat(n,"px"),height:"".concat(r,"px")},key:t.id,"data-participant":t.id},childProps:{participant:t},deepProps:!0})})),T("slot",null))}},{key:"host",get:function(){return A(this)}}]),e}();fs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:block;height:100%;width:100%}";var vs=Object.freeze({__proto__:null,dyte_simple_grid:fs}),ms=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.layout="row",this.participants=[],this.pinnedParticipants=[],this.aspectRatio="16:9",this.gap=8,this.size=void 0,this.meeting=void 0,this.states=void 0,this.config=Ue,this.iconPack=ar,this.t=ir(),this.gridSize=ya}return(0,c.Z)(e,[{key:"render",value:function(){var e=this,t={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},n=this.participants.filter((function(t){return e.pinnedParticipants.some((function(e){return e.id!=t.id}))}));return T(C,null,T("main",{part:"main"},T(sr,{element:"dyte-simple-grid",defaults:t,props:{part:"main-grid",participants:this.pinnedParticipants,aspectRatio:this.aspectRatio,gap:this.gap,size:this.size}})),n.length>0&&T("aside",{part:"aside",class:this.gridSize.spotlight?"grid-width-".concat(this.gridSize.spotlight):"grid-width-md"},T(sr,{element:"dyte-simple-grid",defaults:t,props:{part:"aside-grid",participants:n,aspectRatio:this.aspectRatio,gap:this.gap,size:this.size}})))}},{key:"host",get:function(){return A(this)}}]),e}();ms.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;height:100%;width:100%}main{flex:1 1 0%}.grid-width-sm{width:25%}.grid-width-md{width:50%}.grid-width-lg{width:66.666667%}:host([size='sm']),:host([size='md']){flex-direction:column}:host([size='md']) aside{max-height:var(--dyte-space-96, 384px);width:100%;max-width:100%}:host([size='md']) .grid-width-sm{height:25%}:host([size='md']) .grid-width-md{height:50%}:host([size='md']) .grid-width-lg{height:66.666667%}:host([size='sm']) aside{max-height:var(--dyte-space-96, 384px);width:100%;max-width:100%}:host([size='sm']) .grid-width-sm,:host([size='sm']) .grid-width-md,:host([size='sm']) .grid-width-lg{height:50%}:host([size='xl']) .grid-width-sm,:host([size='xl']) .grid-width-md,:host([size='xl']) .grid-width-lg{width:400px}:host([layout='column']){flex-direction:column}:host([layout='column']) main{flex:4}:host([layout='column']) aside{flex:2;max-width:100%;width:100%}";var gs=Object.freeze({__proto__:null,dyte_spotlight_grid:ms}),ys=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("slot",null))}}]),e}();ys.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block;position:relative;overflow:hidden}";var bs=Object.freeze({__proto__:null,dyte_stage:ys}),ks=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.stageCallback=(0,f.Z)((0,h.Z)().mark((function e(){var t,r,i,a,o,s,c,u;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ON_STAGE"!==(u=null===(t=n.meeting.stage)||void 0===t?void 0:t.status)){e.next=4;break}return e.next=4,null===(i=null===(r=null===n||void 0===n?void 0:n.meeting)||void 0===r?void 0:r.stage)||void 0===i?void 0:i.leave();case 4:"OFF_STAGE"===u&&(null===(o=null===(a=null===n||void 0===n?void 0:n.meeting)||void 0===a?void 0:a.stage)||void 0===o||o.requestAccess(),$r(n.meeting)&&n.stateUpdate.emit({activeJoinStage:!0})),"REQUESTED_TO_JOIN_STAGE"===u&&(null===(c=null===(s=null===n||void 0===n?void 0:n.meeting)||void 0===s?void 0:s.stage)||void 0===c||c.cancelRequestAccess());case 6:case"end":return e.stop()}}),e)}))),this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.stageStatus="OFF_STAGE",this.state={label:"",disabled:!1,icon:""},this.t=ir()}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"stageStatusHandler",value:function(e,t){this.stageStatus=t,"ACCEPTED_TO_JOIN_STAGE"===t&&(e.self.setupTracks({audio:!1,video:!1}),this.stateUpdate.emit({activeJoinStage:!0})),this.state=this.getState()}},{key:"disconnectedCallback",value:function(){var e,t,n=this;null===(t=null===(e=this.meeting)||void 0===e?void 0:e.stage)||void 0===t||t.removeListener("stageStatusUpdate",(function(e){return n.stageStatusHandler(n.meeting,e)}))}},{key:"meetingChanged",value:function(e){var t,n,r,i,a=this;null!=e&&(this.stageStatus=null===(t=e.stage)||void 0===t?void 0:t.status,this.stageStatusHandler(e,null===(n=e.stage)||void 0===n?void 0:n.status),null===(i=null===(r=this.meeting)||void 0===r?void 0:r.stage)||void 0===i||i.on("stageStatusUpdate",(function(t){return a.stageStatusHandler(e,t)})))}},{key:"getState",value:function(){var e="",t="",n=!1;switch(this.stageStatus){case"ON_STAGE":t=this.iconPack.leave_stage,e="Leave Livestream",n=!1;break;case"ACCEPTED_TO_JOIN_STAGE":t=this.iconPack.join_stage,e="Join Livestream",n=!0;break;case"REQUESTED_TO_JOIN_STAGE":t=this.iconPack.join_stage,e="Requested",n=!1;break;default:t=this.iconPack.join_stage,e="Join Livestream",n=!1}return{label:e,disabled:n,icon:t}}},{key:"render",value:function(){if(function(e){var t,n,r,i,a,o,s,c;return!!Gr(e)&&("NOT_ALLOWED"!==(null===(n=null===(t=null===e||void 0===e?void 0:e.self)||void 0===t?void 0:t.permissions)||void 0===n?void 0:n.canProduceAudio)||"NOT_ALLOWED"!==(null===(i=null===(r=null===e||void 0===e?void 0:e.self)||void 0===r?void 0:r.permissions)||void 0===i?void 0:i.canProduceScreenshare)||"NOT_ALLOWED"!==(null===(o=null===(a=null===e||void 0===e?void 0:e.self)||void 0===a?void 0:a.permissions)||void 0===o?void 0:o.canProduceVideo)||(null===(c=null===(s=null===e||void 0===e?void 0:e.self)||void 0===s?void 0:s.permissions)||void 0===c?void 0:c.canLivestream))}(this.meeting))return T(C,{title:this.state.label},T("dyte-tooltip",{placement:"top",kind:"block",label:this.state.label,delay:600,part:"tooltip",iconPack:this.iconPack,t:this.t},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,variant:this.variant,label:this.state.label,icon:this.state.icon,onClick:this.stageCallback,disabled:this.state.disabled,showWarning:!1})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();ks.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var _s=Object.freeze({__proto__:null,dyte_stage_toggle:ks}),ws=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.type="text",this.placeholder="",this.disabled=!1,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.stateUpdate.emit({abc:!1}),br.abc=!1}},{key:"value",get:function(){return this.input.value}},{key:"render",value:function(){var e=this;return T(C,null,T("input",{ref:function(t){return e.input=t}
2,type:this.type,placeholder:this.placeholder,disabled:this.disabled}))}}]),e}();ws.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}input{display:block;height:var(--dyte-space-10, 40px);padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);font-size:14px;border-width:var(--dyte-border-width-md, 2px);border-style:solid;border-color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64));--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88))}input::-moz-placeholder{color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}input::placeholder{color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}input:focus{color:rgb(var(--dyte-colors-text-1000, 255 255 255))}input{border-radius:var(--dyte-border-radius-sm, 4px);outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}input:focus{--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-border-opacity))}input:disabled{cursor:not-allowed}";var xs=Object.freeze({__proto__:null,dyte_text_field:ws}),Ss=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.disconnectMeeting=function(e){var t;null!=e&&null!=n.countListener&&(null===(t=e.livestream)||void 0===t||t.removeListener("viewerCountUpdate",n.countListener))},this.meeting=void 0,this.iconPack=ar,this.t=ir(),this.viewerCount=0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){this.disconnectMeeting(this.meeting)}},{key:"meetingChanged",value:function(e,t){var n,r=this;this.disconnectMeeting(t),null!=e&&(this.countListener=function(){var t;r.viewerCount=null===(t=e.livestream)||void 0===t?void 0:t.viewerCount},this.countListener(),null===(n=e.livestream)||void 0===n||n.addListener("viewerCountUpdate",this.countListener))}},{key:"render",value:function(){return Gr(this.meeting)?T(C,{tabIndex:0,role:"log","aria-label":"".concat(this.viewerCount," ").concat(this.t("viewers"))},T("dyte-icon",{icon:this.iconPack.viewers,tabIndex:-1,"aria-hidden":!0,part:"icon",iconPack:this.iconPack,t:this.t}),this.viewerCount," ",this.t("viewers")):null}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Ss.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:inline-flex;height:var(--dyte-space-10, 40px);-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center}:host([size='sm']){margin-left:var(--dyte-space-1, 4px);margin-right:var(--dyte-space-1, 4px);font-size:12px}dyte-icon{margin-right:var(--dyte-space-1, 4px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}:host([size='sm']) dyte-icon{height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}";var Es=Object.freeze({__proto__:null,dyte_viewer_count:Ss}),Ts=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.meeting=void 0,this.config=Ue,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("slot",null,T("div",{class:"centered",part:"content"},T("dyte-logo",{meeting:this.meeting,config:this.config,part:"logo",t:this.t}),T("p",null,this.t("waitlist.body_text")))))}}]),e}();Ts.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.centered{display:flex;flex-direction:column;align-items:center}dyte-logo{margin-bottom:var(--dyte-space-8, 32px);height:var(--dyte-space-12, 48px)}p{font-size:16px;border-radius:var(--dyte-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding-left:var(--dyte-space-8, 32px);padding-right:var(--dyte-space-8, 32px);padding-top:var(--dyte-space-4, 16px);padding-bottom:var(--dyte-space-4, 16px);color:rgb(var(--dyte-colors-text-1000, 255 255 255))}";var Ps=Object.freeze({__proto__:null,dyte_waiting_screen:Ts}),Cs=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.requestToJoinAcceptedListener=function(){n.stageStatus="ACCEPTED"},this.requestToJoinRejectedListener=function(){n.stageStatus="DENIED"},this.stageJoinedListener=function(){n.stageStatus="ACCEPTED"},this.removeFromStageListener=function(){n.stageStatus="NOT_REQUESTED"},this.selfStageLeftListener=function(){n.stageStatus="NOT_REQUESTED"},this.requestStageListener=function(){n.stageStatus="PENDING"},this.stageCallback=(0,f.Z)((0,h.Z)().mark((function e(){var t,r;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=null===(t=n.meeting)||void 0===t?void 0:t.self)&&(n.requestProduce||n.canPresent)){e.next=3;break}return e.abrupt("return");case 3:if("PENDING"!==n.stageStatus){e.next=7;break}return e.next=6,r.withdrawRequestToJoinStage();case 6:return e.abrupt("return");case 7:if("ACCEPTED"!==n.stageStatus){e.next=12;break}return e.next=10,r.leaveStage();case 10:return n.stageStatus="NOT_REQUESTED",e.abrupt("return");case 12:if(!n.canPresent){e.next=18;break}return e.next=15,r.joinStage();case 15:n.stageStatus="ACCEPTED",e.next=21;break;case 18:return e.next=20,r.requestToJoinStage();case 20:n.stageStatus="PENDING";case 21:case"end":return e.stop()}}),e)}))),this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.stageStatus="NOT_REQUESTED",this.canPresent=!1,this.requestProduce=!1}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting),this.meeting.self.addListener("joinStageRequestAccepted",this.requestToJoinAcceptedListener),this.meeting.self.addListener("joinStageRequestRejected",this.requestToJoinRejectedListener),this.meeting.self.addListener("stageJoined",this.stageJoinedListener),this.meeting.self.addListener("removedFromStage",this.removeFromStageListener),this.meeting.self.addListener("stageLeft",this.selfStageLeftListener),this.meeting.self.addListener("peerRequestToJoinStage",this.requestStageListener)}},{key:"disconnectedCallback",value:function(){this.meeting.self.removeListener("joinStageRequestAccepted",this.requestToJoinAcceptedListener),this.meeting.self.removeListener("joinStageRequestRejected",this.requestToJoinRejectedListener),this.meeting.self.removeListener("removedFromStage",this.removeFromStageListener),this.meeting.self.removeListener("stageJoined",this.stageJoinedListener),this.meeting.self.removeListener("stageLeft",this.selfStageLeftListener),this.meeting.self.removeListener("peerRequestToJoinStage",this.requestStageListener)}},{key:"meetingChanged",value:function(e){null!=e&&(this.requestProduce=e.self.permissions.requestProduce,this.canPresent=e.self.permissions.canPresent,(this.canPresent||"ON_STAGE"===e.self.webinarStageStatus)&&(this.stageStatus="ACCEPTED"))}},{key:"getState",value:function(){var e="",t="",n="",r={},i=!1;return"PENDING"===this.stageStatus?(t=this.t("stage_request.cancel_request"),e=this.t("stage_request.pending_tip"),n=this.iconPack.leave_stage,r["red-icon"]=!1):"ACCEPTED"===this.stageStatus?(t=this.t("stage_request.leave_stage"),e=this.t("stage_request.leave_tip"),n=this.iconPack.leave_stage,r["red-icon"]=!1,i=!1):"DENIED"===this.stageStatus?(t=this.t("stage_request.denied"),e=this.t("stage_request.denied_tip"),n=this.iconPack.join_stage,r["red-icon"]=!1,i=!0):(t=this.t("stage_request.request"),e=this.canPresent?this.t("stage_request.request"):this.t("stage_request.request_tip"),n=this.iconPack.join_stage,i=!1),{tooltipLabel:e,label:t,icon:n,classList:r,disabled:i}}},{key:"render",value:function(){if(!this.requestProduce&&!this.canPresent)return null;if("WEBINAR"!==this.meeting.self.config.viewType)return null;var e=this.getState(),t=e.tooltipLabel,n=e.label,r=e.icon,i=e.classList,a=e.disabled;return T(C,{title:n},T("dyte-tooltip",{placement:"top",kind:"block",label:t,delay:600,part:"tooltip",iconPack:this.iconPack,t:this.t},T("dyte-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,t:this.t,variant:this.variant,label:n,icon:r,class:i,onClick:this.stageCallback,disabled:a,showWarning:!1})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Cs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}";var Rs=Object.freeze({__proto__:null,dyte_webinar_stage_toggle:Cs}),Zs=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onParticipantsAdd=I(this,"participantsAdd",7),this.onParticipantDelete=I(this,"participantDelete",7),this.onRoomJoin=I(this,"roomJoin",7),this.deleteRoom=I(this,"delete",7),this.updateRoom=I(this,"update",7),this.reset=function(){n.editingTitleRoomId=null,n.newTitle=null},this.onEditClick=function(){if(n.editingTitleRoomId){if(n.newTitle.length<3)return;n.roomTitle=n.newTitle,n.updateRoom.emit({title:n.newTitle,id:n.editingTitleRoomId}),n.glowCard(),n.reset()}else n.editingTitleRoomId=n.room.id,je((function(){n.inputTextEl.focus(),n.inputTextEl.select()}))},this.onDrop=function(e){e.currentTarget instanceof HTMLParagraphElement&&(e.currentTarget.classList.remove("drop-zone-active"),n.onAssign())},this.onDragOver=function(e){e.currentTarget instanceof HTMLParagraphElement&&(e.currentTarget.classList.add("drop-zone-active"),e.preventDefault())},this.meeting=void 0,this.assigningParticipants=void 0,this.mode=void 0,this.states=void 0,this.allowDelete=!0,this.iconPack=ar,this.t=ir(),this.isDragMode=!1,this.room=void 0,this.defaultExpanded=!1,this.editingTitleRoomId=null,this.newTitle=null,this.showExpandedCard=!1,this.glowingCard=!1}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e;this.allParticipants=ai(this.meeting),this.permissions=this.meeting.self.permissions.connectedMeetings,this.showExpandedCard=this.defaultExpanded,this.roomTitle=this.room.isParent?this.t("breakout_rooms.main_room"):null===(e=this.room)||void 0===e?void 0:e.title,this.canEditMeetingTitle=this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&!this.meeting.connectedMeetings.isActive}},{key:"onDragLeave",value:function(e){e.currentTarget instanceof HTMLParagraphElement&&e.currentTarget.classList.remove("drop-zone-active")}},{key:"getAssignmentHint",value:function(){return this.assigningParticipants&&this.isDragMode?this.t("breakout_rooms.drag_drop_participants"):this.assigningParticipants?this.t("breakout_rooms.click_drop_participants"):0===this.room.participants.length?this.t("breakout_rooms.none_assigned"):void 0}},{key:"toggleCardDisplay",value:function(){this.showExpandedCard=!this.showExpandedCard}},{key:"glowCard",value:function(){var e=this;this.glowingCard=!0,setTimeout((function(){e.glowingCard=!1}),2e3)}},{key:"onAssign",value:function(){this.onParticipantsAdd.emit(),this.glowCard()}},{key:"onJoin",value:function(){this.onRoomJoin.emit()}},{key:"onTitleChanged",value:function(e){"Enter"===e.key&&(this.newTitle=e.target.value,this.onEditClick())}},{key:"renderPeer",value:function(e){var t=this.allParticipants.find((function(t){return ii(t)===ii(e)})).displayPictureUrl,n=Ra(e.displayName||"");return T("div",{class:"peer-ui-container"},T("dyte-avatar",{participant:{name:n,picture:t},size:"sm"}),T("p",{class:"name",title:n},Pa(n,16),this.meeting.self.userId===e.id&&" (".concat(this.t("you"),")")))}},{key:"renderExpandedCardMaybe",value:function(){var e=this;if(this.showExpandedCard&&!this.room.isParent&&this.getAssignmentHint()&&this.permissions.canAlterConnectedMeetings)return T("div",{class:"message-container"},T("p",{class:{"compact-height":0!==this.room.participants.length},onClick:function(){return e.onAssign()},onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop},this.getAssignmentHint()))}},{key:"renderParticipantsMaybe",value:function(){var e=this;if(this.showExpandedCard&&!this.room.isParent&&0!==this.room.participants.length)return T("div",{class:"participant-list",onClick:function(){e.onAssign()}},this.room.participants.map((function(t){return T("div",{class:"participant-item",role:"listitem",key:t.id},e.renderPeer(t),e.permissions.canAlterConnectedMeetings&&T("dyte-icon",{class:"show-on-hover",icon:e.iconPack.dismiss,iconPack:e.iconPack,t:e.t,onClick:function(){e.onParticipantDelete.emit(t)}}))})))}},{key:"render",value:function(){var e,t,n,r=this;return T(C,null,T("div",{class:{"assign-mode":this.assigningParticipants,"selector-mode":!this.assigningParticipants,"glowing-card":this.glowingCard}},T("div",{class:"header"},T("input",{ref:function(e){return r.inputTextEl=e},placeholder:this.t("breakout_rooms.room_name"),disabled:!(this.editingTitleRoomId===this.room.id),value:this.roomTitle,minlength:3,onChange:function(e){r.newTitle=e.target.value},onKeyPress:function(e){return r.onTitleChanged(e)},class:{"editing-enabled":this.editingTitleRoomId===this.room.id},style:{width:"".concat(this.roomTitle.length+1,"ch")}}),this.editingTitleRoomId!==this.room.id&&T("span",{class:"participant-count"},"(",T("dyte-icon",{icon:this.iconPack.people,iconPack:this.iconPack,t:this.t}),null!==(n=null===(t=null===(e=this.room)||void 0===e?void 0:e.participants)||void 0===t?void 0:t.length)&&void 0!==n?n:"0",")"),this.canEditMeetingTitle&&T("dyte-tooltip",{label:this.editingTitleRoomId===this.room.id?this.t("breakout_rooms.save_room_name"):this.t("breakout_rooms.edit_room_name"),iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.editingTitleRoomId===this.room.id?this.iconPack.checkmark:this.iconPack.edit,iconPack:this.iconPack,t:this.t,class:"show-on-hover",onClick:this.onEditClick})),T("div",{class:"rooms-container"},this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&this.allowDelete&&T("dyte-tooltip",{label:this.t("Delete Room"),class:"danger",iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.delete,class:"show-on-hover",iconPack:this.iconPack,t:this.t,onClick:function(){r.deleteRoom.emit()}})),this.assigningParticipants&&this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&T("dyte-button",{iconPack:this.iconPack,t:this.t,kind:"button",variant:"ghost",class:"assign-button",size:"md",onClick:function(){return r.onAssign()}},this.t("breakout_rooms.assign")),"edit"===this.mode&&!this.assigningParticipants&&this.permissions.canSwitchConnectedMeetings&&T("dyte-button",{iconPack:this.iconPack,t:this.t,kind:"button",variant:"ghost",class:"assign-button",size:"md",disabled:this.room.id===this.meeting.meta.roomName,onClick:function(){return r.onJoin()}},this.room.id===this.meeting.meta.roomName?this.t("joined"):this.t("join")),!this.room.isParent&&T("dyte-icon",{icon:this.showExpandedCard?this.iconPack.chevron_up:this.iconPack.chevron_down,iconPack:this.iconPack,t:this.t,onClick:function(){return r.toggleCardDisplay()}}))),this.renderExpandedCardMaybe(),this.renderParticipantsMaybe()))}}]),e}();Zs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-radius:var(--dyte-border-radius-sm, 4px)}@-webkit-keyframes bg-glow{25%{background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.2)}50%{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}75%{background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.2)}}@keyframes bg-glow{25%{background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.2)}50%{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}75%{background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.2)}}.glowing-card{-webkit-animation:bg-glow 0.8s;animation:bg-glow 0.8s}.selector-mode,.assign-mode{display:flex;flex-direction:column;align-items:center;padding:var(--dyte-space-2, 8px);cursor:pointer}.selector:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.show-on-hover{display:none}.header{width:100%;display:flex;align-items:center}.header dyte-icon{margin-left:var(--dyte-space-2, 8px);height:var(--dyte-space-5, 20px);cursor:pointer}.header .danger{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}.header .hide{display:none}.header .rooms-container{display:flex;flex-grow:1;flex-direction:row;align-items:center;justify-content:flex-end}.header input{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--dyte-space-1, 4px);color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));max-width:var(--dyte-space-36, 144px);font-size:14px;font-weight:500;border-radius:var(--dyte-border-radius-sm, 4px);border-width:var(--dyte-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px;border-bottom-width:var(--dyte-border-width-sm, 1px);border-style:solid;--tw-border-opacity:1;border-bottom-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-border-opacity))}.header input:disabled{overflow-x:visible;border-radius:var(--dyte-border-radius-none, 0);border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:transparent}.header input:invalid{border-bottom-width:var(--dyte-border-width-sm, 1px);border-style:dashed;--tw-border-opacity:1;border-bottom-color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-border-opacity))}.header input.editing-enabled{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.header .participant-count{display:flex;align-items:center;font-size:14px;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88))}.header .participant-count dyte-icon{margin:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-0\\.5, 2px);width:var(--dyte-space-3, 12px)}.header .assign-button{height:var(--dyte-space-6, 24px);--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity));-webkit-text-decoration-line:underline;text-decoration-line:underline}.header .assign-button:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.participant-list{display:grid;flex-grow:1;grid-template-columns:repeat(2, minmax(0, 1fr));gap:var(--dyte-space-2, 8px);margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);width:100%;border-radius:var(--dyte-border-radius-sm, 4px)}.participant-list::-webkit-scrollbar{width:var(--dyte-space-1\\.5, 6px)}.participant-list::-webkit-scrollbar-thumb{border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.participant-list::-webkit-scrollbar-track{border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.participant-item{display:flex;align-items:center;justify-content:space-between;margin-right:var(--dyte-space-2, 8px);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px)}.participant-item:hover{border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}
2.selector-mode:hover .show-on-hover{display:flex}.message-container{margin:var(--dyte-space-0, 0px);display:flex;width:100%;padding-top:var(--dyte-space-2, 8px);padding-bottom:var(--dyte-space-2, 8px)}.message-container p{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-0, 0px);height:var(--dyte-space-20, 80px);display:flex;width:100%;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-sm, 4px);font-size:12px;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64));border-style:dashed;--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-border-opacity))}.message-container p:hover{--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-border-opacity));background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.25)}.message-container .drop-zone-active{--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-border-opacity));background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / 0.25)}dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}.show-on-hover{margin-left:var(--dyte-space-4, 16px);height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px);display:none}:host(:hover) .show-on-hover{display:flex}.peer-ui-container{position:relative;display:flex;align-items:center;gap:var(--dyte-space-2, 8px);height:var(--dyte-space-10, 40px);cursor:pointer;border-radius:var(--dyte-border-radius-sm, 4px);color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88))}.peer-ui-container dyte-avatar{height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px);font-size:14px;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.peer-ui-container .name{font-size:14px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}";var Ms=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onSelectedParticipantsUpdate=I(this,"selectedParticipantsUpdate",7),this.onAllToggled=I(this,"allParticipantsToggleUpdate",7),this.onParticipantsDragging=I(this,"participantsDragging",7),this.onSearchInput=function(e){n.search=e.target.value},this.onDragStart=function(e){n.isDragging=!0,n.onParticipantsDragging.emit(!0),n.updateSelectedParticipants(e,!0)},this.onDragEnd=function(e){n.isDragging=!1,n.onParticipantsDragging.emit(!1),n.updateSelectedParticipants(e,!1)},this.onClick=function(e){var t=n.selectedParticipantIds.includes(ii(e));n.updateSelectedParticipants(e,!t)},this.onToggleAll=function(e){var t=e?n.participantsToShow.map(ii):[];n.onAllToggled.emit(t)},this.meeting=void 0,this.participantIds=[],this.iconPack=ar,this.t=ir(),this.search="",this.participantsToShow=[],this.selectedParticipantIds=[],this.isDragging=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting),this.searchChanged(this.search)}},{key:"disconnectedCallback",value:function(){this.meeting}},{key:"updateSelectedParticipants",value:function(e,t){var n=ii(e),r=[];r=t&&!this.selectedParticipantIds.includes(n)?[].concat((0,m.Z)(this.selectedParticipantIds),[n]):(0,m.Z)(this.selectedParticipantIds.filter((function(e){return e!==n}))),this.onSelectedParticipantsUpdate.emit(r)}},{key:"meetingChanged",value:function(e){null!=e&&this.getParticipants(this.search)}},{key:"participantsChanged",value:function(){this.getParticipants(this.search)}},{key:"searchChanged",value:function(e){this.getParticipants(e)}},{key:"getParticipants",value:function(e){var t=this,n=ai(this.meeting);this.participantsToShow=n.filter((function(n){var r;return t.participantIds.includes(ii(n))&&(null!==(r=n.displayName)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())}))}},{key:"renderPeer",value:function(e){var t=Ra(e.displayName||"");return T("div",{class:"peer-ui-container"},T("dyte-avatar",{participant:{name:e.displayName,picture:e.displayPictureUrl},size:"sm"}),T("p",{class:"name",title:t},Pa(t,16),this.meeting.self.userId===e.id&&" (".concat(this.t("you"),")")))}},{key:"render",value:function(){var e=this;return T(C,null,T("div",{class:"search-wrapper"},T("div",{class:"search",part:"search"},T("dyte-icon",{icon:this.iconPack.search,part:"search-icon",iconPack:this.iconPack,t:this.t,class:"search-icon"}),T("input",{type:"search",autocomplete:"off",placeholder:"Search",onInput:this.onSearchInput,part:"search-input"})),T("slot",{name:"shuffle-button"})),T("div",{class:"header"},T("div",{class:"title-wrapper"},T("span",null,this.t("breakout_rooms.main_room")),T("span",{class:"participant-count"},"(",T("dyte-icon",{icon:this.iconPack.people,iconPack:this.iconPack,t:this.t}),this.participantsToShow.length,")")),0!==this.selectedParticipantIds.length&&T("dyte-tooltip",{label:this.t("breakout_rooms.select_all"),iconPack:this.iconPack,t:this.t},T("input",{type:"checkbox",checked:this.selectedParticipantIds.length===this.participantsToShow.length,onChange:function(t){return e.onToggleAll(!!t.target.checked)}}))),T("div",{class:"ctr scrollbar",part:"container"},this.participantsToShow.length>0&&T("ul",{class:"participants",part:"participants"},this.participantsToShow.map((function(t){return T("li",{class:{"participant-item":!0,dragging:e.isDragging},onClick:function(){return e.onClick(t)},onDragStart:function(){return e.onDragStart(t)},onDragEnd:function(){return e.onDragEnd(t)},draggable:0===e.selectedParticipantIds.length,role:"listitem",key:t.id},e.renderPeer(t),!e.isDragging&&T("input",{type:"checkbox",class:{"hide-checkbox":0===e.selectedParticipantIds.length},checked:e.selectedParticipantIds.includes(ii(t))}))}))),0===this.participantsToShow.length&&this.search.length>0&&T("div",{class:"empty-message"},this.t("participants.empty_search_results")),0===this.participantsToShow.length&&0===this.search.length&&T("div",{class:"empty-room"},T("dyte-icon",{icon:this.iconPack.people_checked,part:"search-icon",iconPack:this.iconPack,t:this.t,class:"search-icon"}),T("p",null,this.t("breakout_rooms.all_assigned")),T("span",null,this.t("breakout_rooms.empty_main_room")))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],participantIds:["participantsChanged"],search:["searchChanged"]}}}]),e}();Ms.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{display:flex;height:100%;flex-direction:column;font-size:14px}:host input[type='checkbox']{margin:var(--dyte-space-0, 0px);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--dyte-border-radius-sm, 4px);position:relative;height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px);border-width:var(--dyte-border-width-sm, 1px);border-style:solid;border-color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}:host input[type='checkbox']:checked{--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}
2:host input[type='checkbox']:checked::before{position:absolute;top:1px;left:1px;height:var(--dyte-space-3, 12px);width:var(--dyte-space-3, 12px);background-color:rgb(var(--dyte-colors-text-1000, 255 255 255));content:'';-webkit-clip-path:polygon(5% 60%, 35% 93%, 100% 19%, 86% 4%, 36% 62%, 19% 44%);clip-path:polygon(5% 60%, 35% 93%, 100% 19%, 86% 4%, 36% 62%, 19% 44%)}*{box-sizing:border-box}.participants{margin-top:var(--dyte-space-2, 8px);padding:var(--dyte-space-0, 0px)}.ctr{box-sizing:border-box;padding-top:var(--dyte-space-0, 0px);padding-bottom:var(--dyte-space-0, 0px);overflow-y:auto;flex-grow:1;flex-basis:0}.empty-message{margin-top:var(--dyte-space-10, 40px);margin-bottom:var(--dyte-space-10, 40px);text-align:center;font-size:14px;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.empty-room{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--dyte-space-2, 8px);height:100%;text-align:center;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.empty-room dyte-icon{height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px)}.empty-room p{font-size:16px;font-weight:500;margin:var(--dyte-space-0, 0px)}.empty-room span{font-size:12px;color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}.search-wrapper{margin-bottom:var(--dyte-space-1, 4px);display:flex;align-items:center;gap:var(--dyte-space-2, 8px)}.search{position:-webkit-sticky;position:sticky;box-sizing:border-box;display:flex;align-items:center;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-0, 0px);height:var(--dyte-space-8, 32px)}.search .search-icon{margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}.search input{box-sizing:border-box;width:100%;padding-right:var(--dyte-space-2, 8px);border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:inherit;color:rgb(var(--dyte-colors-text-1000, 255 255 255));outline:2px solid transparent;outline-offset:2px;border-radius:var(--dyte-border-radius-sm, 4px);font-size:14px}.search input::-moz-placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.search input::placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.header{margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-1\\.5, 6px);height:var(--dyte-space-9, 36px);padding-top:var(--dyte-space-3, 12px);padding-bottom:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-0\\.5, 2px);border-bottom-width:var(--dyte-border-width-sm, 1px);border-top-width:var(--dyte-border-width-none, 0);border-right-width:var(--dyte-border-width-none, 0);border-left-width:var(--dyte-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-bottom-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-border-opacity));font-size:12px;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));display:flex;align-items:center;justify-content:space-between}.title-wrapper{display:flex;align-items:center;gap:var(--dyte-space-2, 8px)}.participant-count{display:flex;align-items:center;font-size:14px}.participant-count dyte-icon{margin-right:var(--dyte-space-0\\.5, 2px);width:var(--dyte-space-3, 12px)}.participant-item{display:flex;align-items:center;justify-content:space-between;margin-top:var(--dyte-space-1, 4px);margin-bottom:var(--dyte-space-1, 4px);border-radius:var(--dyte-border-radius-sm, 4px);padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);cursor:pointer}.participant-item input.hide-checkbox{display:none}.participant-item input:checked{display:inline-block}.dragging input{display:none}.participant-item:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.participant-item:hover input{display:inline-block}.peer-ui-container{position:relative;display:flex;align-items:center;gap:var(--dyte-space-2, 8px);height:var(--dyte-space-10, 40px);cursor:pointer;border-radius:var(--dyte-border-radius-sm, 4px);color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.peer-ui-container dyte-avatar{height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px);font-size:14px;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.peer-ui-container .name{font-size:14px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}";var As=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.onChange=I(this,"valueChange",7),this.input="1",this.size=void 0,this.value=void 0,this.minValue=0,this.iconPack=ar,this.t=ir()}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.watchStateHandler(this.input),this.input=this.value.toString()}},{key:"watchStateHandler",value:function(e){this.onChange.emit(e)}},{key:"increment",value:function(){this.input=Math.max(parseInt(this.input)+1,this.minValue).toString()}},{key:"decrement",value:function(){this.input=Math.max(this.minValue,parseInt(this.input)-1).toString()}},{key:"render",value:function(){var e=this;return T(C,null,T("dyte-button",{kind:"icon",variant:"ghost",onClick:function(){return e.decrement()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.subtract,iconPack:this.iconPack,t:this.t})),T("input",{type:"number",value:this.input,min:this.minValue,onInput:function(t){var n=parseInt(t.target.value,10);isNaN(n)||n<e.minValue?e.input=e.minValue.toString():e.input=n.toString()}}),T("dyte-button",{kind:"icon",variant:"ghost",onClick:function(){return e.increment()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.add,iconPack:this.iconPack,t:this.t})))}}],[{key:"watchers",get:function(){return{input:["watchStateHandler"]}}}]),e}();As.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-radius:var(--dyte-border-radius-sm, 4px);padding:var(--dyte-space-1, 4px)}p{margin:var(--dyte-space-0, 0px);padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px)}input{margin:var(--dyte-space-0, 0px);width:var(--dyte-space-6, 24px);padding:var(--dyte-space-2, 8px);border-width:var(--dyte-border-width-sm, 1px);border-style:solid;border-color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52));--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));text-align:center;color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));border-radius:var(--dyte-border-radius-sm, 4px);font-size:16px;outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{margin:var(--dyte-space-0, 0px);appearance:none;-webkit-appearance:none}input[type='number']{-moz-appearance:textfield}";var Is=Object.freeze({__proto__:null,dyte_breakout_room_manager:Zs,dyte_breakout_room_participants:Ms,dyte_counter:As}),Os=function(e,t){var n=t.getTime()-e.getTime();return Math.round(Math.abs(n/1e3/60))},Ls=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onNewMessage=I(this,"dyteNewMessage",7),this.handleKeyDown=function(e){"Enter"===e.key&&e.shiftKey?n.$textArea.clientHeight<200&&(n.$textArea.style.height=n.$textArea.clientHeight+20+"px"):"Enter"===e.key?(e.preventDefault(),n.handleSendMessage()):"Backspace"===e.key&&(n.$textArea.value.endsWith("\n")?n.$textArea.style.height=n.$textArea.clientHeight-20+"px":""===n.$textArea.value&&(n.$textArea.style.height="auto"))},this.onPaste=function(e){ji((e.clipboardData||e.originalEvent.clipboardData).items,n.sendFile)},this.sendFile=function(e,t){n.canSendFiles&&("image"===e?n.onNewMessage.emit({type:"image",file:t}):n.onNewMessage.emit({type:"file",file:t}))},this.initializeTextField=function(e){n.$textArea=e;var t=ur.getItem("dyte-text-message")||"";n.$textArea.value=t},this.canSendTextMessage=!1,this.canSendFiles=!1,this.size=void 0,this.iconPack=ar,this.t=ir(),this.disableEmojiPicker=!1,this.emojiPickerActive=!1}return(0,c.Z)(e,[{key:"handleSendMessage",value:function(){if(this.canSendTextMessage){var e=this.$textArea.value.trim();e.length>0&&(this.onNewMessage.emit({type:"text",message:e}),this.$textArea.value="",this.$textArea.style.height="auto",ur.setItem("dyte-text-message",""))}}},{key:"uploadFile",value:function(e){var t=this,n=document.createElement("input");n.type="file","image"===e&&(n.accept="image/*"),n.onchange=function(n){var r=n.target,i=r.validity,a=(0,v.Z)(r.files,1)[0];i.valid&&t.sendFile(e,a)},n.click()}},{key:"render",value:function(){var e=this,t={iconPack:this.iconPack,t:this.t,size:this.size};return T(C,null,this.canSendTextMessage&&this.emojiPickerActive&&T("dyte-emoji-picker",{part:"emoji-picker",onDyteEmojiClicked:function(t){e.$textArea.value+=t.detail,e.$textArea.focus()},t:this.t}),T("slot",{name:"chat-addon"}),T("div",{class:"chat-input",part:"chat-input"},this.canSendTextMessage&&T("textarea",{class:"scrollbar",part:"textarea",placeholder:"Message..",ref:this.initializeTextField,autoFocus:!0,onPaste:this.onPaste,onKeyDown:this.handleKeyDown,onInput:function(e){ur.setItem("dyte-text-message",e.target.value)}}),T("div",{class:"chat-buttons",part:"chat-buttons"},T("div",{class:"left",part:"chat-buttons-left"},this.canSendFiles&&[T("dyte-tooltip",Object.assign({label:this.t("Send a file")},t),T("dyte-button",{variant:"ghost",kind:"icon",onClick:function(){return e.uploadFile("file")},title:this.t("Send a file"),iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.attach}))),T("dyte-tooltip",Object.assign({label:this.t("Send an image")},t),T("dyte-button",{variant:"ghost",kind:"icon",onClick:function(){return e.uploadFile("image")},title:this.t("Send an image"),iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.image})))],this.canSendTextMessage&&!this.disableEmojiPicker&&T("dyte-tooltip",Object.assign({label:this.t("Send Emoji")},t),T("dyte-button",{variant:"ghost",kind:"icon",class:{active:this.emojiPickerActive},title:this.t("Send Emoji"),iconPack:this.iconPack,t:this.t,onClick:function(){e.emojiPickerActive=!e.emojiPickerActive}},T("dyte-icon",{icon:this.iconPack.emoji_multiple})))),this.canSendTextMessage&&T("div",{class:"right",part:"chat-buttons-right"},T("dyte-tooltip",Object.assign({variant:"primary",label:this.t("Send message"),delay:2e3},t),T("dyte-button",{kind:"icon",onClick:function(){return e.handleSendMessage()},title:this.t("Send message"),iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.send}
2)))))))}}]),e}();Ls.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;flex-direction:column}.chat-input{z-index:10;box-sizing:border-box;display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-top:var(--dyte-border-width-sm, 1px) solid rgb(var(--dyte-colors-background-600, 60 60 60))}textarea{box-sizing:border-box;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--dyte-space-3, 12px);color:rgb(var(--dyte-colors-text-1000, 255 255 255))}textarea::-moz-placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}textarea::placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}textarea{font-family:var(--dyte-font-family, sans-serif);outline:2px solid transparent;outline-offset:2px;resize:none;overflow-y:auto;border-width:var(--dyte-border-width-none, 0);border-style:none;min-height:80px;font-size:14px}.chat-buttons{display:flex;align-items:center;justify-content:space-between;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);padding-top:var(--dyte-space-2, 8px);padding-bottom:var(--dyte-space-2, 8px)}.chat-buttons .left dyte-button{margin-right:var(--dyte-space-1, 4px)}.chat-buttons .left dyte-button dyte-icon{height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}.chat-buttons>div{display:flex;align-items:center}dyte-emoji-picker{z-index:0;border-top:var(--dyte-border-width-sm, 1px) solid rgb(var(--dyte-colors-background-600, 60 60 60));-webkit-animation:0.3s slide-up ease;animation:0.3s slide-up ease}@-webkit-keyframes slide-up{from{transform:translateY(100%)}to{transform:translateY(0%)}}@keyframes slide-up{from{transform:translateY(100%)}to{transform:translateY(0%)}}";var Ds=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.observingEl=[],this.onScroll=function(e){var t=e.target;je((function(){t.scrollTop+t.clientHeight+10>=t.scrollHeight?(n.autoScrollEnabled=!0,n.showLatestMessageButton=!1):n.autoScrollEnabled=!1}))},this.scrollToBottom=function(){Ho(n.$chat)},this.observeMessage=function(e){e&&n.observingEl.push(e);try{n.intersectionObserver.observe(e)}catch(hl){}},this.selectedGroup=void 0,this.messages=[],this.selfUserId=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.now=new Date,this.showLatestMessageButton=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e,t=this;this.lastReadTimestamp=null!==(e=hr.everyone)&&void 0!==e?e:new Date("0001-01-01T00:00:00Z"),this.intersectionObserver=new IntersectionObserver((function(e){document.hasFocus()&&je((function(){var n,r=(0,o.Z)(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.isIntersecting)parseInt(i.target.getAttribute("data-timestamp"))>t.lastReadTimestamp.getTime()&&(hr[t.selectedGroup]=new Date)}}catch(a){r.e(a)}finally{r.f()}}))}));this.request=requestAnimationFrame((function e(){t.now=new Date,t.timeout=setTimeout((function(){null!=t.request&&(t.request=requestAnimationFrame(e))}),6e4)})),this.chatChanged(this.messages)}},{key:"componentDidLoad",value:function(){this.$chat.addEventListener("scroll",this.onScroll)}},{key:"componentDidRender",value:function(){this.autoScrollEnabled?Ho(this.$chat):null==this.autoScrollEnabled&&Ho(this.$chat,!1)}},{key:"chatChanged",value:function(e){if(null!=this.$chat&&!this.autoScrollEnabled&&this.$chat.clientHeight!==this.$chat.scrollHeight)for(var t=e.length-1;t>=0;t--)if(e[t].message.time>this.lastReadTimestamp&&e[t].message.userId!==this.selfUserId){this.showLatestMessageButton=!0;break}}},{key:"selectedBucketChanged",value:function(){var e=this;this.autoScrollEnabled=void 0,this.observingEl.forEach((function(t){e.intersectionObserver.unobserve(t)})),this.observingEl=[]}},{key:"disconnectedCallback",value:function(){this.$chat.removeEventListener("scroll",this.onScroll),this.intersectionObserver.disconnect(),clearTimeout(this.timeout),cancelAnimationFrame(this.request)}},{key:"render",value:function(){var e,t=this,n=null,r=!1;return T(C,null,T("div",{class:"chat-container scrollbar",ref:function(e){return t.$chat=e},part:"container"},T("div",{class:"spacer",part:"spacer"}),T("div",{class:"chat",part:"chat"},null===(e=this.messages)||void 0===e?void 0:e.map((function(e){if("chat"===e.type){var i=e.message,a=!(i.userId===t.selfUserId)&&!t.autoScrollEnabled&&!r&&i.time>t.lastReadTimestamp;a&&(r=a);var o=!a&&i.userId===(null===n||void 0===n?void 0:n.userId)&&Os(i.time,null===n||void 0===n?void 0:n.time)<2;switch(n=i,i.type){case"text":return T("div",{"is-continued":o,key:e.message.id},a&&T("div",{class:"new-chat-marker",part:"new-chat-marker"},t.t("chat.new")),T("dyte-text-message",{message:i,now:t.now,isContinued:o,"data-timestamp":i.time.getTime(),ref:t.observeMessage,iconPack:t.iconPack,t:t.t}));case"image":return T("div",{"is-continued":o,key:e.message.id},a&&T("div",{class:"new-chat-marker",part:"new-chat-marker"},t.t("chat.new")),T("dyte-image-message",{message:i,now:t.now,isContinued:o,iconPack:t.iconPack,"data-timestamp":i.time.getTime(),ref:t.observeMessage,t:t.t}));case"file":return T("div",{"is-continued":o,key:e.message.id},a&&T("div",{class:"new-chat-marker",part:"new-chat-marker"},t.t("chat.new")),T("dyte-file-message",{message:i,now:t.now,isContinued:o,iconPack:t.iconPack,t:t.t,"data-timestamp":i.time.getTime(),ref:t.observeMessage}))}}return null})))),T("div",{class:"show-new-messages-ctr"},T("dyte-button",{class:{"show-new-messages":!0,active:this.showLatestMessageButton},kind:"icon",part:"show-new-messages",onClick:this.scrollToBottom,iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.chevron_down,iconPack:this.iconPack,t:this.t}))))}}],[{key:"watchers",get:function(){return{messages:["chatChanged"],selectedGroup:["selectedBucketChanged"]}}}]),e}();Ds.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column}.chat-container{box-sizing:border-box;display:flex;flex-direction:column;padding-top:var(--dyte-space-4, 16px);padding-bottom:var(--dyte-space-4, 16px);flex:1 0 0px;overflow-y:scroll}.chat-container .spacer{flex:1 1 auto}.chat-container .chat{flex:0 0 auto}.file-picker{display:none}.chat *:first-child{margin-top:var(--dyte-space-0, 0px)}.chat .head{display:flex;align-items:center}.chat .head .name{margin-right:var(--dyte-space-4, 16px);font-size:12px;font-weight:700}.chat .head .time{font-size:12px;color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.chat .body{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);overflow-wrap:break-word;font-size:14px;line-height:1.375}.chat .body .emoji{font-size:24px}p{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-3, 12px)}dyte-text-message,dyte-image-message,dyte-file-message{margin-top:var(--dyte-space-4, 16px);display:block;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));box-sizing:border-box}*[is-continued]{margin-top:var(--dyte-space-3, 12px)}dyte-text-message[is-continued]{margin-top:var(--dyte-space-2, 8px)}.chat .image{position:relative;height:var(--dyte-space-40, 160px);max-width:var(--dyte-space-64, 256px);cursor:pointer}.chat .image img{display:none;height:100%;width:100%;border-radius:var(--dyte-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.chat .image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.chat .image .image-spinner dyte-spinner{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.chat .image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-sm, 4px);background-color:rgba(var(--dyte-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}.chat .image .actions{display:none;height:var(--dyte-space-8, 32px);align-items:center;position:absolute;top:var(--dyte-space-2, 8px);right:var(--dyte-space-2, 8px);border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action{height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);border-radius:var(--dyte-border-radius-none, 0);border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}.chat .file{display:flex;align-items:center;gap:var(--dyte-space-1, 4px);padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);padding-top:var(--dyte-space-1\\.5, 6px);padding-bottom:var(--dyte-space-1\\.5, 6px);border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.chat .file .file-data{flex:1 1 0%}.chat .file .file-data .name{word-break:break-all;color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split{margin-top:var(--dyte-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.chat .file .file-data .file-data-split .ext{margin-right:var(--dyte-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split .divider{height:var(--dyte-space-4, 16px);width:var(--dyte-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.chat .file .file-data .file-data-split .size{margin-left:var(--dyte-space-2, 8px)}a{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity));-webkit-text-decoration-line:none;text-decoration-line:none}a:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.new-chat-marker{display:flex;width:100%;align-items:center;gap:var(--dyte-space-2, 8px);--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.new-chat-marker::before{content:'';height:1px;flex:1 1 0%;background-color:rgba(var(--dyte-colors-brand-300, 73 124 253) / 0.5)}.show-new-messages-ctr{pointer-events:none;display:flex;justify-content:flex-end;padding:var(--dyte-space-3, 12px);z-index:0;margin-top:calc(var(--dyte-space-14, 56px) * -1)}.show-new-messages{pointer-events:auto;--tw-translate-y:calc(var(--dyte-space-6, 24px) * -1);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.show-new-messages.active{--tw-translate-y:var(--dyte-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}";var Ns=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.pageSize=25,this.getChatMessages=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t,r,i){var a,o;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.meeting.chat.getMessages(t,r,i);case 2:return a=e.sent,o=a.messages,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.createChatNodes=function(e){return e.map((function(e){var t=void 0===e.userId;return n.createChatNode(e,t)}))},this.disconnectMeeting=function(e){var t;null===(t=null===e||void 0===e?void 0:e.chat)||void 0===t||t.removeListener("chatUpdate",n.chatUpdateListener)},this.createChatNode=function(e,t){return T("dyte-chat-message",{messageItem:{type:"chat",message:e},isContinued:t,isUnread:!1,size:n.size,iconPack:n.iconPack,key:e.id})},this.chatUpdateListener=function(e){n.$paginatedListRef.onNewNode(n.createChatNode(e.message,!1))},this.meeting=void 0,this.size=void 0,this.iconPack=ar,this.t=ir()}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){this.disconnectMeeting(this.meeting)}},{key:"meetingChanged",value:function(e,t){var n;void 0!=t&&this.disconnectMeeting(t),e&&!e.chat||null!=e&&(null===(n=e.chat)||void 0===n||n.addListener("chatUpdate",this.chatUpdateListener))}},{key:"render",value:function(){var e=this;return T(C,null,T("dyte-paginated-list",{ref:function(t){return e.$paginatedListRef=t},pageSize:this.pageSize,pagesAllowed:3,fetchData:this.getChatMessages,createNodes:this.createChatNodes}))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Ns.style=":host{display:flex;flex:1 0 0px}";var js=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.groupChanged=I(this,"dyteChatGroupChanged",7),this.onScopeClick=function(e){n.showParticipantsPanel=!1,n.groupChanged.emit(e)},this.selfUserId=void 0,this.selectedGroupId=void 0,this.unreadCounts={},this.groups=[],this.iconPack=ar,this.t=ir(),this.showParticipantsPanel=!1,this.query=""}return(0,c.Z)(e,[{key:"toggleParticipants",value:function(){this.showParticipantsPanel=!this.showParticipantsPanel}},{key:"getGroups",value:function(){var e=this;return this.groups.filter((function(t){return t.name.toLowerCase().includes(e.query.toLowerCase())}))}},{key:"getName",value:function(){var e=this;if(!this.selectedGroupId||"everyone"===this.selectedGroupId)return this.t("everyone");var t=this.groups.find((function(t){return t.userId===e.selectedGroupId}));return t?t.name:this.t("everyone")}},{key:"render",value:function(){var e=this,t=Object.keys(this.unreadCounts).reduce((function(t,n){return t+e.unreadCounts[n]}),0);return T(C,null,T("div",{class:"chat-scope-selector"},this.showParticipantsPanel&&T("div",{class:"participants-container"},T("div",{class:"search",part:"search"},T("dyte-icon",{icon:this.iconPack.search,part:"search-icon"}),T("input",{type:"search",autocomplete:"off",placeholder:"Search",value:this.query,onInput:function(t){e.query=t.target.value},part:"search-input"})),T("ul",{class:"scope-list scrollbar"},""===this.query&&T("li",{class:"scope scope-special",onClick:function(){return e.onScopeClick("everyone")}},T("div",{class:"everyone-icon"},T("dyte-icon",{icon:this.iconPack.participants})),"Everyone",this.unreadCounts.everyone>0&&T("div",{class:"unread-count",part:"unread-count"},T("span",null,this.unreadCounts.everyone))),this.getGroups().map((function(t){var n=e.unreadCounts[Ni([e.selfUserId,t.userId])];return T("li",{class:"scope",onClick:function(){return e.onScopeClick(t)},key:t.userId},t.name,n>0&&T("div",{class:"unread-count",part:"unread-count"},T("span",null,n)))})))),T("button",{onClick:function(){return e.toggleParticipants()}},T("span",null,"".concat(this.t("To")," ").concat(this.getName()),"  ",t>0&&T("div",{class:"unread-count selector"},T("span",null,t))),T("dyte-icon",{icon:this.showParticipantsPanel?this.iconPack.chevron_up:this.iconPack.chevron_down}))))}}]),e}();js.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{display:flex;flex-direction:column}.chat-scope-selector{position:relative;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity));z-index:10}.chat-scope-selector button{width:100%;border-width:var(--dyte-border-width-none, 0);border-style:none;padding:var(--dyte-space-4, 16px);display:flex;align-items:center;justify-content:space-between;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));font-size:14px;cursor:pointer;height:var(--dyte-space-12, 48px)}
2.chat-scope-selector button span{display:flex;align-items:center;justify-content:flex-start}.chat-scope-selector button dyte-icon{height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px)}.chat-scope-selector .search{position:-webkit-sticky;position:sticky;box-sizing:border-box;display:flex;align-items:center;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));margin-left:var(--dyte-space-3, 12px);margin-right:var(--dyte-space-3, 12px);margin-top:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-0, 0px)}.chat-scope-selector .search dyte-icon{margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}.chat-scope-selector .search input{box-sizing:border-box;height:var(--dyte-space-9, 36px);width:100%;padding-right:var(--dyte-space-2, 8px);border-width:var(--dyte-border-width-none, 0);border-style:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));outline:2px solid transparent;outline-offset:2px;border-radius:var(--dyte-border-radius-sm, 4px);font-size:14px}.chat-scope-selector .search input::-moz-placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.chat-scope-selector .search input::placeholder{color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.chat-scope-selector .participants-container{position:absolute;width:100%;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));top:var(--dyte-space-12, 48px);-webkit-animation:0.3s slide-down ease;animation:0.3s slide-down ease}@-webkit-keyframes slide-down{from{transform:translateY(-50px)}to{transform:translateY(0%)}}@keyframes slide-down{from{transform:translateY(-50px)}to{transform:translateY(0%)}}.chat-scope-selector .scope-list{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-0, 0px);list-style-type:none;padding-left:var(--dyte-space-0, 0px);padding-right:var(--dyte-space-0, 0px);overflow:auto;max-height:375px}.chat-scope-selector .scope-list .scope{position:relative;display:flex;flex-direction:row;align-items:center;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);padding-top:var(--dyte-space-4, 16px);padding-bottom:var(--dyte-space-4, 16px)}.chat-scope-selector .scope-list .scope:hover{cursor:pointer;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.chat-scope-selector .scope-list .scope-special{margin-top:var(--dyte-space-4, 16px);--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.chat-scope-selector .scope-list .everyone-icon>dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px);color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.chat-scope-selector .scope-list .everyone-icon{display:flex;height:100%;width:100%;align-items:center;justify-content:center;margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px}.unread-count.selector{position:unset;margin-left:var(--dyte-space-2, 8px)}.unread-count{position:absolute;right:var(--dyte-space-3, 12px);box-sizing:border-box;padding:var(--dyte-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;color:rgb(var(--dyte-colors-text-1000, 255 255 255));display:flex;height:var(--dyte-space-5, 20px);min-width:var(--dyte-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}dyte-avatar{height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px)}";var Bs=Object.freeze({__proto__:null,dyte_chat_composer_ui:Ls,dyte_chat_messages_ui:Ds,dyte_chat_messages_ui_paginated:Ns,dyte_chat_selector_ui:js}),Us=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.joinStage=I(this,"dyteJoinStage",7),this.leaveStage=I(this,"dyteLeaveStage",7),this.meeting=void 0,this.config=Ue,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.dataConfig={title:this.t("stage.join_title"),label:{accept:this.t("stage.join_confirm"),reject:this.t("stage.join_cancel")},description:this.t("stage.join_summary")}
2}return(0,c.Z)(e,[{key:"render",value:function(){var e,t,n,r,i=this,a={meeting:this.meeting,size:this.size,states:this.states||br,config:this.config,iconPack:this.iconPack,t:this.t};return T(C,{class:{livestream:"LIVESTREAM"===(null===(e=this.meeting)||void 0===e?void 0:e.meta.viewType),webinar:"WEBINAR"===(null===(t=this.meeting)||void 0===t?void 0:t.meta.viewType)}},T("header",null,T("h2",null,this.dataConfig.title)),T(sr,{element:"dyte-participant-setup",defaults:a,props:{participant:null===(n=this.meeting)||void 0===n?void 0:n.self,size:"md"},childProps:{participant:null===(r=this.meeting)||void 0===r?void 0:r.self,size:"md"},deepProps:!0}),T("div",{class:"summary"},this.dataConfig.description),T("div",{class:"container"},T("dyte-button",{variant:"secondary",onClick:function(){return i.leaveStage.emit()},title:this.dataConfig.label.reject,iconPack:this.iconPack,t:this.t},this.dataConfig.label.reject),T("dyte-button",{onClick:function(){return i.joinStage.emit()},title:this.dataConfig.label.accept,iconPack:this.iconPack,t:this.t},this.dataConfig.label.accept)))}}]),e}();Us.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host::-webkit-scrollbar{width:var(--dyte-space-1\\.5, 6px);border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}:host::-webkit-scrollbar-thumb{border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host(.webinar){box-sizing:border-box;display:block;width:512px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--dyte-space-6, 24px);-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:auto;border-radius:var(--dyte-border-radius-md, 8px);line-height:1.25}:host(.webinar) dyte-participant-setup{display:flex;flex:1 1 0%;align-items:center;justify-content:space-around;margin-left:auto;margin-right:auto}:host(.webinar) .container dyte-button{margin:var(--dyte-space-3, 12px);flex-grow:1;padding:var(--dyte-space-1, 4px);width:50%}:host(.webinar) header{padding-left:var(--dyte-space-4, 16px);padding-right:var(--dyte-space-4, 16px)}:host(.webinar) .summary{padding:var(--dyte-space-4, 16px)}:host(.livestream){box-sizing:border-box;display:block;width:512px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding:var(--dyte-space-8, 32px);-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:auto;border-radius:var(--dyte-border-radius-md, 8px);line-height:1.25}:host(.livestream) dyte-participant-setup{display:flex;width:100%;flex:1 1 0%;align-items:center;justify-content:space-around;margin-left:auto;margin-right:auto}:host(.livestream) .container dyte-button{flex-grow:1;padding:var(--dyte-space-1, 4px);width:50%}:host(.livestream) .container dyte-button:nth-child(1){margin-right:var(--dyte-space-1\\.5, 6px)}:host(.livestream) .container dyte-button:nth-child(2){margin-left:var(--dyte-space-1\\.5, 6px)}:host(.livestream) h2{font-size:24px;font-weight:500;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}:host(.livestream) .summary{margin-top:var(--dyte-space-6, 24px);margin-bottom:var(--dyte-space-6, 24px);text-align:left;font-size:14px}.deny-access{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.container{width:100%;max-width:1080px;display:flex;flex:1 1 0%;align-items:center;justify-content:space-around}header{display:flex;align-items:center;justify-content:space-between}";var Vs=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.meeting=void 0,this.states=void 0,this.iconPack=ar,this.t=ir()}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){var e=this;this.states.activeOverlayModal.timeout&&setTimeout((function(){e.stateUpdate.emit({activeOverlayModal:{active:!1}}),br.activeOverlayModal={active:!1}}),this.states.activeOverlayModal.timeout)}},{key:"componentDidLoad",value:function(){}},{key:"disconnectedCallback",value:function(){}},{key:"render",value:function(){return T(C,null,T("dyte-icon",{icon:this.states.activeOverlayModal.icon,iconPack:this.iconPack,t:this.t}),T("h2",null,this.states.activeOverlayModal.title),T("p",null,this.states.activeOverlayModal.description))}}]),e}();Vs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / 0.6);position:fixed;top:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);z-index:50}dyte-icon{height:var(--dyte-space-20, 80px)}h2{margin:var(--dyte-space-2, 8px);font-weight:500}p{margin:var(--dyte-space-0, 0px);font-size:16px}";var Fs=Object.freeze({__proto__:null,dyte_join_stage:Us,dyte_overlay_modal:Vs}),zs=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.dyteAPIError=I(this,"dyteAPIError",7),this.showLatencyIndicator=!1,this.LoadPlayer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.ivsPlayer;n.player&&e&&(e.attachHTMLVideoElement(n.player),e.setAutoplay(!0),e.setVolume(1))},this.livestreamUpdateListener=function(e){var t,r;n.livestreamState=e,"LIVESTREAMING"===e?(n.LoadPlayer(),n.getPlaybackUrl(),(null===(r=null===(t=n.meeting.__internals__)||void 0===t?void 0:t.browserSpecs)||void 0===r?void 0:r.isIOSMobile())||(n.fetchLatency(),n.updateLatency=setInterval(n.fetchLatency,2e3)),va.enableSource("livestream-player")):(n.showLatencyIndicator=!1,n.updateLatency&&clearInterval(n.updateLatency),va.disableSource("livestream-player"))},this.getLoadingState=function(){var e="",t=!1,r=!1;switch(n.livestreamState){case"IDLE":e=n.t("Waiting to go live."),t=!0,r=!1;break;case"STARTING":e=n.t("Livestream is starting..."),t=!0,r=!0;break;case"STOPPING":e=n.t("Livestream is stopping..."),t=!0,r=!0;break;case"LIVESTREAMING":n.playerState!==Fr.PLAYING&&(e=n.t("Livestream is starting..."),r=!0,t=!0);break;default:t=!1,e=n.t(""),r=!0}return{isLoading:t,loadingMessage:e,showIcon:r}},this.getErrorState=function(){var e,t,r=!1,i="";return"LIVESTREAMING"!==n.livestreamState?{isError:r=!1,errorMessage:i=n.t("")}:(n.isSupported||(r=!0,i=n.t("Player not supported.")),n.playbackUrl||(r=!0,i=n.t("Playback URL not found.")),n.playerError&&(r=!0,i=n.t(null!==(t=null===(e=n.playerError)||void 0===e?void 0:e.message)&&void 0!==t?t:"An unknown error occured.")),{isError:r,errorMessage:i})},this.fetchLatency=function(){n.ivsPlayer&&(n.latency=n.ivsPlayer.getLiveLatency())},this.stopRebuffer=function(e){n.ivsPlayer.setRebufferToLive(!1),n.latency=e,clearInterval(n.updateLatency),n.updateLatency=setInterval(n.fetchLatency,2e3)},this.resetSyncLivestream=function(){var e=n.ivsPlayer.getLiveLatency();n.stopRebuffer(e),n.dyteAPIError.emit({trace:n.t("livestreamPlayer.rebuffer.error"),message:n.t("Could not sync livestream please try again later.")})},this.syncLiveStream=function(){clearInterval(n.updateLatency),n.latency=-1,n.ivsPlayer.setRebufferToLive(!0);var e=setTimeout(n.resetSyncLivestream,15e3);n.updateLatency=setInterval((function(){var t=n.ivsPlayer.getLiveLatency();t<10&&(n.stopRebuffer(t),clearTimeout(e))}),1e3)},this.meeting=void 0,this.size=void 0,this.t=ir(),this.iconPack=ar,this.playbackUrl=void 0,this.isSupported=!0,this.playerState=Fr.IDLE,this.livestreamState="IDLE",this.playerError=void 0,this.latency=0,this.audioPlaybackError=!1}return(0,c.Z)(e,[{key:"AddPlayerListeners",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.ivsPlayer;Object.values(Object.assign(Object.assign({},zr),Fr)).forEach((function(n){Wr.includes(n)||null===t||void 0===t||t.addEventListener(n,(function(r){var i,a,o;n!==Fr.IDLE&&n!==Fr.PLAYING&&n!==zr.ERROR&&n!==Fr.READY||(e.playerState=n),n===zr.ERROR&&(e.playerError=r),n===Fr.IDLE&&t.isPaused()&&t.play(),n===zr.AUDIO_BLOCKED&&(e.audioPlaybackError=!0),e.playerState!==Fr.PLAYING||(null===(a=null===(i=e.meeting.__internals__)||void 0===i?void 0:i.browserSpecs)||void 0===a?void 0:a.isIOSMobile())?e.showLatencyIndicator=!1:e.showLatencyIndicator=!0,e.meeting.__internals__.logger.info("IVS.Player.".concat(n),r),Jr.includes(n)&&(null===(o=e.meeting.__internals__.callStats)||void 0===o||o.ivsPlayerEvent(n,r))}))}))}},{key:"getPlaybackUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.ivsPlayer;this.playbackUrl=this.meeting.livestream.playbackUrl,this.playbackUrl&&e&&(e.load(this.playbackUrl),e.play())}},{key:"onPlayerRef",value:function(e){this.player=e,va.addSource("livestream-player",this.player,!!this.playbackUrl),this.playbackUrl&&va.enableSource("livestream-player")}},{key:"connectedCallback",value:function(){var e=this;this.meetingChanged(this.meeting),window.onDyteLivestreamPlayer=function(t){t?(e.isSupported=!0,e.ivsPlayer=t,e.AddPlayerListeners(t),e.LoadPlayer(t),e.getPlaybackUrl(t)):e.isSupported=!1},this.sendLatencyToCallStats=setInterval((function(){var t;e.fetchLatency(),null===(t=e.meeting.__internals__.callStats)||void 0===t||t.livestreamLatency(e.latency)}),1e4)}},{key:"disconnectedCallback",value:function(){window.onDyteLivestreamPlayer=void 0,this.meeting.livestream.removeListener("livestreamUpdate",this.livestreamUpdateListener),clearInterval(this.sendLatencyToCallStats),this.ivsPlayer.load(""),this.ivsPlayer=void 0,this.player=void 0}},{key:"componentDidLoad",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){var t;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"\n    import IVSPlayer from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm'\n    let player = undefined;\n    if (IVSPlayer.isPlayerSupported) {\n      player = IVSPlayer.create({\n        wasmBinary:\n          'https://unpkg.com/[email protected].
20/dist/assets/amazon-ivs-wasmworker.min.wasm',\n        wasmWorker:\n          'https://unpkg.com/[email protected]/dist/assets/amazon-ivs-wasmworker.min.js',\n      });\n    }\n    window.onDyteLivestreamPlayer && window.onDyteLivestreamPlayer(player);\n    ",(t=document.createElement("script")).type="module",t.innerHTML="\n    import IVSPlayer from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm'\n    let player = undefined;\n    if (IVSPlayer.isPlayerSupported) {\n      player = IVSPlayer.create({\n        wasmBinary:\n          'https://unpkg.com/[email protected]/dist/assets/amazon-ivs-wasmworker.min.wasm',\n        wasmWorker:\n          'https://unpkg.com/[email protected]/dist/assets/amazon-ivs-wasmworker.min.js',\n      });\n    }\n    window.onDyteLivestreamPlayer && window.onDyteLivestreamPlayer(player);\n    ",document.body.appendChild(t);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"meetingChanged",value:function(e){null!=e&&(this.livestreamState=this.meeting.livestream.state,"LIVESTREAMING"===this.livestreamState&&(this.LoadPlayer(),this.getPlaybackUrl(),va.enableSource("livestream-player")),this.meeting.livestream.on("livestreamUpdate",this.livestreamUpdateListener))}},{key:"render",value:function(){var e=this;if(Gr(this.meeting)){var t=this.getErrorState(),n=t.isError,r=t.errorMessage,i=this.getLoadingState(),a=i.isLoading,o=i.loadingMessage,s=i.showIcon;return T(C,null,T("div",{class:"player-container"},T("video",{ref:function(t){return e.onPlayerRef(t)},playsInline:!0}),this.audioPlaybackError&&T("div",{class:"unmute-popup"},T("h3",null,this.t("audio_playback.title")),T("p",null,this.t("audio_playback.description")),T("dyte-button",{kind:"wide",onClick:function(){e.player.muted=!1,e.audioPlaybackError=!1},title:this.t("audio_playback"),iconPack:this.iconPack,t:this.t},this.t("audio_playback"))),this.showLatencyIndicator&&T("div",{class:"latency-controls"},(this.latency>10||this.latency<0)&&T("div",{class:"sync-live-stream",onClick:this.syncLiveStream},-1===this.latency?T("dyte-spinner",{id:"icon",part:"spinner",iconPack:this.iconPack,t:this.t,size:"sm"}):"Skip to Live")),n&&T("div",{class:"loader"},T("dyte-icon",{icon:this.iconPack.warning,t:this.t}),T("p",null,r)),!n&&a&&T("div",{class:"loader"},s&&T("dyte-spinner",{id:"icon",part:"spinner",iconPack:this.iconPack,t:this.t,size:"md"}),T("p",null,o))))}}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();zs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);margin-left:var(--dyte-space-2, 8px);margin-right:var(--dyte-space-2, 8px);display:flex;height:100%;width:100%;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.player-container{position:relative;margin:var(--dyte-space-4, 16px);display:flex;flex-grow:1;align-items:center;justify-content:center;overflow:hidden;border-radius:var(--dyte-border-radius-md, 8px)}video{z-index:0;height:100%;width:100%;border-radius:var(--dyte-border-radius-md, 8px);border-width:var(--dyte-border-width-none, 0);border-style:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.loader{position:absolute;z-index:10;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));display:flex;flex-direction:column;align-items:center;justify-content:center}p{margin-top:var(--dyte-space-1, 4px);margin-bottom:var(--dyte-space-1, 4px);font-size:16px;color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.latency-controls{position:absolute;bottom:var(--dyte-space-4, 16px);right:var(--dyte-space-4, 16px);z-index:20;display:flex;flex-direction:row;align-items:center}.sync-live-stream{cursor:pointer;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);padding-top:var(--dyte-space-1, 4px);padding-bottom:var(--dyte-space-1, 4px);font-size:12px}.unmute-popup{position:absolute;z-index:30 !important;display:flex;width:var(--dyte-space-72, 288px);flex-direction:column;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--dyte-space-4, 16px);text-align:center;max-width:70%}.unmute-popup h3{margin:var(--dyte-space-0, 0px);font-size:16px;font-weight:500}.unmute-popup p{margin-top:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-3, 12px);font-size:14px}";var Hs=Object.freeze({__proto__:null,dyte_livestream_player:zs}),qs=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.dismiss=I(this,"dyteNotificationDismiss",7),this.notification=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.imageState="loading"}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.notificationChanged(this.notification)}},{key:"notificationChanged",value:function(e){var t=this;null!=e&&"number"===typeof e.duration&&setTimeout((function(){t.dismiss.emit(e.id)}),e.duration)}},{key:"render",value:function(){var e=this;return T(C,null,T("div",{class:"ctr"},null!=this.notification.icon&&T("dyte-icon",{class:"icon",icon:this.notification.icon,iconPack:this.iconPack,t:this.t}),null!=this.notification.image&&null==this.notification.icon&&"errored"!==this.imageState&&T("img",{src:this.notification.image,class:{loaded:"loaded"===this.imageState},onLoad:function(){return e.imageState="loaded"},onError:function(){return e.imageState="errored"}}),T("p",{class:"message"},this.notification.message),T("div",{class:"right"},null!=this.notification.button&&T("dyte-button",{size:"sm",variant:this.notification.button.variant,onClick:function(){return e.notification.button.onClick()},iconPack:this.iconPack,t:this.t},this.notification.button.text),T("dyte-icon",{"aria-label":this.t("dismiss"),class:"dismiss",icon:this.iconPack.dismiss,onClick:function(){return e.dismiss.emit(e.notification.id)},iconPack:this.iconPack,t:this.t}))))}}],[{key:"watchers",get:function(){return{notification:["notificationChanged"]}}}]),e}();qs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);pointer-events:none;display:block;height:var(--dyte-space-10, 40px);color:rgb(var(--dyte-colors-text-1000, 255 255 255));-webkit-animation:show 0.4s ease;animation:show 0.4s ease;transition:0.4s;z-index:100}.ctr{box-sizing:border-box;display:inline-flex;height:100%;min-width:var(--dyte-space-40, 160px);align-items:center;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
2--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);--tw-shadow-color:rgb(var(--dyte-colors-background-1000, 8 8 8));--tw-shadow:var(--tw-shadow-colored);pointer-events:auto}img{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-0, 0px);width:var(--dyte-space-0, 0px);border-radius:9999px}img.loaded{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}.message{margin-right:var(--dyte-space-3, 12px)}dyte-icon.icon{margin-right:var(--dyte-space-2, 8px);height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px);color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88))}dyte-icon.dismiss{margin-left:auto;height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);border-radius:var(--dyte-border-radius-md, 8px);color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}dyte-icon.dismiss:hover{cursor:pointer;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}dyte-icon.dismiss{transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}dyte-button{margin-left:var(--dyte-space-4, 16px);margin-right:var(--dyte-space-2, 8px);border-radius:var(--dyte-border-radius-sm, 4px)}.right{margin-left:auto;display:flex;align-items:center}.right>*{margin-left:var(--dyte-space-2, 8px)}.right>*:first-child{margin-left:var(--dyte-space-0, 0px)}:host(.exit){-webkit-animation:exit 0.4s ease;animation:exit 0.4s ease}@-webkit-keyframes show{0%{opacity:0;transform:translateX(-120px)}100%{opacity:1;transform:translateX(0px)}}@keyframes show{0%{opacity:0;transform:translateX(-120px)}100%{opacity:1;transform:translateX(0px)}}@-webkit-keyframes exit{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-120px)}}@keyframes exit{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-120px)}}:host([size='sm']){font-size:14px}";var Gs=Object.freeze({__proto__:null,dyte_notification:qs}),Ws=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.onVote=I(this,"dyteVotePoll",7),this.poll=void 0,this.self=void 0,this.permissions=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"vote",value:function(e,t){this.poll.voted.includes(this.self)?e.preventDefault():this.onVote.emit({id:this.poll.id,index:t})}},{key:"render",value:function(){var e=this;return T(C,null,T("div",{class:"ctr"},T("p",{class:"poll-title"},this.t("Poll by")," ",Pa(Ra(this.poll.createdBy),20)),T("div",{class:"poll"},T("p",{class:"poll-question"},this.poll.question),this.poll.options.map((function(t,n){return T("div",{class:{active:t.votes.some((function(t){return t.id===e.self})),"poll-option":!0}},T("div",{class:"poll-option-header"},T("label",null,T("input",{disabled:!e.permissions.polls.canVote,type:"checkbox",checked:t.votes.some((function(t){return t.id===e.self})),onClick:function(t){return e.vote(t,n)}}),T("p",null,t.text," (",t.count,")"))),T("div",{class:"votes"},t.votes.map((function(t){if(!e.poll.anonymous||e.self===e.poll.createdByUserId)return T("dyte-tooltip",{label:t.name,iconPack:e.iconPack,t:e.t},T("div",{class:"vote"},Za(t.name)))}))))})))))}}]),e}();Ws.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}.ctr{margin-bottom:var(--dyte-space-3, 12px);display:flex;width:83.333333%;flex-direction:column;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.poll-title{margin-top:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-3, 12px);margin-right:var(--dyte-space-4, 16px);font-size:12px;font-weight:700}.poll{border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));display:flex;flex-direction:column;padding:var(--dyte-space-3, 12px)}.poll p{margin:var(--dyte-space-0, 0px)}.poll-question{font-size:12px;font-weight:700;overflow-wrap:break-word}
2.poll-option{display:flex;flex-direction:column;margin-top:var(--dyte-space-2, 8px);border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity));padding:var(--dyte-space-2, 8px);word-break:break-word}.poll-option label{display:flex;flex-direction:row}.poll-option-header{display:flex;flex-direction:row;justify-content:space-between}.votes{margin-top:var(--dyte-space-1, 4px);display:flex;flex-direction:row;flex-wrap:wrap}.vote{margin-right:var(--dyte-space-1, 4px);height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);display:flex;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-radius:var(--dyte-border-radius-none, 0);-webkit-clip-path:circle();clip-path:circle()}.active{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}";var Js=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.onCreate=I(this,"dyteCreatePoll",7),this.iconPack=ar,this.t=ir(),this.options=["",""],this.anonymous=!1,this.hideVotes=!0,this.error=void 0}return(0,c.Z)(e,[{key:"removeOption",value:function(e){var t;this.options=this.options.filter((function(t,n){return n!==e})),1===(null===(t=this.error)||void 0===t?void 0:t.code)&&(this.error=void 0)}},{key:"addOption",value:function(){this.options=[].concat((0,m.Z)(this.options),[""])}},{key:"updateOption",value:function(e,t){var n;this.options[t]=e.target.value,1===(null===(n=this.error)||void 0===n?void 0:n.code)&&(this.error=void 0)}},{key:"handleSubmit",value:function(){var e={question:this.question.value,options:this.options,anonymous:this.anonymous,hideVotes:!!this.anonymous||this.hideVotes};e.question?this.options.filter((function(e){return""===e.trim()})).length>0?this.error={code:1,message:this.t("Empty options not allowed.")}:this.onCreate.emit(e):this.error={code:0,message:this.t("Question is required.")}}},{key:"render",value:function(){var e=this;return T(C,null,T("div",{class:"create-poll"},T("p",null,this.t("Poll Question")),T("textarea",{onInput:function(){e.error&&0===e.error.code&&(e.error=void 0)},ref:function(t){return e.question=t},placeholder:this.t("What is your poll for?")}),this.options.map((function(t,n){return T("div",{class:"option"},T("input",{placeholder:e.t("Enter an option"),value:t,onInput:function(t){return e.updateOption(t,n)}}),n>1&&T("dyte-button",{kind:"icon",class:"auto remove-option",variant:"secondary",onClick:function(){return e.removeOption(n)},iconPack:e.iconPack,t:e.t},T("dyte-icon",{icon:e.iconPack.subtract,iconPack:e.iconPack,t:e.t})))})),T("dyte-button",{class:"add-option",variant:"secondary",onClick:function(){return e.addOption()},iconPack:this.iconPack,t:this.t},this.t("Add an option")),T("label",null,T("input",{id:"anonymous",type:"checkbox",onChange:function(t){return e.anonymous=t.target.checked}}),this.t("Anonymous")),T("label",null,T("input",{id:"hideVotes",type:"checkbox",disabled:this.anonymous,checked:!!this.anonymous||this.hideVotes,onChange:function(t){return e.hideVotes=t.target.checked}}),this.t("Hide results before voting")),T("dyte-button",{kind:"wide",onClick:function(){return e.handleSubmit()},iconPack:this.iconPack,t:this.t},this.t("Create Poll")),this.error&&T("span",{class:"error-text"},this.error.message)))}}]),e}();Js.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}.create-poll{margin-top:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-3, 12px);display:flex;flex:1 1 0%;flex-direction:column;padding:var(--dyte-space-3, 12px);border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.create-poll p{margin:var(--dyte-space-0, 0px);padding:var(--dyte-space-0, 0px);text-align:center}.create-poll textarea{display:flex;border-radius:var(--dyte-border-radius-sm, 4px);padding:var(--dyte-space-2, 8px);font-family:var(--dyte-font-family, sans-serif);border-width:var(--dyte-border-width-none, 0);border-style:none;font-weight:500;outline:2px solid transparent;outline-offset:2px;margin-top:var(--dyte-space-3, 12px);margin-bottom:var(--dyte-space-3, 12px);resize:vertical;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.create-poll textarea:focus{outline-style:solid;outline-offset:2px;outline-color:rgb(var(--dyte-colors-background-600, 60 60 60))}
2.option{display:flex;flex-direction:row;align-items:center;margin-bottom:var(--dyte-space-3, 12px);width:100%}.option input{width:100%;border-radius:var(--dyte-border-radius-sm, 4px);padding:var(--dyte-space-2, 8px);border-width:var(--dyte-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.remove-option{margin-left:var(--dyte-space-2, 8px);width:var(--dyte-space-10, 40px);border-radius:var(--dyte-border-radius-sm, 4px)}.add-option{margin-bottom:var(--dyte-space-3, 12px)}label{margin-bottom:var(--dyte-space-3, 12px)}.error-text{margin-top:var(--dyte-space-3, 12px);text-align:center;font-size:12px;--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var $s=Object.freeze({__proto__:null,dyte_poll:Ws,dyte_poll_form:Js}),Ks=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.stageStateListener=function(){n.updateCanProduce(n.meeting)},this.selfStageLeftListener=function(){n.canProduceAudio=!1},this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.audioDevices=[],this.speakerDevices=[],this.canProduceAudio=!0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e,t,n,r,i,a,o;null===(e=this.meeting)||void 0===e||e.self.removeListener("joinStageRequestAccepted",this.stageStateListener),null===(t=this.meeting)||void 0===t||t.self.removeListener("stageJoined",this.stageStateListener),null===(n=this.meeting)||void 0===n||n.self.removeListener("removedFromStage",this.stageStateListener),null===(i=null===(r=this.meeting)||void 0===r?void 0:r.stage)||void 0===i||i.removeListener("stageStatusUpdate",this.stageStateListener),null===(a=this.meeting)||void 0===a||a.self.removeListener("stageLeft",this.selfStageLeftListener),null===(o=this.meeting)||void 0===o||o.self.removeListener("joinStageRequestRejected",this.stageStateListener)}},{key:"updateCanProduce",value:function(e){var t=e.self,n=e.meta,r=e.stage,i="ALLOWED"===t.permissions.canProduceAudio,a="WEBINAR"===n.viewType,o="LIVESTREAM"===n.viewType;if(this.canProduceAudio=!1,i)this.canProduceAudio=!0;else if(a||o){"CAN_REQUEST"===t.permissions.canProduceAudio&&(a&&("ON_STAGE"===t.webinarStageStatus||"ACCEPTED_TO_JOIN_STAGE"===t.webinarStageStatus)||o&&("ON_STAGE"===r.status||"ACCEPTED_TO_JOIN_STAGE"===r.status))&&(this.canProduceAudio=!0)}}},{key:"meetingChanged",value:function(e){var t=this;null!=e&&je((0,f.Z)((0,h.Z)().mark((function n(){var r,i,a,o,s,c,u,l,d,p;return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return s=e.self,c=e.stage,n.next=3,e.self.getAudioDevices();case 3:return u=n.sent,n.next=6,e.self.getSpeakerDevices();case 6:l=n.sent,d=null===(r=e.self.getCurrentDevices())||void 0===r?void 0:r.audio,p=null===(i=e.self.getCurrentDevices())||void 0===i?void 0:i.speaker,t.updateCanProduce(e),s.addListener("joinStageRequestAccepted",t.stageStateListener),s.addListener("stageJoined",t.stageStateListener),s.addListener("removedFromStage",t.stageStateListener),null===c||void 0===c||c.addListener("stageStatusUpdate",t.stageStateListener),s.addListener("stageLeft",t.selfStageLeftListener),s.addListener("joinStageRequestRejected",t.stageStateListener),t.audioDevices=void 0!=d?[null!==(a=u.find((function(e){return e.deviceId===d.deviceId})))&&void 0!==a?a:d].concat((0,m.Z)(u.filter((function(e){return e.deviceId!==d.deviceId})))):u,t.speakerDevices=void 0!=p?[null!==(o=l.find((function(e){return e.deviceId===p.deviceId})))&&void 0!==o?o:p].concat((0,m.Z)(l.filter((function(e){return e.deviceId!==p.deviceId})))):l;case 18:case"end":return n.stop()}}),n)}))))}},{key:"testAudio",value:function(){var e;null===(e=this.testAudioEl)||void 0===e||e.play()}},{key:"setDevice",value:function(e,t){var n,r,i="audio"===e?this.audioDevices.find((function(e){return e.deviceId===t})):this.speakerDevices.find((function(e){return e.deviceId===t}));null!=i&&(null===(n=this.meeting)||void 0===n||n.self.setDevice(i),"audiooutput"===i.kind&&(null===(r=this.testAudioEl)||void 0===r||r.setSinkId(i.deviceId)))}},{key:"render",value:function(){var e,t,n,r=this;if(null==this.meeting)return null;var i=0,a=0,o=null===(e=this.meeting)||void 0===e?void 0:e.self.getCurrentDevices(),s=this.states||br,c=!0===(null===(t=null===s||void 0===s?void 0:s.prefs)||void 0===t?void 0:t.muteNotificationSounds)||"true"===pr("mute-notification-sounds");return T(C,null,T("audio",{preload:"auto",src:"https://assets.dyte.io/ui-kit/speaker-test.mp3",ref:function(e){return r.testAudioEl=e}}),this.canProduceAudio&&T("div",{class:"group",part:"microphone-selection"},T("label",null,"Microphone (input)"),T("div",{class:"row"},T("select",{class:"dyte-select",onChange:function(e){return r.setDevice("audio",e.target.value)}},this.audioDevices.map((function(e){var t,n=e.deviceId,r=e.label;return T("option",{value:n,selected:(null===(t=o.audio)||void 0===t?void 0:t.deviceId)===n},r||"Microphone ".concat(++i))}))),T("dyte-audio-visualizer",{participant:null===(n=this.meeting)||void 0===n?void 0:n.self,iconPack:this.iconPack,t:this.t}))),T("div",{class:"group",part:"speaker-selection"},this.speakerDevices.length>0&&T("div",null,T("label",null,"Speaker (output)"),T("div",{class:"row"},T("select",{class:"dyte-select",onChange:function(e){return r.setDevice("speaker",e.target.value)}},this.speakerDevices.map((function(e){var t,n=e.deviceId,r=e.label;return T("option",{value:n,selected:(null===(t=o.speaker)||void 0===t?void 0:t.deviceId)===n},r||"Speaker ".concat(++a))}))))),T("dyte-button",{variant:"secondary",onClick:function(){return r.testAudio()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.speaker,slot:"start",iconPack:this.iconPack,t:this.t}),"Test")),T("div",{class:"group",part:"notification-toggle"},T("div",{class:"row"},T("label",{htmlFor:"notification-toggle"},"Notification sound"),T("dyte-switch",{id:"notification-toggle",checked:!c,onDyteChange:function(e){var t,n=!e.target.checked;r.stateUpdate.emit({prefs:{muteNotificationSounds:n}}),br.prefs=Object.assign(Object.assign({},null!==(t=br.prefs)&&void 0!==t?t:{}),{muteNotificationSounds:n}),dr("mute-notification-sounds",n)},iconPack:this.iconPack,t:this.t}))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Ks.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.dyte-select{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.dyte-select:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
2dow, 0 0 #0000)}.dyte-select{display:block;border-radius:var(--dyte-border-radius-sm, 4px);border-width:var(--dyte-border-width-none, 0);border-style:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--dyte-space-3, 12px);font-size:16px;--icon-size:var(--dyte-select-chevron-size, var(--dyte-space-6, 24px));--icon-right-position:var(--dyte-select-chevron-right-position, var(--dyte-space-2, 8px));background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right var(--icon-right-position) center;background-repeat:no-repeat;background-size:var(--icon-size) var(--icon-size);padding-right:calc(var(--icon-right-position) * 5)}:host{display:flex;width:100%;flex-direction:column}audio{visibility:hidden}label{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:14px}.group{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px)}.group>*{margin-bottom:var(--dyte-space-2, 8px)}.group>*:last-child{margin-bottom:var(--dyte-space-0, 0px)}.group select{flex:1 1 0%}.row{display:flex;align-items:center;justify-content:space-between;gap:var(--dyte-space-3, 12px)}.dyte-select{width:100%;max-width:100%}dyte-audio-visualizer{flex-shrink:0}dyte-button{border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-sha
2dow)}dyte-button dyte-icon{margin-right:var(--dyte-space-2, 8px)}";var Qs=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.onVideoUpdate=function(e){n.videoEnabled=e.videoEnabled},this.meeting=void 0,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.videoDevices=[],this.currentDevice=void 0,this.videoEnabled=void 0}return(0,c.Z)(e,[{key:"componentDidLoad",value:function(){this.meetingChanged(this.meeting)}},{key:"meetingChanged",value:function(e){var t,n=this;null!=e&&(this.videoEnabled=e.self.videoEnabled,null===(t=e.self)||void 0===t||t.addListener("videoUpdate",this.onVideoUpdate),je((0,f.Z)((0,h.Z)().mark((function t(){var r,i,a,o;return(0,h.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.self.getVideoDevices();case 2:a=t.sent,o=null===(r=e.self.getCurrentDevices())||void 0===r?void 0:r.video,n.videoDevices=void 0!=o?[null!==(i=a.find((function(e){return e.deviceId===o.deviceId})))&&void 0!==i?i:o].concat((0,m.Z)(a.filter((function(e){return e.deviceId!==o.deviceId})))):a;case 5:case"end":return t.stop()}}),t)})))))}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.meeting.self)||void 0===e||e.removeListener("videoUpdate",this.onVideoUpdate)}},{key:"setDevice",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){var n,r;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.videoDevices.find((function(e){return e.deviceId===t})),this.currentDevice=r,null==r){e.next=5;break}return e.next=5,null===(n=this.meeting)||void 0===n?void 0:n.self.setDevice(r);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e,t,n=this;if(null==this.meeting)return null;var r=0,i=this.states||br,a=!0===(null===(e=null===i||void 0===i?void 0:i.prefs)||void 0===e?void 0:e.mirrorVideo)||"true"===pr("mirror-video");return T(C,null,T("div",{class:"group",part:"tile-preview"},!0===this.videoEnabled?T("dyte-participant-tile",{participant:null===(t=this.meeting)||void 0===t?void 0:t.self,iconPack:this.iconPack,t:this.t,states:i,isPreview:!0}):T("div",{class:"camera-off-helper"},T("dyte-participant-tile",{participant:void 0},T("div",null,T("dyte-icon",{id:"icon",icon:this.iconPack.video_off,tabIndex:-1,"aria-hidden":!0,iconPack:this.iconPack,t:this.t}),T("div",null,"Camera is off"))))),T("div",{class:"group",part:"camera-selection"},T("label",null,"Camera"),T("div",{class:"row"},T("select",{class:"dyte-select",onChange:function(e){return n.setDevice(e.target.value)}},this.videoDevices.map((function(e){var t=e.deviceId,n=e.label;return T("option",{value:t},n||"Camera ".concat(++r))}))))),T("div",{class:"group",part:"mirror-toggle"},T("div",{class:"row"},T("label",{htmlFor:"mirror-toggle"},"Mirror my Video"),T("dyte-switch",{checked:a,iconPack:this.iconPack,t:this.t,onDyteChange:function(e){var t,r=e.target.checked;n.stateUpdate.emit({prefs:{mirrorVideo:r}}),br.prefs=Object.assign(Object.assign({},null!==(t=br.prefs)&&void 0!==t?t:{}),{mirrorVideo:r}),dr("mirror-video",r)}}))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Qs.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.dyte-select{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255))}.dyte-select:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
2dow, 0 0 #0000)}.dyte-select{display:block;border-radius:var(--dyte-border-radius-sm, 4px);border-width:var(--dyte-border-width-none, 0);border-style:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--dyte-space-3, 12px);font-size:16px;--icon-size:var(--dyte-select-chevron-size, var(--dyte-space-6, 24px));--icon-right-position:var(--dyte-select-chevron-right-position, var(--dyte-space-2, 8px));background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right var(--icon-right-position) center;background-repeat:no-repeat;background-size:var(--icon-size) var(--icon-size);padding-right:calc(var(--icon-right-position) * 5)}:host{display:flex;width:100%;flex-direction:column}dyte-participant-tile{margin-left:auto;margin-right:auto;margin-bottom:var(--dyte-space-4, 16px);max-width:100%}#icon{padding-bottom:var(--dyte-space-1, 4px)}.apply-button{height:var(--dyte-space-10, 40px)}label{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:14px}.group{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px)}.group>*{margin-bottom:var(--dyte-space-2, 8px)}.group>*:last-child{margin-bottom:var(--dyte-space-0, 0px)}.group select{flex:1 1 0%}.row{display:flex;align-items:center;justify-content:space-between;gap:var(--dyte-space-3, 12px)}";var Ys=Object.freeze({__proto__:null,dyte_settings_audio:Ks,dyte_settings_video:Qs}),Xs=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.tabChange=I(this,"tabChange",7),this.size=void 0,this.meeting=void 0,this.states=void 0,this.config=Ue,this.layout="row",this.iconPack=ar,this.t=ir(),this.activeTab=void 0,this.tabs=[]}return(0,c.Z)(e,[{key:"render",value:function(){var e=this;return T(C,null,T("dyte-spotlight-indicator",{meeting:this.meeting,iconPack:this.iconPack,t:this.t,size:this.size}),this.tabs.map((function(t){var n,r,i,a,o;if("screenshare"===t.type){var s=t.participant,c=Ra(s.name);return T("dyte-button",{title:"".concat(c,"'s Screen Share"),key:t.participant.id,kind:"icon",iconPack:e.iconPack,t:e.t,class:{tab:!0,active:"screenshare"===(null===(n=e.activeTab)||void 0===n?void 0:n.type)&&(null===(r=e.activeTab)||void 0===r?void 0:r.participant.id)===t.participant.id},onClick:function(){return e.tabChange.emit(t)}},T("div",{class:"center col"},T("dyte-icon",{icon:e.iconPack.share_screen_person,iconPack:e.iconPack,t:e.t}),T("span",{class:"name"},s.id===(null===(i=e.meeting)||void 0===i?void 0:i.self.id)?e.t("You"):Pa(c,6))))}if("plugin"===t.type){var u=t.plugin;return T("dyte-button",{title:u.name,key:u.id,kind:"icon",iconPack:e.iconPack,t:e.t,class:{tab:!0,active:"plugin"===(null===(a=e.activeTab)||void 0===a?void 0:a.type)&&(null===(o=e.activeTab)||void 0===o?void 0:o.plugin.id)===u.id},onClick:function(){return e.tabChange.emit(t)}},T("div",{class:"center col"},T("img",{src:u.picture}),T("span",{class:"name"},Pa(u.name,6))))}})))}}]),e}();Xs.style=":host{box-sizing:border-box;display:flex;height:100%;width:var(--dyte-space-16, 64px);flex-direction:column;gap:var(--dyte-space-2, 8px);font-family:var(--dyte-font-family, sans-serif)}dyte-button{z-index:10}.col{display:flex;flex-direction:column;align-items:center}.tab{display:flex;height:var(--dyte-space-16, 64px);width:var(--dyte-space-16, 64px);align-items:center;justify-content:center;margin-bottom:var(--dyte-space-2, 8px);font-size:12px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.tab.active{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}.tab img{height:var(--dyte-space-7, 28px);width:var(--dyte-space-7, 28px);border-radius:var(--dyte-border-radius-sm, 4px)}@media (orientation: portrait){:host([size='sm']){margin-top:var(--dyte-space-2, 8px);height:var(--dyte-space-16, 64px);width:100%;flex-direction:row;transition:all 0.3s linear}:host([size='md']){height:var(--dyte-space-24, 96px);width:100%;flex-direction:row;transition:all 0.3s linear}:host .tab{margin:var(--dyte-space-0, 0px)}}:host([size='sm']){flex-direction:column;margin-top:var(--dyte-space-4, 16px);height:var(--dyte-space-16, 64px);width:100%;flex-direction:row;gap:var(--dyte-space-2, 8px);overflow-x:auto}:host([size='sm']) .tab{margin:var(--dyte-space-0, 0px);text-overflow:clip;min-width:100px;height:40px}:host([size='sm']) .tab .col{display:flex;flex-direction:row;align-items:center;gap:var(--dyte-space-2, 8px)}:host([size='sm']) .tab .col img,:host([size='sm']) .tab .col dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}:host([layout='column']){flex-direction:column}:host([layout='column']) .aside{flex:2;max-width:100%;width:100%}";var ec,tc=Object.freeze({__proto__:null,dyte_tab_bar:Xs}),nc=rc;function rc(){}rc.mixin=function(e){var t=e.prototype||e;t.isWildEmitter=!0,t.on=function(e,t,n){this.callbacks=this.callbacks||{};var r=3===arguments.length,i=r?arguments[1]:void 0,a=r?arguments[2]:arguments[1];return a._groupName=i,(this.callbacks[e]=this.callbacks[e]||[]).push(a),this},t.once=function(e,t,n){var r=this,i=3===arguments.length,a=i?arguments[1]:void 0,o=i?arguments[2]:arguments[1];return this.on(e,a,(function t(){r.off(e,t),o.apply(this,arguments)})),this},t.releaseGroup=function(e){var t,n,r,i;for(t in this.callbacks=this.callbacks||{},this.callbacks)for(n=0,r=(i=this.callbacks[t]).length;n<r;n++)i[n]._groupName===e&&(i.splice(n,1),n--,r--);return this},t.off=function(e,t){this.callbacks=this.callbacks||{};var n,r=this.callbacks[e];return r?1===arguments.length?(delete this.callbacks[e],this):(-1!==(n=r.indexOf(t))&&(r.splice(n,1),0===r.length&&delete this.callbacks[e]),this):this},t.emit=function(e){this.callbacks=this.callbacks||{};
2var t,n,r,i=[].slice.call(arguments,1),a=this.callbacks[e],o=this.getWildcardCallbacks(e);if(a)for(t=0,n=(r=a.slice()).length;t<n&&r[t];++t)r[t].apply(this,i);if(o)for(n=o.length,t=0,n=(r=o.slice()).length;t<n&&r[t];++t)r[t].apply(this,[e].concat(i));return this},t.getWildcardCallbacks=function(e){this.callbacks=this.callbacks||{};var t,n,r=[];for(t in this.callbacks)n=t.split("*"),("*"===t||2===n.length&&e.slice(0,n[0].length)===n[0])&&(r=r.concat(this.callbacks[t]));return r}},rc.mixin(rc),"undefined"!==typeof window&&(ec=window.AudioContext||window.webkitAudioContext);var ic=null,ac=function(e,t){if(null!=e){var n=Math.round(1.5),r=(0,m.Z)(Array(3)).map((function(e,r){var i=r;return i>n-1&&(i=3-i-1),Math.round((i+1)/(n+1)*t)})),i=e.width,a=e.height,s=e.getContext("2d"),c=2,u=1*i/r.length,l=u-4;s.clearRect(0,0,i,a),s.fillStyle="rgb(0,0,0,0.0)",s.fillRect(0,0,i,a);var d=getComputedStyle(e).getPropertyValue("color");s.fillStyle=d,s.strokeStyle=d,s.lineCap="round",s.lineWidth=4,s.beginPath();var p,h=(0,o.Z)(r);try{for(h.s();!(p=h.n()).done;){var f=p.value,v=Math.min(-Math.abs(1.2*f/10*a)+a/2,a/2-2.5),g=Math.max(2*(a/2-v),5);s.moveTo(c+l/2,v),s.lineTo(c+l/2,v+g),c+=u}}catch(y){h.e(y)}finally{h.f()}s.stroke()}},oc=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.variant="bars",this.participant=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.isScreenShare=!1,this.audioEnabled=void 0,this.volume=0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.participantChanged(this.participant)}},{key:"componentDidLoad",value:function(){ac(this.visualizer,0)}},{key:"disconnectedCallback",value:function(){var e,t,n;null===(e=this.hark)||void 0===e||e.stop(),this.audioUpdateListener&&(null===(t=this.participant)||void 0===t||t.removeListener("audioUpdate",this.audioUpdateListener)),this.screenShareUpdateListener&&(null===(n=this.participant)||void 0===n||n.removeListener("screenShareUpdate",this.screenShareUpdateListener))}},{key:"participantChanged",value:function(e){var t=this;null!=e&&(this.audioUpdateListener=function(e){var n,r=e.audioEnabled,i=e.audioTrack;if(null===(n=t.hark)||void 0===n||n.stop(),r&&null!=i){t.audioEnabled=!0;var a=new MediaStream;a.addTrack(i),t.calcVolume(a),ac(t.visualizer,0)}else t.volume=0,t.audioEnabled=!1},this.isScreenShare?(this.screenShareUpdateListener=function(e){var n=e.screenShareEnabled,r=e.screenShareTracks;t.audioUpdateListener({audioEnabled:n&&null!=r.audio,audioTrack:r.audio})},this.screenShareUpdateListener(e),e.addListener("screenShareUpdate",this.screenShareUpdateListener)):(this.audioUpdateListener(e),e.addListener("audioUpdate",this.audioUpdateListener)))}},{key:"calcVolume",value:function(e){var t=this;this.hark=function(e,t){var n=new nc;if(!ec)return n;var r,i,a,o=(t=t||{}).smoothing||.1,s=t.interval||50,c=t.threshold,u=t.play,l=t.history||10,d=!0;ic=t.audioContext||ic||new ec,(a=ic.createAnalyser()).fftSize=512,a.smoothingTimeConstant=o,i=new Float32Array(a.frequencyBinCount),e.jquery&&(e=e[0]),e instanceof HTMLAudioElement||e instanceof HTMLVideoElement?(r=ic.createMediaElementSource(e),"undefined"===typeof u&&(u=!0),c=c||-50):(r=ic.createMediaStreamSource(e),c=c||-50),r.connect(a),u&&a.connect(ic.destination),n.speaking=!1,n.suspend=function(){return ic.suspend()},n.resume=function(){return ic.resume()},Object.defineProperty(n,"state",{get:function(){return ic.state}}),ic.onstatechange=function(){n.emit("state_change",ic.state)},n.setThreshold=function(e){c=e},n.setInterval=function(e){s=e},n.stop=function(){d=!1,n.emit("volume_change",-100,c),n.speaking&&(n.speaking=!1,n.emit("stopped_speaking")),a.disconnect(),r.disconnect()},n.speakingHistory=[];for(var p=0;p<l;p++)n.speakingHistory.push(0);return function e(){setTimeout((function(){if(d){var t=function(e,t){var n=-1/0;e.getFloatFrequencyData(t);for(var r=4,i=t.length;r<i;r++)t[r]>n&&t[r]<0&&(n=t[r]);return n}(a,i);n.emit("volume_change",t,c);var r=0;if(t>c&&!n.speaking){for(var o=n.speakingHistory.length-3;o<n.speakingHistory.length;o++)r+=n.speakingHistory[o];r>=2&&(n.speaking=!0,n.emit("speaking"))}else if(t<c&&n.speaking){for(o=0;o<n.speakingHistory.length;o++)r+=n.speakingHistory[o];0==r&&(n.speaking=!1,n.emit("stopped_speaking"))}n.speakingHistory.shift(),n.speakingHistory.push(0+(t>c)),e()}}),s)}(),n}(e,{play:!1,interval:100}),this.hark.on("volume_change",(function(e){var n=t.volume,r=Math.round(10*Math.pow(10,e/115));r<3&&(r=0);var i=Math.round((2*n+r)/3);n!==i&&(t.volume=i,ac(t.visualizer,t.volume))}))}},{key:"render",value:function(){var e=this;return T(C,null,T("canvas",{width:"24",height:"24",class:{bars:!0,visible:this.audioEnabled},ref:function(t){return e.visualizer=t},part:"canvas"}),!this.isScreenShare&&!this.audioEnabled&&T("dyte-icon",{icon:this.iconPack.mic_off,part:"mic-off-icon",iconPack:this.iconPack,t:this.t}))}}],[{key:"watchers",get:function(){return{participant:["participantChanged"]}}}]),e}();oc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block;height:var(--dyte-space-6, 24px);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}canvas,dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}:host([size='sm']){transform:scale(0.9)}
2canvas{display:none}canvas.visible{display:block}canvas.bars{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";var sc=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.dyteChange=I(this,"dyteChange",4),this.onClick=function(){n.readonly||n.disabled||(n.checked=!n.checked)},this.onKeyPress=function(e){if(!n.readonly)switch(e.key){case"Enter":case" ":n.checked=!n.checked}},this.checked=!1,this.readonly=!1,this.disabled=!1,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"checkedChange",value:function(e){this.dyteChange.emit(e)}},{key:"render",value:function(){return T(C,{role:"switch",tabIndex:this.disabled&&0,"aria-readonly":this.readonly,"aria-checked":this.checked,"aria-disabled":this.disabled,class:{checked:this.checked},onClick:this.onClick,onKeyPress:this.onKeyPress},T("div",{class:"switch",part:"switch"}))}}],[{key:"watchers",get:function(){return{checked:["checkedChange"]}}}]),e}();sc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);box-sizing:border-box;display:inline-flex;height:var(--dyte-space-6, 24px);width:var(--dyte-space-10, 40px);align-items:center;padding:var(--dyte-space-1, 4px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));cursor:pointer}.switch{box-sizing:border-box;height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px);background-color:rgb(var(--dyte-colors-text-on-brand-1000, var(--dyte-colors-text-1000, 255 255 255)));border-radius:9999px;transition-property:var(--dyte-transition-property, all);transition-duration:200ms}:host(.checked){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}:host(.checked) .switch{transform:translateX(100%)}:host([readonly]),:host([disabled]){cursor:not-allowed;opacity:0.6}";var cc=Object.freeze({__proto__:null,dyte_audio_visualizer:oc,dyte_switch:sc}),uc=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.renderMessage=function(){if("chat"===n.messageItem.type){var e=n.messageItem.message;switch(e.type){case"text":return T("div",{"is-continued":n.isContinued,key:e.id},n.isUnread&&T("div",{class:"new-chat-marker",part:"new-chat-marker"},n.t("chat.new")),T("dyte-text-message",{message:e,now:n.now,isContinued:n.isContinued,"data-timestamp":e.time.getTime(),ref:n.observeMessage,iconPack:n.iconPack,t:n.t}));case"image":return T("div",{"is-continued":n.isContinued,key:e.id},n.isUnread&&T("div",{class:"new-chat-marker",part:"new-chat-marker"},n.t("chat.new")),T("dyte-image-message",{message:e,now:n.now,isContinued:n.isContinued,iconPack:n.iconPack,"data-timestamp":e.time.getTime(),ref:n.observeMessage,t:n.t}));case"file":return T("div",{"is-continued":n.isContinued,key:e.id},n.isUnread&&T("div",{class:"new-chat-marker",part:"new-chat-marker"},n.t("chat.new")),T("dyte-file-message",{message:e,now:n.now,isContinued:n.isContinued,iconPack:n.iconPack,t:n.t,"data-timestamp":e.time.getTime(),ref:n.observeMessage}))}}},this.messageItem=void 0,this.isContinued=void 0,this.isUnread=void 0,this.observeMessage=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.now=new Date}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("slot",null),T("div",{class:"message"},this.renderMessage()))}}]),e}();uc.style=":host{display:block}.file-picker{display:none}.head{display:flex;align-items:center}.head .name{margin-right:var(--dyte-space-4, 16px);font-size:12px;font-weight:700}.head .time{font-size:12px;color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.body{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);overflow-wrap:break-word;font-size:14px;line-height:1.375}.body .emoji{font-size:24px}p{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-3, 12px)}dyte-text-message,dyte-image-message,dyte-file-message{margin-top:var(--dyte-space-4, 16px);display:block;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);font-family:var(--dyte-font-family, sans-serif);color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));box-sizing:border-box}*[is-continued]{margin-top:var(--dyte-space-3, 12px)}dyte-text-message[is-continued]{margin-top:var(--dyte-space-2, 8px)}.image{position:relative;height:var(--dyte-space-40, 160px);max-width:var(--dyte-space-64, 256px);cursor:pointer}.image img{display:none;height:100%;width:100%;border-radius:var(--dyte-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.image .image-spinner dyte-spinner{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-sm, 4px);background-color:rgba(var(--dyte-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}.image .actions{display:none;height:var(--dyte-space-8, 32px);align-items:center;position:absolute;top:var(--dyte-space-2, 8px);right:var(--dyte-space-2, 8px);border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action{height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);border-radius:var(--dyte-border-radius-none, 0);border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}.chat .file{display:flex;align-items:center;gap:var(--dyte-space-1, 4px);padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);padding-top:var(--dyte-space-1\\.5, 6px);padding-bottom:var(--dyte-space-1\\.5, 6px);border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.chat .file .file-data{flex:1 1 0%}.chat .file .file-data .name{word-break:break-all;color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split{margin-top:var(--dyte-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.chat .file .file-data .file-data-split .ext{margin-right:var(--dyte-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split .divider{height:var(--dyte-space-4, 16px);width:var(--dyte-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.chat .file .file-data .file-data-split .size{margin-left:var(--dyte-space-2, 8px)}a{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity));-webkit-text-decoration-line:none;text-decoration-line:none}a:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.new-chat-marker{display:flex;width:100%;align-items:center;gap:var(--dyte-space-2, 8px);--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.new-chat-marker::before{content:'';height:1px;flex:1 1 0%;background-color:rgba(var(--dyte-colors-brand-300, 73 124 253) / 0.5)}.show-new-messages-ctr{pointer-events:none;display:flex;justify-content:flex-end;padding:var(--dyte-space-3, 12px);z-index:0;margin-top:calc(var(--dyte-space-14, 56px) * -1)}.show-new-messages{pointer-events:auto;--tw-translate-y:calc(var(--dyte-space-6, 24px) * -1);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.show-new-messages.active{--tw-translate-y:var(--dyte-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}";var lc="[object Symbol]";var dc=/\s/;var pc=/^\s+/;function hc(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&dc.test(e.charAt(t)););return t}(e)+1).replace(pc,""):e}var fc=NaN,vc=/^[-+]0x[0-9a-f]+$/i,mc=/^0b[01]+$/i,gc=/^0o[0-7]+$/i,yc=parseInt;function bc(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||tt(e)&&Xe(e)==lc}(e))return fc;if(et(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=et(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=hc(e);var n=mc.test(e);return n||gc.test(e)?yc(e.slice(2),n?2:8):vc.test(e)?fc:+e}var kc=function(){return ze.Date.now()},_c=Math.max,wc=Math.min;function xc(e,t,n){var r,i,a,o,s,c,u=0,l=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function f(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-u>=a}function v(){var e=kc();if(f(e))return m(e);s=setTimeout(v,function(e){var n=t-(e-c);return d?wc(n,a-(e-u)):n}(e))}function m(e){return s=void 0,p&&r?h(e):(r=i=void 0,o)}function g(){var e=kc(),n=f(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(v,t),l?h(e):o}(c);if(d)return clearTimeout(s),s=setTimeout(v,t),h(c)}return void 0===s&&(s=setTimeout(v,t)),o}return t=bc(t)||0,et(n)&&(l=!!n.leading,a=(d="maxWait"in n)?_c(bc(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=i=s=void 0},g.flush=function(){return void 0===s?o:m(kc())},g}var Sc=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.currentTime=function(){return(new Date).getTime()},this.observe=function(e){e&&n.intersectionObserver.observe(e)},this.pageSize=void 0,this.pagesAllowed=void 0,this.fetchData=void 0,this.createNodes=void 0,this.iconPack=ar,this.t=ir(),this.rerenderBoolean=!1,this.shouldRenderNewNodes=!0,this.hasNewNodesToRender=!1,this.pagesToRender=[[]]}return(0,c.Z)(e,[{key:"onNewNode",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t){return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.shouldRenderNewNodes){e.next=3;break}return this.hasNewNodesToRender=!0,e.abrupt("return");case 3:this.addNodeToRender(t,!1),this.rerender();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"connectedCallback",value:function(){var e=this;this.rerender=xc(this.rerender.bind(this),50,{maxWait:200}),this.loadPage(this.currentTime(),this.pageSize,!0,(function(){return Ho(e.$paginatedList,!1)})),this.intersectionObserver=new IntersectionObserver((function(t){je((function(){var n,r=(0,o.Z)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;"bottom-scroll"===i.target.id&&(i.isIntersecting?e.loadBottom():e.shouldRenderNewNodes=!1),"top-scroll"===i.target.id&&i.isIntersecting&&e.loadTop()}}catch(a){r.e(a)}finally{r.f()}}))}))}},{key:"disconnectedCallback",value:function(){this.intersectionObserver.disconnect()}},{key:"componentDidLoad",value:function(){this.observe(this.$topRef),this.observe(this.$bottomRef)}},{key:"componentDidRender",value:function(){this.shouldRenderNewNodes&&Ho(this.$paginatedList)}},{key:"loadTop",value:function(){var e,t,n;if(0!==this.pagesToRender.length&&!(1===this.pagesToRender.length&&this.pagesToRender[0].length<this.pageSize)){var r=this.pagesToRender[0][0],i=null===(n=null===(t=null===(e=r.$attrs$)||void 0===e?void 0:e.messageItem)||void 0===t?void 0:t.message)||void 0===n?void 0:n.timeMs;this.loadPage(i-1,this.pageSize,!0,(function(){var e;return null===(e=r.$elm$)||void 0===e?void 0:e.scrollIntoView()}))}}},{key:"loadBottom",value:function(){var e,t,n;if(0!==this.pagesToRender.length)if(1===this.pagesToRender.length&&this.pagesToRender[0].length<this.pageSize)this.shouldRenderNewNodes=!0;else{var r=this.pagesToRender.at(-1).at(-1),i=null===(n=null===(t=null===(e=r.$attrs$)||void 0===e?void 0:e.messageItem)||void 0===t?void 0:t.message)||void 0===n?void 0:n.timeMs;
2this.loadPage(i+1,this.pageSize,!1,(function(){var e;return null===(e=r.$elm$)||void 0===e?void 0:e.scrollIntoView()}))}else this.shouldRenderNewNodes=!0}},{key:"addNodeToRender",value:function(e,t){if(t){var n=this.pagesToRender[0];if(n&&(null===n||void 0===n?void 0:n.length)<this.pageSize)n.unshift(e);else{var r=[e];this.pagesToRender.unshift(r),this.removeLastPageIfNeeded(!1)}}else{var i=this.pagesToRender.slice(-1),a=(0,v.Z)(i,1)[0];if(a&&(null===a||void 0===a?void 0:a.length)<this.pageSize)a.push(e);else{var o=[e];this.pagesToRender.push(o),this.removeLastPageIfNeeded(!0)}}}},{key:"loadPage",value:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t,n,r,i){var a,o,s,c,u=this;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.fetchData(t,n,r);case 2:if(null===(a=e.sent)||void 0===a?void 0:a.length){e.next=6;break}return r||(this.hasNewNodesToRender=!1,this.shouldRenderNewNodes=!0),e.abrupt("return");case 6:o=this.createNodes(a),s=o[o.length-1],c=new Proxy(s,{set:function(e,t,n){return"$elm$"===t&&n&&!e.$elm$&&i(),e[t]=n,!0}}),o[o.length-1]=c,o.forEach((function(e){return u.addNodeToRender(e,r)})),this.rerender();case 12:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"rerender",value:function(){this.rerenderBoolean=!this.rerenderBoolean}},{key:"removeLastPageIfNeeded",value:function(e){this.pagesToRender.length>this.pagesAllowed&&(e?this.pagesToRender.shift():this.pagesToRender.pop())}},{key:"onDownArrowClicked",value:function(){this.loadBottom()}},{key:"render",value:function(){var e=this;return T(C,null,T("div",{class:"scrollbar container",part:"container",ref:function(t){return e.$paginatedList=t}},T("slot",null),T("div",{class:"show-new-messages-ctr"},T("dyte-button",{class:{"show-new-messages":!0,active:!this.shouldRenderNewNodes},kind:"icon",part:"show-new-messages",onClick:function(){return e.onDownArrowClicked()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.chevron_down,iconPack:this.iconPack,t:this.t}))),T("div",{class:"smallest-dom-element",id:"top-scroll",ref:function(t){return e.$topRef=t}}),this.pagesToRender.map((function(e){return e.map((function(e){return e}))})),T("div",{class:"smallest-dom-element",id:"bottom-scroll",ref:function(t){return e.$bottomRef=t}})))}}]),e}();Sc.style=".scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;flex:1}.container{box-sizing:border-box;display:flex;flex-direction:column;padding-top:var(--dyte-space-4, 16px);padding-bottom:var(--dyte-space-4, 16px);flex:1 0 0px;overflow-y:scroll;}.file-picker{display:none}.chat *:first-child{margin-top:var(--dyte-space-0, 0px)}.chat .head{display:flex;align-items:center}.chat .head .name{margin-right:var(--dyte-space-4, 16px);font-size:12px;font-weight:700}.chat .head .time{font-size:12px;color:rgb(var(--dyte-colors-text-800, 255 255 255 / 0.76))}.chat .body{margin-top:var(--dyte-space-2, 8px);margin-bottom:var(--dyte-space-2, 8px);overflow-wrap:break-word;font-size:14px;line-height:1.375}.chat .body .emoji{font-size:24px}p{margin-top:var(--dyte-space-0, 0px);margin-bottom:var(--dyte-space-3, 12px)}dyte-text-message,dyte-image-message,dyte-file-message{margin-top:var(--dyte-space-4, 16px);display:block;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);font-family:var(--dyte-font-family, sans-serif);color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));box-sizing:border-box}*[is-continued]{margin-top:var(--dyte-space-3, 12px)}dyte-text-message[is-continued]{margin-top:var(--dyte-space-2, 8px)}.chat .image{position:relative;height:var(--dyte-space-40, 160px);max-width:var(--dyte-space-64, 256px);cursor:pointer}.chat .image img{display:none;height:100%;width:100%;border-radius:var(--dyte-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.chat .image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.chat .image .image-spinner dyte-spinner{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.chat .image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--dyte-border-radius-sm, 4px);background-color:rgba(var(--dyte-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}.chat .image .actions{display:none;height:var(--dyte-space-8, 32px);align-items:center;position:absolute;top:var(--dyte-space-2, 8px);right:var(--dyte-space-2, 8px);border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action{height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);border-radius:var(--dyte-border-radius-none, 0);border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}.chat .file{display:flex;align-items:center;gap:var(--dyte-space-1, 4px);padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);padding-top:var(--dyte-space-1\\.5, 6px);padding-bottom:var(--dyte-space-1\\.5, 6px);border-radius:var(--dyte-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}.chat .file .file-data{flex:1 1 0%}.chat .file .file-data .name{word-break:break-all;color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split{margin-top:var(--dyte-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.chat .file .file-data .file-data-split .ext{margin-right:var(--dyte-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split .divider{height:var(--dyte-space-4, 16px);width:var(--dyte-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.chat .file .file-data .file-data-split .size{margin-left:var(--dyte-space-2, 8px)}a{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity));-webkit-text-decoration-line:none;text-decoration-line:none}a:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.show-new-messages-ctr{pointer-events:none;position:absolute;bottom:var(--dyte-space-2, 8px);right:var(--dyte-space-4, 16px);z-index:0;margin-top:calc(var(--dyte-space-14, 56px) * -1)}.show-new-messages{pointer-events:auto;--tw-translate-y:calc(var(--dyte-space-6, 24px) * -1);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.show-new-messages.active{--tw-translate-y:var(--dyte-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}";var Ec=Object.freeze({__proto__:null,dyte_chat_message:uc,dyte_paginated_list:Sc}),Tc=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onClose=I(this,"dyteDialogClose",7),this.close=function(){n.open=!1,n.onClose.emit()},this.keydownListener=function(e){"Escape"===e.key&&n.open&&n.close()},this.hideCloseButton=!1,this.meeting=void 0,this.config=Ue,this.states=void 0,this.size=void 0,this.iconPack=ar,this.t=ir(),this.open=!0}
2return(0,c.Z)(e,[{key:"connectedCallback",value:function(){document.addEventListener("keydown",this.keydownListener)}},{key:"disconnectedCallback",value:function(){document.removeEventListener("keydown",this.keydownListener)}},{key:"render",value:function(){var e=this;return this.open?T(C,null,T("div",{id:"dialog",part:"container"},T("slot",null),!this.hideCloseButton&&T("dyte-button",{part:"close-button",id:"dismiss-btn",kind:"icon",variant:"ghost",onClick:function(){return e.close()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.dismiss,iconPack:this.iconPack,t:this.t})))):null}}]),e}();Tc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}:host{position:fixed;top:var(--dyte-space-0, 0px);right:var(--dyte-space-0, 0px);bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);box-sizing:border-box;padding:var(--dyte-space-4, 16px);flex-direction:column;align-items:center;justify-content:center;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / 0.5);color:rgb(var(--dyte-colors-text-1000, 255 255 255));visibility:hidden;display:none;z-index:60;-webkit-backdrop-filter:blur(12px) saturate(180%);backdrop-filter:blur(12px) saturate(180%)}#dialog{position:relative;max-height:100%;max-width:100%}#dismiss-btn{position:absolute;top:var(--dyte-space-3, 12px);right:var(--dyte-space-3, 12px);z-index:50}::slotted(*){max-height:100%;max-width:100%}:host([open]){visibility:visible;display:flex}:host([open='false']){visibility:hidden;display:none}";var Pc=Object.freeze({__proto__:null,dyte_dialog:Tc}),Cc=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){var t;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("https://cdn.dyte.in/assets/emojis-data.json");case 2:return t=e.sent,e.abrupt("return",t.json());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Rc=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.emojiClicked=I(this,"dyteEmojiClicked",7),this.iconPack=ar,this.t=ir(),this.emojiList=void 0,this.filterVal="",this.filteredEmojis=[]}return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){var e=this;Cc().then((function(t){e.emojiList=t,e.handleInputChange({value:""})}))}},{key:"handleInputChange",value:function(e){var t=this;this.filterVal=e.value;var n=new RegExp("([^,]*?".concat(this.filterVal,"[^,]*):(\\d+)"),"g");this.filteredEmojis=Array.from(this.emojiList.search.matchAll(n)).map((function(e){return{name:e[1],emoji:t.emojiList.emojis[e[2]]}}))}},{key:"handleEmojiClick",value:function(e){this.emojiClicked.emit(e)}},{key:"mapEmojiList",value:function(){var e,t=this;return(null===(e=this.emojiList)||void 0===e?void 0:e.length)>0?T("div",{id:"loader"},T("dyte-spinner",{iconPack:this.iconPack,t:this.t})):T("div",{id:"emoji-grid",class:"scrollbar"},this.filteredEmojis.map((function(e){return T("dyte-button",{iconPack:t.iconPack,t:t.t,key:"emoji-button-".concat(e.name),class:"emoji",variant:"ghost",kind:"icon",title:e.name,onClick:function(){return t.handleEmojiClick(e.emoji)}},e.emoji)})))}},{key:"render",value:function(){var e=this;return T(C,null,T("input",{value:this.filterVal,onInput:function(t){return e.handleInputChange(t.target)},placeholder:this.t("Search")}),this.mapEmojiList())}}]),e}();Rc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))\n    var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--dyte-space-1\\.5, 6px);width:var(--dyte-space-1\\.5, 6px);border-radius:9999px;background-color:var(--dyte-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--dyte-scrollbar-color, rgb(var(--dyte-colors-background-600, 60 60 60)))}:host{box-sizing:border-box;display:inline-flex;height:var(--dyte-space-64, 256px);flex-direction:column;padding:var(--dyte-space-3, 12px);padding-bottom:var(--dyte-space-0, 0px);width:auto;min-width:var(--dyte-space-20, 80px);-webkit-user-select:none;-moz-user-select:none;user-select:none;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255))}#emoji-grid{margin-top:var(--dyte-space-2, 8px);box-sizing:border-box;display:grid;grid-template-columns:repeat(7, minmax(0, 1fr));padding-bottom:var(--dyte-space-12, 48px);overflow-x:hidden;overflow-y:scroll;height:100%;grid-auto-rows:minmax(-webkit-min-content, -webkit-max-content);grid-auto-rows:minmax(min-content, max-content)}#loader{display:flex;height:100%;width:100%;align-items:center;justify-content:center}input{display:block;height:var(--dyte-space-8, 32px);padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);font-size:14px;border-width:var(--dyte-border-width-none, 0);border-style:solid;border-style:none;border-color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64));--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88))}input::-moz-placeholder{color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}input::placeholder{color:rgb(var(--dyte-colors-text-700, 255 255 255 / 0.64))}input{border-radius:var(--dyte-border-radius-sm, 4px);outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;border:var(--dyte-border-width-sm, 1px) solid rgb(var(--dyte-colors-background-600, 60 60 60))}input:focus{--tw-border-opacity:1;border-color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-border-opacity));--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-sha
2dow, 0 0 #0000);--tw-ring-color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-ring-opacity));--tw-ring-opacity:0.3}.emoji{height:var(--dyte-space-10, 40px);width:var(--dyte-space-10, 40px);font-size:20px;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}";var Zc=Object.freeze({__proto__:null,dyte_emoji_picker:Rc}),Mc=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.pinnedListener=function(e){var t=e.isPinned;n.isPinned=t},this.stageListener=function(e){var t=e.webinarStageStatus;n.isOnStage="ON_STAGE"===t},this.meeting=void 0,this.view="sidebar",this.participant=void 0,this.iconPack=ar,this.t=ir(),this.audioEnabled=!1,this.videoEnabled=!1,this.isPinned=!1,this.isOnStage=!1,this.canDisableParticipantAudio=!1,this.canDisableParticipantVideo=!1,this.canKickParticipant=!1,this.canPinParticipant=!1,this.canAllowParticipantOnStage=!1}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting),this.participantChanged(this.participant)}},{key:"disconnectedCallback",value:function(){null!=this.participant&&void 0!=this.participant.removeListener&&(this.audioUpdateListener&&this.participant.removeListener("audioUpdate",this.audioUpdateListener),this.videoUpdateListener&&this.participant.removeListener("videoUpdate",this.videoUpdateListener),this.participant.removeListener("pinned",this.pinnedListener),this.participant.removeListener("unpinned",this.pinnedListener),this.participant.removeListener("peerStartedPresenting",this.stageListener),this.participant.removeListener("peerStoppedPresenting",this.stageListener))}},{key:"meetingChanged",value:function(e){if(null!=e){var t=e.self;this.canDisableParticipantAudio=t.permissions.canAllowParticipantAudio||t.permissions.canDisableParticipantAudio,this.canDisableParticipantVideo=t.permissions.canAllowParticipantVideo||t.permissions.canDisableParticipantVideo,this.canKickParticipant=t.permissions.kickParticipant,this.canPinParticipant=t.permissions.pinParticipant,this.canAllowParticipantOnStage=t.permissions.acceptPresentRequests}}},{key:"participantChanged",value:function(e){var t=this;if(null!=e){if(this.audioEnabled=e.audioEnabled,this.videoEnabled=e.videoEnabled,this.isPinned=e.isPinned,this.isOnStage="ON_STAGE"===e.webinarStageStatus,this.audioUpdateListener=function(e){var n=e.audioEnabled;t.audioEnabled=n},this.videoUpdateListener=function(e){var n=e.videoEnabled;t.videoEnabled=n},void 0==e.addListener)return;e.addListener("audioUpdate",this.audioUpdateListener),e.addListener("videoUpdate",this.videoUpdateListener),e.addListener("pinned",this.pinnedListener),e.addListener("unpinned",this.pinnedListener),e.addListener("peerStartedPresenting",this.stageListener),e.addListener("peerStoppedPresenting",this.stageListener)}}},{key:"render",value:function(){var e,t,n,r,i,a,o,s,c=this,u=this.canDisableParticipantAudio||this.canDisableParticipantVideo||this.canKickParticipant||this.canPinParticipant,l=Ra((null===(e=this.participant)||void 0===e?void 0:e.name)||""),d=this.isOnStage||"WEBINAR"!==(null===(n=null===(t=this.meeting)||void 0===t?void 0:t.meta)||void 0===n?void 0:n.viewType);return T(C,null,T("div",{class:"left"},T("dyte-avatar",{participant:this.participant,size:"sm",iconPack:this.iconPack,t:this.t}),T("p",{class:"name",title:l},Pa(l,16)," ",(null===(r=this.meeting)||void 0===r?void 0:r.self.id)===(null===(i=this.participant)||void 0===i?void 0:i.id)&&this.t("(you)"))),"sidebar"===this.view&&T("div",{class:"right"},d&&T("dyte-icon",{class:{red:!this.audioEnabled},iconPack:this.iconPack,t:this.t,icon:this.audioEnabled?this.iconPack.mic_on:this.iconPack.mic_off}),d&&T("dyte-icon",{class:{red:!this.videoEnabled},iconPack:this.iconPack,t:this.t,icon:this.videoEnabled?this.iconPack.video_on:this.iconPack.video_off}),u&&T("dyte-menu",{iconPack:this.iconPack,t:this.t},T("dyte-button",{variant:"ghost",kind:"icon",slot:"trigger",iconPack:this.iconPack,t:this.t},T("dyte-icon",{class:"more",icon:this.iconPack.more_vertical})),T("dyte-menu-list",{iconPack:this.iconPack,t:this.t},this.canPinParticipant&&d&&T("dyte-menu-item",{onClick:function(){c.isPinned?c.participant.unpin():c.participant.pin()},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.isPinned?this.iconPack.pin_off:this.iconPack.pin,slot:"start",iconPack:this.iconPack,t:this.t}),this.isPinned?this.t("Unpin"):this.t("Pin")),this.canDisableParticipantAudio&&d&&this.audioEnabled&&T("dyte-menu-item",{iconPack:this.iconPack,t:this.t,onClick:function(){c.participant.disableAudio()}},T("dyte-icon",{icon:this.iconPack.mic_off,slot:"start"}),this.t("mute")),this.canDisableParticipantVideo&&d&&this.videoEnabled&&T("dyte-menu-item",{iconPack:this.iconPack,t:this.t,onClick:function(){c.participant.disableVideo()}},T("dyte-icon",{icon:this.iconPack.video_off,slot:"start",iconPack:this.iconPack,t:this.t}),this.t("participant.turn_off_video")),"WEBINAR"===(null===(a=this.meeting)||void 0===a?void 0:a.meta.viewT
2ype)&&this.canAllowParticipantOnStage&&(null===(o=this.participant)||void 0===o?void 0:o.id)!==(null===(s=this.meeting)||void 0===s?void 0:s.self.id)&&T("dyte-menu-item",{iconPack:this.iconPack,t:this.t,class:this.isOnStage?"red":"",onClick:function(){var e=(0,f.Z)((0,h.Z)().mark((function e(){var t;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.participant,!c.isOnStage){e.next=7;break}return t.isPinned&&t.unpin(),e.next=5,t.removeFromStage();case 5:e.next=9;break;case 7:return e.next=9,t.acceptJoinStageRequest();case 9:c.isOnStage=!c.isOnStage;case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},T("dyte-icon",{iconPack:this.iconPack,t:this.t,icon:this.isOnStage?this.iconPack.leave_stage:this.iconPack.join_stage,slot:"start"}),this.isOnStage?this.t("stage.remove_from_stage"):this.t("stage.add_to_stage")),this.canKickParticipant&&T("dyte-menu-item",{iconPack:this.iconPack,t:this.t,class:"red",onClick:function(){var e,t;null===(e=c.meeting)||void 0===e||e.participants.kick(null===(t=c.participant)||void 0===t?void 0:t.id)}},T("dyte-icon",{icon:this.iconPack.dismiss,slot:"start",iconPack:this.iconPack,t:this.t}),this.t("kick"))))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"],participant:["participantChanged"]}}}]),e}();Mc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:flex;height:var(--dyte-space-14, 56px);align-items:center;justify-content:space-between;cursor:pointer;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}:host dyte-avatar{height:var(--dyte-space-8, 32px);width:var(--dyte-space-8, 32px);font-size:14px}.left{display:flex;align-items:center}.left>*{margin-right:var(--dyte-space-2, 8px)}.left>*:last-child{margin-right:var(--dyte-space-0, 0px)}.right{display:flex;align-items:center;justify-content:flex-end}.right>*{margin-left:var(--dyte-space-2, 8px)}.right>*:first-child{margin-left:var(--dyte-space-0, 0px)}.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}dyte-icon.red{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}dyte-icon.more{cursor:pointer}";var Ac=Object.freeze({__proto__:null,dyte_participant:Mc}),Ic=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.onVideoUpdate=function(e){n.videoState=e,null!=n.participant&&(e.videoEnabled?va.enableSource(n.participant.id):va.disableSource(n.participant.id))},this.onPinned=function(e){var t=e.isPinned;n.isPinned=t},this.isSelf=function(){var e;return n.isPreview||n.participant.id===(null===(e=n.meeting)||void 0===e?void 0:e.self.id)},this.videoState=void 0,this.isPinned=!1,this.nameTagPosition="bottom-left",this.isPreview=!1,this.participant=void 0,this.meeting=void 0,this.states=void 0,this.config=Ue,this.variant="solid",this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"onVideoRef",value:function(e){this.videoEl=e,this.isPreview||null==this.participant||(va.addSource(this.participant.id,this.videoEl,this.participant.videoEnabled),this.participant.videoEnabled&&va.enableSource(this.participant.id))}},{key:"connectedCallback",value:function(){this.participantsChanged(this.participant)}},{key:"componentDidLoad",value:function(){this.videoStateChanged(this.videoState)}},{key:"disconnectedCallback",value:function(){this.playTimeout&&clearTimeout(this.playTimeout),null!=this.participant&&(this.participant.removeListener("videoUpdate",this.onVideoUpdate),this.participant.removeListener("pinned",this.onPinned),this.participant.removeListener("unpinned",this.onPinned),va.removeSource(this.participant.id))}},{key:"participantsChanged",value:function(e){null!=e&&(this.videoState={videoEnabled:e.videoEnabled,videoTrack:e.videoTrack},this.isPinned=e.isPinned,e.addListener("videoUpdate",this.onVideoUpdate),e.addListener("pinned",this.onPinned),e.addListener("unpinned",this.onPinned))}},{key:"videoStateChanged",value:function(e){var t,n=this;if(null!=e&&null!=this.videoEl)if(e.videoEnabled){(null===(t=this.meeting)||void 0===t?void 0:t.__internals__.features.hasFeature(Ci))&&(this.playTimeout&&clearTimeout(this.playTimeout),this.playTimeout=setTimeout((function(){var e;null===(e=n.meeting)||void 0===e||e.__internals__.logger.log("dyte-participant-tile::playing_timeout")}),6e3));var r=new MediaStream;if(null==e.videoTrack)return;r.addTrack(e.videoTrack),this.videoEl.srcObject=r}else this.playTimeout&&clearTimeout(this.playTimeout),this.videoEl.srcObject=void 0}},{key:"isMirrored",value:function(){var e;if(null!=this.participant&&this.isSelf()){var t=this.states||br,n=null===(e=null===t||void 0===t?void 0:t.prefs)||void 0===e?void 0:e.mirrorVideo;if("boolean"===typeof n)return n}return!1}},{key:"render",value:function(){var e,t,n,r,i=this;return T(C,null,T("video",{ref:function(e){return i.onVideoRef(e)},class:(0,a.Z)({visible:null===(e=this.videoState)||void 0===e?void 0:e.videoEnabled,mirror:this.isMirrored()},null!==(r=null===(n=null===(t=this.config)||void 0===t?void 0:t.config)||void 0===n?void 0:n.videoFit)&&void 0!==r?r:"cover",!0),onPlaying:function(){i.playTimeout&&clearTimeout(i.playTimeout)},onPause:function(e){var t,n;i.isSelf()&&(null===(t=i.meeting)||void 0===t?void 0:t.__internals__.features.hasFeature(Ti
2))&&(i.meeting.__internals__.logger.warn("Video player paused for ".concat(i.participant.id," isSelf: ").concat(i.isSelf())),null===(n=null===e||void 0===e?void 0:e.target)||void 0===n||n.play())},autoPlay:!0,playsInline:!0,muted:!0}),this.isPinned&&T("dyte-icon",{class:"pinned-icon",icon:this.iconPack.pin,"aria-label":this.t("Pinned"),iconPack:this.iconPack,t:this.t}),T("slot",null))}}],[{key:"watchers",get:function(){return{participant:["participantsChanged"],videoState:["videoStateChanged"]}}}]),e}();Ic.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:16 / 9;height:var(--dyte-space-56, 224px);overflow:hidden;border-radius:var(--dyte-border-radius-lg, 12px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));transition-property:var(--dyte-transition-property, all);transition-duration:150ms}@media (prefers-reduced-motion){:host{--dyte-transition-property:none}}::slotted(dyte-name-tag){position:absolute;left:var(--dyte-space-3, 12px);bottom:var(--dyte-space-3, 12px)}:host([size='sm'][variant='solid']) ::slotted(dyte-name-tag){left:var(--dyte-space-2, 8px);bottom:var(--dyte-space-2, 8px);height:var(--dyte-space-4, 16px)}::slotted(dyte-network-indicator){position:absolute;right:var(--dyte-space-3, 12px);bottom:var(--dyte-space-3, 12px)}:host([size='sm']) ::slotted(dyte-network-indicator){right:var(--dyte-space-2, 8px);bottom:var(--dyte-space-2, 8px)}video{display:none;position:absolute;height:100%;width:100%;border-radius:var(--dyte-border-radius-lg, 12px)}video.contain{-o-object-fit:contain;object-fit:contain}video.cover{-o-object-fit:cover;object-fit:cover}video.visible{display:block}video::-webkit-media-controls{display:none !important}.pinned-icon{position:absolute;left:var(--dyte-space-3, 12px);top:var(--dyte-space-3, 12px);height:var(--dyte-space-5, 20px);width:var(--dyte-space-5, 20px);padding:var(--dyte-space-1, 4px);border-radius:var(--dyte-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([size='sm']) .pinned-icon{top:var(--dyte-space-2, 8px);left:var(--dyte-space-2, 8px)}:host([variant='gradient']) ::slotted(dyte-audio-visualizer){position:absolute;top:var(--dyte-space-2, 8px);right:var(--dyte-space-2, 8px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));padding:var(--dyte-space-2, 8px)}:host([variant='gradient']) ::slotted(dyte-name-tag){bottom:var(--dyte-space-0, 0px);left:var(--dyte-space-0, 0px);display:flex;width:100%;align-items:center;justify-content:center;text-align:center;background-color:transparent;background-image:linear-gradient(to top, var(--tw-gradient-stops));--tw-gradient-from:rgb(var(--dyte-colors-background-1000, 8 8 8));--tw-gradient-to:rgba(var(--dyte-colors-background-1000, 8 8 8) / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:transparent}video.mirror{transform:scaleX(-1)}:host([name-tag-position='bottom-right']) ::slotted(dyte-name-tag){left:auto;right:var(--dyte-space-3, 12px)}:host([name-tag-position='bottom-center']) ::slotted(dyte-name-tag){left:auto;right:auto}:host([name-tag-position='top-left']) ::slotted(dyte-name-tag){top:var(--dyte-space-3, 12px);bottom:auto}:host([name-tag-position='top-right']) ::slotted(dyte-name-tag){top:var(--dyte-space-3, 12px);right:var(--dyte-space-3, 12px);left:auto;bottom:auto}:host([name-tag-position='top-center']) ::slotted(dyte-name-tag){left:auto;right:auto;bottom:auto;top:var(--dyte-space-3, 12px)}";var Oc=Object.freeze({__proto__:null,dyte_participant_tile:Ic}),Lc=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.meeting=void 0,this.iconPack=ar,this.t=ir(),this.size=void 0,this.canSpotlight=void 0,this.isSpotlighted=void 0}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"meetingChanged",value:function(e){var t,n;null!=e&&(this.canSpotlight=e.self.permissions.canSpotlight,this.isSpotlighted=null!==(n=null===(t=e.spotlight)||void 0===t?void 0:t.spotlighted)&&void 0!==n&&n)}},{key:"updateSpotlightState",value:function(e){var t;try{null===(t=this.meeting.spotlight)||void 0===t||t.setSpotlighted(e),this.isSpotlighted=e}catch(n){console.error(n)}}},{key:"render",value:function(){var e=this;if(this.canSpotlight)return T(C,null,T("dyte-tooltip",{size:"md",iconPack:this.iconPack,t:this.t,label:this.t("Any plugin or screenshare you switch to will sync the change across the meeting")},T("div",{id:"sync-button",class:{tab:!0,active:this.isSpotlighted},onClick:function(){return e.updateSpotlightState(!e.isSpotlighted)}},T("span",{class:"name"},"Sync"),T("dyte-icon",{id:"icon",iconPack:this.iconPack,t:this.t,icon:this.isSpotlighted?this.iconPack.checkmark:this.iconPack.warning,tabIndex:-1,"aria-hidden":!0}))))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();Lc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);font-size:12px}#sync-button{flex-direction:row;border-radius:var(--dyte-border-radius-sm, 4px);padding-left:var(--dyte-space-1, 4px);display:flex;height:var(--dyte-space-16, 64px);width:100%;align-items:center;justify-content:center;margin-bottom:var(--dyte-space-2, 8px);font-size:12px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}
2:host([size='sm']) #sync-button{flex-direction:column-reverse;display:flex;height:var(--dyte-space-10, 40px);width:var(--dyte-space-16, 64px);align-items:center;justify-content:center}:host([size='md']) #sync-button{flex-direction:column-reverse;display:flex;height:var(--dyte-space-16, 64px);width:var(--dyte-space-16, 64px);align-items:center;justify-content:center}:host([size='lg']) #sync-button{flex-direction:row;display:flex;height:var(--dyte-space-8, 32px);width:var(--dyte-space-16, 64px);align-items:center;justify-content:center}@media (orientation: portrait){:host([size='lg']) #sync-button{flex-direction:column-reverse;display:flex;height:var(--dyte-space-16, 64px);width:var(--dyte-space-16, 64px);align-items:center;justify-content:center}:host([size='sm']) #sync-button{height:var(--dyte-space-10, 40px);width:var(--dyte-space-16, 64px);flex-direction:row}}#sync-button>dyte-icon{max-height:14px}#sync-button dyte-icon{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}#sync-button.active dyte-icon{color:rgb(var(--dyte-colors-text-1000, 255 255 255))}div{align-content:center;line-height:2rem}dyte-icon{height:var(--dyte-space-6, 24px);width:var(--dyte-space-8, 32px)}#sync-button.active{--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-success, 98 165 4) / var(--tw-bg-opacity))}";var Dc=Object.freeze({__proto__:null,dyte_spotlight_indicator:Lc}),Nc=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.logoUrl=void 0,this.config=Ue,this.meeting=void 0,this.t=ir()}return(0,c.Z)(e,[{key:"connectedCallback",value:function(){this.configChanged(this.config),this.meetingChanged(this.meeting)}},{key:"configChanged",value:function(e){var t;if(null!=e){var n=null===(t=null===e||void 0===e?void 0:e.designTokens)||void 0===t?void 0:t.logo;null!=n&&null==this.logoUrl&&(this.logoUrl=n)}}},{key:"meetingChanged",value:function(e){var t,n,r,i;if(null!=e){var a=null===(i=null===(r=null===(n=null===(t=e.self)||void 0===t?void 0:t.config)||void 0===n?void 0:n.header)||void 0===r?void 0:r.elements)||void 0===i?void 0:i.logo;null!=a&&null==this.logoUrl&&(this.logoUrl=a)}}},{key:"render",value:function(){if(!this.logoUrl||""===this.logoUrl)return null;var e=this.logoUrl,t=this.t("Logo");return T(C,null,T("img",{src:e,alt:t}))}}],[{key:"watchers",get:function(){return{config:["configChanged"],meeting:["meetingChanged"]}}}]),e}();Nc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;flex-direction:column;align-items:center;justify-content:center;color:rgb(var(--dyte-colors-text-1000, 255 255 255));height:100%;width:auto}svg,img{height:100%;width:auto}.brand-color{--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";var jc=Object.freeze({__proto__:null,dyte_logo:Nc}),Bc=function(e){var t,n=e.name,r=e.time,i=e.now;return T("div",{class:"head"},T("div",{class:"name"},Pa(Ra(n),20)),T("div",{class:"time",title:(t=r,t.toDateString()+" "+t.toLocaleTimeString())},function(e,t){var n=Os(e,t);if(n<2)return"just now";if(n<60)return"".concat(n,"m ago");var r=Math.round(n/60);if(n<90)return"about ".concat(r,"h ago");if(r<24)return"".concat(r,"h ago");var i=Math.round(r/24);if(i<7)return"".concat(i,"d ago");var a=Math.round(i/7);return"".concat(a,"w ago")}(r,i)))},Uc=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.message=void 0,this.now=new Date,this.isContinued=!1,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){var e=this,t=Ca(this.message.link);return T(C,null,!this.isContinued&&T(Bc,{name:this.message.displayName,time:this.message.time,now:this.now}),T("div",{class:"body",part:"body"},T("div",{class:"file"},T("div",{class:"file-data"},T("div",{class:"name"},this.message.name),T("div",{class:"file-data-split"},T("div",{class:"ext"},this.message.name.split(/[#?]/)[0].split(".").pop().trim()),T("span",{class:"divider"}),T("div",{class:"size"},function(e){if(!e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return"".concat((e/Math.pow(1024,t)).toFixed(2)," ").concat(["B","kB","MB","GB","TB"][t])}(this.message.size)))),T("dyte-button",{variant:"secondary",kind:"icon",iconPack:this.iconPack,t:this.t,onClick:function(){return Aa(t,{name:e.message.name,fallbackName:"file"})},part:"button"},T("dyte-icon",{icon:this.iconPack.download,iconPack:this.iconPack,t:this.t})))))}}]),e}(),Vc=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.stateUpdate=I(this,"dyteStateUpdate",7),this.message=void 0,this.now=new Date,this.isContinued=!1,this.iconPack=ar,this.t=ir(),this.status="loading"}return(0,c.Z)(e,[{key:"render",value:function(){var e=this;return T(C,null,!this.isContinued&&T(Bc,{name:this.message.displayName,time:this.message.time,now:this.now}),T("div",{class:"body",part:"body"},T("div",{class:{image:!0,loaded:"loaded"===this.status}},T("img",{src:Ca(this.message.link),onLoad:function(){e.status="loaded"},onError:function(){e.status="errored"},onClick:function(){"loaded"===e.status&&(e.stateUpdate.emit({image:e.message}),br.image=e.message)}}),"loading"===this.status&&T("div",{class:"image-spinner",title:this.t("Loading image"),"aria-label":this.t("Loading image")},T("dyte-spinner",{iconPack:this.iconPack,t:this.t})),"errored"===this.status&&T("div",{class:"image-errored",title:this.t("Image not found"),"aria-label":this.t("Image not found")},T("dyte-icon",{icon:this.iconPack.image_off,iconPack:this.iconPack,t:this.t})),"loaded"===this.status&&T("div",{class:"actions"},T("dyte-button",{class:"action",variant:"secondary",kind:"icon",onClick:function(){e.stateUpdate.emit({image:e.message}),br.image=e.message},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.full_screen_maximize})),T("dyte-button",{class:"action",variant:"secondary",kind:"icon",onClick:function(){return Aa(e.message.link,{fallbackName:"image"})},iconPack:this.iconPack,t:this.t},T("dyte-icon",{icon:this.iconPack.download,iconPack:this.iconPack,t:this.t}))))))}}]),e}();Vc.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif)}.image-spinner{cursor:wait}.image-errored{cursor:not-allowed}";var Fc=/(https?:\/\/[^\s]+)/,zc=function(e){return e.message.split("\n").map((function(e){return T("p",null,function(e){var t=e.split(" "),n=t.length-1;return t.map((function(e,t){return Fc.test(e)?T("span",null,T("a",{href:e,target:"_blank",rel:"noopener noreferrer"},e),t!==n?" ":""):"".concat(e).concat(t!==n?" ":"")}))}(e))}))},Hc=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.message=void 0,this.now=new Date,this.isContinued=!1,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,!this.isContinued&&T(Bc,{name:this.message.displayName,time:this.message.time,now:this.now}),T("div",{class:"body",part:"body"},T("div",{class:{text:!0,emoji:(e=this.message.message,/^(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDC-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8])+$/.test(e)&&!/^\d+$/.test(e))}},T(zc,{message:this.message.message}))));var e}}]),e}(),qc=Object.freeze({__proto__:null,dyte_file_message:Uc,dyte_image_message:Vc,dyte_text_message:Hc});function Gc(e){return e.split("-")[0]}function Wc(e){return e.split("-")[1]}
2function Jc(e){return["top","bottom"].includes(Gc(e))?"x":"y"}function $c(e){return"y"===e?"height":"width"}function Kc(e,t,n){var r,i=e.reference,a=e.floating,o=i.x+i.width/2-a.width/2,s=i.y+i.height/2-a.height/2,c=Jc(t),u=$c(c),l=i[u]/2-a[u]/2,d="x"===c;switch(Gc(t)){case"top":r={x:o,y:i.y-a.height};break;case"bottom":r={x:o,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:s};break;case"left":r={x:i.x-a.width,y:s};break;default:r={x:i.x,y:i.y}}switch(Wc(t)){case"start":r[c]-=l*(n&&d?-1:1);break;case"end":r[c]+=l*(n&&d?-1:1)}return r}var Qc=function(){var e=(0,f.Z)((0,h.Z)().mark((function e(t,n,r){var o,s,c,u,l,d,p,f,v,m,g,y,b,k,_,w,x,S,E,T,P,C,R,Z,M,A;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.placement,s=void 0===o?"bottom":o,c=r.strategy,u=void 0===c?"absolute":c,l=r.middleware,d=void 0===l?[]:l,p=r.platform,f=d.filter(Boolean),e.next=4,null==p.isRTL?void 0:p.isRTL(n);case 4:return v=e.sent,e.next=7,p.getElementRects({reference:t,floating:n,strategy:u});case 7:m=e.sent,g=Kc(m,s,v),y=g.x,b=g.y,k=s,_={},w=0,x=0;case 13:if(!(x<f.length)){e.next=46;break}return S=f[x],E=S.name,T=S.fn,e.next=17,T({x:y,y:b,initialPlacement:s,placement:k,strategy:u,middlewareData:_,rects:m,platform:p,elements:{reference:t,floating:n}});case 17:if(P=e.sent,C=P.x,R=P.y,Z=P.data,M=P.reset,y=null!=C?C:y,b=null!=R?R:b,_=(0,i.Z)((0,i.Z)({},_),{},(0,a.Z)({},E,(0,i.Z)((0,i.Z)({},_[E]),Z))),!(M&&w<=50)){e.next=43;break}if(w++,"object"!==typeof M){e.next=41;break}if(M.placement&&(k=M.placement),!M.rects){e.next=38;break}if(!0!==M.rects){e.next=36;break}return e.next=33,p.getElementRects({reference:t,floating:n,strategy:u});case 33:e.t0=e.sent,e.next=37;break;case 36:e.t0=M.rects;case 37:m=e.t0;case 38:A=Kc(m,k,v),y=A.x,b=A.y;case 41:return x=-1,e.abrupt("continue",43);case 43:x++,e.next=13;break;case 46:return e.abrupt("return",{x:y,y:b,placement:k,strategy:u,middlewareData:_});case 47:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();function Yc(e){return"number"!==typeof e?function(e){return(0,i.Z)({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function Xc(e){return(0,i.Z)((0,i.Z)({},e),{},{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}function eu(e,t){return tu.apply(this,arguments)}function tu(){return tu=(0,f.Z)((0,h.Z)().mark((function e(t,n){var r,a,o,s,c,u,l,d,p,f,v,m,g,y,b,k,_,w,x,S,E,T,P,C,R;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n={}),a=t.x,o=t.y,s=t.platform,c=t.rects,u=t.elements,l=t.strategy,p=(d=n).boundary,f=void 0===p?"clippingAncestors":p,v=d.rootBoundary,m=void 0===v?"viewport":v,g=d.elementContext,y=void 0===g?"floating":g,b=d.altBoundary,k=void 0!==b&&b,_=d.padding,w=Yc(void 0===_?0:_),x="floating"===y?"reference":"floating",S=u[k?x:y],e.t0=Xc,e.t1=s,e.next=10,null==s.isElement?void 0:s.isElement(S);case 10:if(e.t2=r=e.sent,null==e.t2){e.next=15;break}e.t3=r,e.next=16;break;case 15:e.t3=!0;case 16:if(!e.t3){e.next=20;break}e.t4=S,e.next=26;break;case 20:if(e.t5=S.contextElement,e.t5){e.next=25;break}return e.next=24,null==s.getDocumentElement?void 0:s.getDocumentElement(u.floating);case 24:e.t5=e.sent;case 25:e.t4=e.t5;case 26:return e.t6=e.t4,e.t7=f,e.t8=m,e.t9=l,e.t10={element:e.t6,boundary:e.t7,rootBoundary:e.t8,strategy:e.t9},e.next=33,e.t1.getClippingRect.call(e.t1,e.t10);case 33:return e.t11=e.sent,E=(0,e.t0)(e.t11),T="floating"===y?(0,i.Z)((0,i.Z)({},c.floating),{},{x:a,y:o}):c.reference,e.next=38,null==s.getOffsetParent?void 0:s.getOffsetParent(u.floating);case 38:return P=e.sent,e.next=41,null==s.isElement?void 0:s.isElement(P);case 41:if(!e.sent){e.next=50;break}return e.next=44,null==s.getScale?void 0:s.getScale(P);case 44:if(e.t13=e.sent,e.t13){e.next=47;break}e.t13={x:1,y:1};case 47:e.t12=e.t13,e.next=51;break;case 50:e.t12={x:1,y:1};case 51:if(C=e.t12,e.t14=Xc,!s.convertOffsetParentRelativeRectToViewportRelativeRect){e.next=59;break}return e.next=56,s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:T,offsetParent:P,strategy:l});case 56:e.t15=e.sent,e.next=60;break;case 59:e.t15=T;case 60:return e.t16=e.t15,R=(0,e.t14)(e.t16),e.abrupt("return",{top:(E.top-R.top+w.top)/C.y,bottom:(R.bottom-E.bottom+w.bottom)/C.y,left:(E.left-R.left+w.left)/C.x,right:(R.right-E.right+w.right)/C.x});case 63:case"end":return e.stop()}}),e)}))),tu.apply(this,arguments)}var nu=Math.min,ru=Math.max;function iu(e,t,n){return ru(e,nu(t,n))}
2var au={left:"right",right:"left",bottom:"top",top:"bottom"};function ou(e){return e.replace(/left|right|bottom|top/g,(function(e){return au[e]}))}function su(e,t,n){void 0===n&&(n=!1);var r=Wc(e),i=Jc(e),a=$c(i),o="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=ou(o)),{main:o,cross:ou(o)}}var cu={start:"end",end:"start"};function uu(e){return e.replace(/start|end/g,(function(e){return cu[e]}))}function lu(e){var t=ou(e);return[uu(e),t,uu(t)]}var du=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn:function(t){return(0,f.Z)((0,h.Z)().mark((function n(){var i,a,o,s,c,u,l,d,p,f,v,g,y,k,_,w,x,S,E,T,P,C,R,Z,M,A,I,O,L,D,N,j,B,U,V;return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=t.placement,o=t.middlewareData,s=t.rects,c=t.initialPlacement,u=t.platform,l=t.elements,p=(d=e).mainAxis,f=void 0===p||p,v=d.crossAxis,g=void 0===v||v,y=d.fallbackPlacements,k=d.fallbackStrategy,_=void 0===k?"bestFit":k,w=d.flipAlignment,x=void 0===w||w,S=(0,r.Z)(d,b),E=Gc(a),T=E===c,P=y||(T||!x?[ou(c)]:lu(c)),C=[c].concat((0,m.Z)(P)),n.next=8,eu(t,S);case 8:if(R=n.sent,Z=[],M=(null==(i=o.flip)?void 0:i.overflows)||[],f&&Z.push(R[E]),!g){n.next=23;break}return n.t0=su,n.t1=a,n.t2=s,n.next=18,null==u.isRTL?void 0:u.isRTL(l.floating);case 18:n.t3=n.sent,A=(0,n.t0)(n.t1,n.t2,n.t3),I=A.main,O=A.cross,Z.push(R[I],R[O]);case 23:if(M=[].concat((0,m.Z)(M),[{placement:a,overflows:Z}]),Z.every((function(e){return e<=0}))){n.next=40;break}if(N=(null!=(L=null==(D=o.flip)?void 0:D.index)?L:0)+1,!(j=C[N])){n.next=29;break}return n.abrupt("return",{data:{index:N,overflows:M},reset:{placement:j}});case 29:B="bottom",n.t4=_,n.next="bestFit"===n.t4?33:"initialPlacement"===n.t4?36:38;break;case 33:return V=null==(U=M.map((function(e){return[e,e.overflows.filter((function(e){return e>0})).reduce((function(e,t){return e+t}),0)]})).sort((function(e,t){return e[1]-t[1]}))[0])?void 0:U[0].placement,V&&(B=V),n.abrupt("break",38);case 36:return B=c,n.abrupt("break",38);case 38:if(a===B){n.next=40;break}return n.abrupt("return",{reset:{placement:B}});case 40:return n.abrupt("return",{});case 41:case"end":return n.stop()}}),n)})))()}}};function pu(e,t){return hu.apply(this,arguments)}function hu(){return hu=(0,f.Z)((0,h.Z)().mark((function e(t,n){var r,a,o,s,c,u,l,d,p,f,v,m,g,y;return(0,h.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.placement,a=t.platform,o=t.elements,e.next=3,null==a.isRTL?void 0:a.isRTL(o.floating);case 3:return s=e.sent,c=Gc(r),u=Wc(r),l="x"===Jc(r),d=["left","top"].includes(c)?-1:1,p=s&&l?-1:1,f="function"===typeof n?n(t):n,v="number"===typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:(0,i.Z)({mainAxis:0,crossAxis:0,alignmentAxis:null},f),m=v.mainAxis,g=v.crossAxis,y=v.alignmentAxis,u&&"number"===typeof y&&(g="end"===u?-1*y:y),e.abrupt("return",l?{x:g*p,y:m*d}:{x:m*d,y:g*p});case 13:case"end":return e.stop()}}),e)}))),hu.apply(this,arguments)}var fu=function(e){return void 0===e&&(e=0),{name:"offset",options:e,fn:function(t){return(0,f.Z)((0,h.Z)().mark((function n(){var r,i,a;return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.x,i=t.y,n.next=3,pu(t,e);case 3:return a=n.sent,n.abrupt("return",{x:r+a.x,y:i+a.y,data:a});case 5:case"end":return n.stop()}}),n)})))()}}};var vu,mu=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn:function(t){return(0,f.Z)((0,h.Z)().mark((function n(){var o,s,c,u,l,d,p,f,v,m,g,y,b,_,w,x,S,E,T,P,C,R,Z,M,A;return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return s=t.x,c=t.y,u=t.placement,d=(l=e).mainAxis,p=void 0===d||d,f=l.crossAxis,v=void 0!==f&&f,m=l.limiter,g=void 0===m?{fn:function(e){return{x:e.x,y:e.y}}}:m,y=(0,r.Z)(l,k),b={x:s,y:c},n.next=5,eu(t,y);case 5:return _=n.sent,w=Jc(Gc(u)),x="x"===w?"y":"x",S=b[w],E=b[x],p&&(T="y"===w?"bottom":"right",P=S+_["y"===w?"top":"left"],C=S-_[T],S=iu(P,S,C)),v&&(R="y"===x?"bottom":"right",Z=E+_["y"===x?"top":"left"],M=E-_[R],E=iu(Z,E,M)),A=g.fn((0,i.Z)((0,i.Z)({},t),{},(o={},(0,a.Z)(o,w,S),(0,a.Z)(o,x,E),o))),n.abrupt("return",(0,i.Z)((0,i.Z)({},A),{},{data:{x:A.x-s,y:A.y-c}}));case 14:case"end":return n.stop()}}),n)})))()}}};function gu(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function yu(e){return gu(e).getComputedStyle(e)}function bu(e){return xu(e)?(e.nodeName||"").toLowerCase():""}function ku(){if(vu)return vu;var e=navigator.userAgentData;return e&&Array.isArray(e.brands)?vu=e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function _u(e){return e instanceof gu(e).HTMLElement}function wu(e){return e instanceof gu(e).Element}function xu(e){return e instanceof gu(e).Node}function Su(e){return"undefined"!==typeof ShadowRoot&&(e instanceof gu(e).ShadowRoot||e instanceof ShadowRoot)}function Eu(e){var t=yu(e),n=t.overflow,r=t.overflowX,i=t.overflowY,a=t.display;return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(a)}function Tu(e){return["table","td","th"].includes(bu(e))}function Pu(e){var t=/firefox/i.test(ku()),n=yu(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((function(e){return n.willChange.includes(e)}))||["paint","layout","strict","content"].some((function(e){var t=n.contain;return null!=t&&t.includes(e)}))}function Cu(){return!/^((?!chrome|android).)*safari/i.test(ku())}function Ru(e){return["html","body","#document"].includes(bu(e))}var Zu=Math.min,Mu=Math.max,Au=Math.round;function Iu(e){var t=yu(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,a=e.offsetHeight,o=Au(n)!==i||Au(r)!==a;return o&&(n=i,r=a),{width:n,height:r,fallback:o}}function Ou(e){return wu(e)?e:e.contextElement}var Lu={x:1,y:1};function Du(e){var t=Ou(e);if(!_u(t))return Lu;var n=t.getBoundingClientRect(),r=Iu(t),i=r.width,a=r.height,o=r.fallback,s=(o?Au(n.width):n.width)/i,c=(o?Au(n.height):n.height)/a;return s&&Number.isFinite(s)||(s=1),c&&Number.isFinite(c)||(c=1),{x:s,y:c}}function Nu(e,t,n,r){var i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);var o=e.getBoundingClientRect(),s=Ou(e),c=Lu;t&&(r?wu(r)&&(c=Du(r)):c=Du(e));var u=s?gu(s):window,l=!Cu()&&n,d=(o.left+(l&&(null==(i=u.visualVie
2wport)?void 0:i.offsetLeft)||0))/c.x,p=(o.top+(l&&(null==(a=u.visualViewport)?void 0:a.offsetTop)||0))/c.y,h=o.width/c.x,f=o.height/c.y;if(s)for(var v=gu(s),m=r&&wu(r)?gu(r):r,g=v.frameElement;g&&r&&m!==v;){var y=Du(g),b=g.getBoundingClientRect(),k=getComputedStyle(g);b.x+=(g.clientLeft+parseFloat(k.paddingLeft))*y.x,b.y+=(g.clientTop+parseFloat(k.paddingTop))*y.y,d*=y.x,p*=y.y,h*=y.x,f*=y.y,d+=b.x,p+=b.y,g=gu(g).frameElement}return{width:h,height:f,top:p,right:d+h,bottom:p+f,left:d,x:d,y:p}}function ju(e){return((xu(e)?e.ownerDocument:e.document)||window.document).documentElement}function Bu(e){return wu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Uu(e){return Nu(ju(e)).left+Bu(e).scrollLeft}function Vu(e,t,n){var r=_u(t),i=ju(t),a=Nu(e,!0,"fixed"===n,t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==bu(t)||Eu(i))&&(o=Bu(t)),_u(t)){var c=Nu(t,!0);s.x=c.x+t.clientLeft,s.y=c.y+t.clientTop}else i&&(s.x=Uu(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}function Fu(e){if("html"===bu(e))return e;var t=e.assignedSlot||e.parentNode||(Su(e)?e.host:null)||ju(e);return Su(t)?t.host:t}function zu(e){return _u(e)&&"fixed"!==yu(e).position?e.offsetParent:null}function Hu(e){for(var t=gu(e),n=zu(e);n&&Tu(n)&&"static"===yu(n).position;)n=zu(n);return n&&("html"===bu(n)||"body"===bu(n)&&"static"===yu(n).position&&!Pu(n))?t:n||function(e){for(var t=Fu(e);_u(t)&&!Ru(t);){if(Pu(t))return t;t=Fu(t)}return null}(e)||t}function qu(e){var t=Fu(e);return Ru(t)?e.ownerDocument.body:_u(t)&&Eu(t)?t:qu(t)}function Gu(e,t){var n;void 0===t&&(t=[]);var r=qu(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=gu(r);return i?t.concat(a,a.visualViewport||[],Eu(r)?r:[]):t.concat(r,Gu(r))}function Wu(e,t,n){return"viewport"===t?Xc(function(e,t){var n=gu(e),r=ju(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Cu();(u||!u&&"fixed"===t)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n)):wu(t)?function(e,t){var n=Nu(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=_u(e)?Du(e):{x:1,y:1},o=e.clientWidth*a.x,s=e.clientHeight*a.y,c=i*a.x,u=r*a.y;return{top:u,left:c,right:c+o,bottom:u+s,x:c,y:u,width:o,height:s}}(t,n):Xc(function(e){var t,n=ju(e),r=Bu(e),i=null==(t=e.ownerDocument)?void 0:t.body,a=Mu(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Mu(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Uu(e),c=-r.scrollTop;return"rtl"===yu(i||n).direction&&(s+=Mu(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}(ju(e)))}var Ju={getClippingRect:function(e){var t=e.element,n=e.boundary,r=e.rootBoundary,i=e.strategy,a="clippingAncestors"===n?function(e,t){var n=t.get(e);if(n)return n;for(var r=Gu(e).filter((function(e){return wu(e)&&"body"!==bu(e)})),i=null,a="fixed"===yu(e).position,o=a?Fu(e):e;wu(o)&&!Ru(o);){var s=yu(o),c=Pu(o);(a?c||i:c||"static"!==s.position||!i||!["absolute","fixed"].includes(i.position))?i=s:r=r.filter((function(e){return e!==o})),o=Fu(o)}return t.set(e,r),r}(t,this._c):[].concat(n),o=[].concat((0,m.Z)(a),[r]),s=o[0],c=o.reduce((function(e,n){var r=Wu(t,n,i);return e.top=Mu(r.top,e.top),e.right=Zu(r.right,e.right),e.bottom=Zu(r.bottom,e.bottom),e.left=Mu(r.left,e.left),e}),Wu(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){var t=e.rect,n=e.offsetParent,r=e.strategy,i=_u(n),a=ju(n);if(n===a)return t;var o={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==bu(n)||Eu(a))&&(o=Bu(n)),_u(n))){var u=Nu(n);s=Du(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-o.scrollLeft*s.x+c.x,y:t.y*s.y-o.scrollTop*s.y+c.y}},isElement:wu,getDimensions:function(e){return Iu(e)},getOffsetParent:Hu,getDocumentElement:ju,getScale:Du,getElementRects:function(e){var t=this;return(0,f.Z)((0,h.Z)().mark((function n(){var r,a,o,s,c;return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.reference,a=e.floating,o=e.strategy,s=t.getOffsetParent||Hu,c=t.getDimensions,n.t0=Vu,n.t1=r,n.next=7,s(a);case 7:return n.t2=n.sent,n.t3=o,n.t4=(0,n.t0)(n.t1,n.t2,n.t3),n.t5=i.Z,n.t6={x:0,y:0},n.next=14,c(a);case 14:return n.t7=n.sent,n.t8=(0,n.t5)(n.t6,n.t7),n.abrupt("return",{reference:n.t4,floating:n.t8});case 17:case"end":return n.stop()}}),n)})))()},getClientRects:function(e){return Array.from(e.getClientRects())},isRTL:function(e){return"rtl"===yu(e).direction}},$u=function(e,t,n){var r=new Map,a=(0,i.Z)({platform:Ju},n),o=(0,i.Z)((0,i.Z)({},a.platform),{},{_c:r});return Qc(e,t,(0,i.Z)((0,i.Z)({},a),{},{platform:o}))},Ku=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.clickedThis=!1,this.handleOutsideClick=function(){n.clickedThis||(n.menuListEl.style.display="none"),n.clickedThis=!1},this.size=void 0,this.placement="bottom-end",this.iconPack=ar,this.t=ir()}
2return(0,c.Z)(e,[{key:"componentDidLoad",value:function(){document.addEventListener("click",this.handleOutsideClick),this.update()}},{key:"disconnectedCallback",value:function(){document.removeEventListener("click",this.handleOutsideClick)}},{key:"update",value:function(){var e=this;$u(this.triggerEl,this.menuListEl,{placement:this.placement,middleware:[fu(10),du(),mu({padding:5})]}).then((function(t){var n=t.x,r=t.y;Object.assign(e.menuListEl.style,{left:"".concat(n,"px"),top:"".concat(r,"px")})}))}},{key:"render",value:function(){var e=this;return T(C,null,T("span",{id:"trigger",ref:function(t){return e.triggerEl=t},onClick:function(){e.clickedThis=!0,"block"!==e.menuListEl.style.display?(e.menuListEl.style.display="block",e.update()):e.menuListEl.style.display="none"}},T("slot",{name:"trigger"})),T("span",{part:"menu-list",id:"menu-list",ref:function(t){return e.menuListEl=t}},T("slot",null)))}}]),e}();Ku.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);position:relative;display:inline-block;color:rgb(var(--dyte-colors-text-1000, 255 255 255))}#menu-list{position:absolute;z-index:20;display:none}";var Qu=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.size=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("slot",{name:"start"}),T("slot",null),T("slot",{name:"end"}))}}]),e}();Qu.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;align-items:center;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px);padding-top:var(--dyte-space-2, 8px);padding-bottom:var(--dyte-space-2, 8px);cursor:pointer;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;color:rgb(var(--dyte-colors-text-1000, 255 255 255));font-size:14px}::slotted([slot='start']){margin-right:var(--dyte-space-2, 8px)}::slotted([slot='end']){margin-left:var(--dyte-space-2, 8px)}:host(:hover){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host(.red){--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Yu=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("slot",null))}}]),e}();Yu.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;width:-webkit-max-content;width:-moz-max-content;width:max-content;flex-direction:column;padding-top:var(--dyte-space-2, 8px);padding-bottom:var(--dyte-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));overflow:hidden;border-radius:var(--dyte-border-radius-sm, 4px);--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}";var Xu=Object.freeze({__proto__:null,dyte_menu:Ku,dyte_menu_item:Qu,dyte_menu_list:Yu}),el=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.getAvatar=function(){var e,t,r=Ra((null===(e=n.participant)||void 0===e?void 0:e.name)||"");if(null!=n.participant&&"picture"in n.participant&&(t=n.participant.picture),t&&t.length>0&&"errored"!==n.imageState)return T("div",{class:"image-ctr"},"loading"===n.imageState&&T("dyte-spinner",{iconPack:n.iconPack,t:n.t}),T("img",{src:t,class:{loaded:"loaded"===n.imageState},loading:"lazy",title:r,onLoad:function(){return n.imageState="loaded"},onError:function(){return n.imageState="errored"},part:"image"}));var i=Za(r);return T("div",{class:"initials",title:r,part:"initials"},i)},this.participant=void 0,this.variant="circular",this.size=void 0,this.iconPack=ar,this.t=ir(),this.imageState="loading"}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,this.getAvatar())}}]),e}();el.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:flex;height:var(--dyte-space-32, 128px);width:var(--dyte-space-32, 128px);align-items:center;justify-content:center;font-size:28px;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-on-brand-1000, var(--dyte-colors-text-1000, 255 255 255)));overflow:hidden;border-radius:9999px}dyte-icon{height:50%;width:50%}.image-ctr{display:flex;height:100%;width:100%;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}img{height:var(--dyte-space-0, 0px);width:var(--dyte-space-0, 0px);-o-object-fit:cover;object-fit:cover}img.loaded{height:100%;width:100%}.initials{display:flex;height:100%;width:100%;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));text-transform:uppercase}.image{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.image img{display:none;height:100%;width:100%;-o-object-fit:cover;object-fit:cover}.image img.loaded{display:block}:host([variant='hexagon']){border-radius:var(--dyte-border-radius-none, 0);-webkit-clip-path:polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);clip-path:polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%)}:host([size='sm']){height:var(--dyte-space-16, 64px);width:var(--dyte-space-16, 64px);font-size:20px}:host([size='md']){height:var(--dyte-space-28, 112px);width:var(--dyte-space-28, 112px)}:host([size='lg']){height:var(--dyte-space-32, 128px);width:var(--dyte-space-32, 128px)}";var tl=Object.freeze({__proto__:null,dyte_avatar:el}),nl=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.variant="button",this.showWarning=!1,this.size=void 0,this.label=void 0,this.icon=void 0,this.isLoading=void 0,this.disabled=!1,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("button",{"aria-label":this.label,part:"button"},this.isLoading?T("dyte-spinner",{id:"icon",part:"spinner",iconPack:this.iconPack,t:this.t}):T("dyte-icon",{id:"icon",icon:this.icon,tabIndex:-1,"aria-hidden":!0,part:"icon",iconPack:this.iconPack,t:this.t}),T("span",{class:"label",part:"label"},this.label),this.showWarning&&T("dyte-icon",{id:"warning-indicator",icon:this.iconPack.warning,part:"warning-indicator",iconPack:this.iconPack,t:this.t})))}}]),e}();nl.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);--background-color:var(\n    --dyte-controlbar-button-background-color,\n    rgb(var(--dyte-colors-background-1000, 8 8 8))\n  );--icon-size:var(--dyte-controlbar-button-icon-size, var(--dyte-space-7, 28px));--button-spacing:var(--dyte-controlbar-button-spacing, var(--dyte-space-1, 4px));position:relative;box-sizing:border-box;display:inline-flex;margin-left:var(--dyte-space-0\\.5, 2px);margin-right:var(--dyte-space-0\\.5, 2px);height:100%;width:auto;min-width:var(--dyte-space-20, 80px);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--dyte-border-radius-md, 8px);transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;color:rgb(var(--dyte-colors-text-1000, 255 255 255));border:var(--dyte-border-width-md, 2px) solid transparent;background-color:var(--background-color)}button{padding:var(--dyte-space-1, 4px)}
2:host(.red-icon) #icon{--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([disabled]){color:rgb(var(--dyte-colors-text-600, 255 255 255 / 0.52))}button{box-sizing:border-box;display:inline-flex;height:100%;width:100%;flex:1 1 0%;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;border-width:var(--dyte-border-width-none, 0);border-style:none;background-color:transparent;color:inherit;outline:2px solid transparent;outline-offset:2px}.label{text-align:center;font-size:12px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}#warning-indicator{position:absolute;top:var(--dyte-space-1, 4px);right:var(--dyte-space-2, 8px);height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px);--tw-text-opacity:1;color:rgba(var(--dyte-colors-warning, 255 205 7) / var(--tw-text-opacity))}:host([size='sm']) #warning-indicator{right:var(--dyte-space-0, 0px);top:var(--dyte-space-0, 0px);height:var(--dyte-space-3, 12px);width:var(--dyte-space-3, 12px)}:host(:hover){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}#icon{margin-bottom:var(--button-spacing);width:var(--icon-size);height:var(--icon-size)}:host([size='sm']),:host([variant='horizontal']){--button-spacing:0px}:host(.leave:hover){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity));border:var(--dyte-border-width-md, 2px) solid rgb(var(--dyte-colors-danger, 255 45 45))}:host(.active){--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-400, 53 110 253) / var(--tw-text-opacity));border:var(--dyte-border-width-md, 2px) solid rgb(var(--dyte-colors-brand-400, 53 110 253))}:host(.active-livestream){--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([size='sm']){margin-left:var(--dyte-space-0, 0px);margin-right:var(--dyte-space-0, 0px);min-width:var(--dyte-space-14, 56px)}:host([size='sm']) .label{display:none}:host([variant='horizontal']){width:100%;padding-left:var(--dyte-space-3, 12px);padding-right:var(--dyte-space-3, 12px)}:host([variant='horizontal']) button{flex-direction:row;justify-content:flex-start}:host([variant='horizontal']) #icon{margin-right:var(--dyte-space-3, 12px)}:host([variant='horizontal']) .label{display:block;font-size:14px}:host([variant='horizontal']) #warning-indicator{right:auto;left:var(--dyte-space-4, 16px)}";var rl=Object.freeze({__proto__:null,dyte_controlbar_button:nl}),il=function(){function e(t){var n=this;(0,s.Z)(this,e),ke(this,t),this.dyteOpenChange=I(this,"dyteOpenChange",7),this.showMenu=function(){n.disabled||(n.isInFocus=!0,setTimeout((function(){n.isInFocus&&(n.tooltipEl.style.display="block",n.update(),n.dyteOpenChange.emit(!0),"sm"===n.size&&setTimeout((function(){n.isInFocus&&n.hideMenu()}),1e3))}),n.delay))},this.hideMenu=function(){n.open||n.disabled||(n.isInFocus=!1,n.tooltipEl.style.display="none",n.dyteOpenChange.emit(!1))},this.label="",this.variant="secondary",this.disabled=!1,this.open=!1,this.kind="inline",this.size=void 0,this.placement="top",this.delay=0,this.iconPack=ar,this.t=ir(),this.isInFocus=!1}return(0,c.Z)(e,[{key:"componentDidLoad",value:function(){var e=this;this.triggerEl.addEventListener("focusin",this.showMenu),this.triggerEl.addEventListener("mouseenter",this.showMenu),this.triggerEl.addEventListener("focusout",this.hideMenu),this.triggerEl.addEventListener("mouseleave",this.hideMenu),je((function(){e.openChanged(e.open)}))}},{key:"openChanged",value:function(e){e?this.showMenu():this.hideMenu()}},{key:"update",value:function(){var e,t=this;$u(this.triggerEl,this.tooltipEl,{placement:this.placement,middleware:[fu(8),du(),mu({padding:5}),(e={element:this.arrowEl},{name:"arrow",options:e,fn:function(t){return(0,f.Z)((0,h.Z)().mark((function n(){var r,i,o,s,c,u,l,d,p,f,v,m,g,y,b,k,_,w,x,S,E,T,P,C,R,Z,M,A,I;return(0,h.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(s=(o=null!=e?e:{}).element,c=o.padding,u=void 0===c?0:c,l=t.x,d=t.y,p=t.placement,f=t.rects,v=t.platform,null!=s){n.next=4;break}return n.abrupt("return",{});case 4:return m=Yc(u),g={x:l,y:d},y=Jc(p),b=$c(y),n.next=10,v.getDimensions(s);case 10:return k=n.sent,_="y"===y?"top":"left",w="y"===y?"bottom":"right",x=f.reference[b]+f.reference[y]-g[y]-f.floating[b],S=g[y]-f.reference[y],n.next=17,null==v.getOffsetParent?void 0:v.getOffsetParent(s);case 17:return E=n.sent,0===(T=E?"y"===y?E.clientHeight||0:E.clientWidth||0:0)&&(T=f.floating[b]),P=x/2-S/2,C=m[_],R=T-k[b]-m[w],Z=T/2-k[b]/2+P,M=iu(C,Z,R),A=null!=Wc(p)&&Z!=M&&f.reference[b]/2-(Z<C?m[_]:m[w])-k[b]/2<0,I=A?Z<C?C-Z:R-Z:0,n.abrupt("return",(i={},(0,a.Z)(i,y,g[y]-I),(0,a.Z)(i,"data",(r={},(0,a.Z)(r,y,M),(0,a.Z)(r,"centerOffset",Z-M),r)),i));case 28:case"end":return n.stop()}}),n)})))()}})]}).then((function(e){var n=e.x,r=e.y,i=e.placement,o=e.middlewareData;Object.assign(t.tooltipEl.style,{left:"".concat(n,"px"),top:"".concat(r,"px")});var s=o.arrow,c=s.x,u=s.y,l={top:"bottom",right:"left",bottom:"top",left:"r
2ight"}[i.split("-")[0]];Object.assign(t.arrowEl.style,(0,a.Z)({left:null!=c?"".concat(c,"px"):"",top:null!=u?"".concat(u,"px"):"",right:"",bottom:""},l,"-4px"))}))}},{key:"render",value:function(){var e=this;return T(C,null,T("span",{part:"trigger",id:"trigger",ref:function(t){return e.triggerEl=t}},T("slot",null)),T("div",{part:"tooltip",class:"tooltip",id:"tooltip",role:"tooltip",ref:function(t){return e.tooltipEl=t}},T("div",{id:"arrow",ref:function(t){return e.arrowEl=t},part:"arrow"}),this.label,T("slot",{name:"tooltip"})))}}],[{key:"watchers",get:function(){return{open:["openChanged"]}}}]),e}();il.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);--background-color:var(--dyte-tooltip-background-color, rgb(var(--dyte-colors-background-600, 60 60 60)));display:inline-flex}#trigger{display:block;width:100%;flex:1 1 0%}.tooltip,#arrow{position:absolute;background-color:var(--background-color)}.tooltip{max-width:var(--dyte-space-64, 256px);position:fixed;z-index:20;display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);padding-top:var(--dyte-space-1, 4px);padding-bottom:var(--dyte-space-1, 4px);border-radius:var(--dyte-border-radius-sm, 4px);color:rgb(var(--dyte-colors-text-900, 255 255 255 / 0.88));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);
2--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);font-size:12px}#arrow{position:absolute;height:var(--dyte-space-2, 8px);width:var(--dyte-space-2, 8px);transform:rotate(45deg)}:host([variant='primary']){--background-color:rgb(var(--dyte-colors-brand-500, 33 96 253))}:host([kind='block']){display:block}";var al=Object.freeze({__proto__:null,dyte_tooltip:il}),ol=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.iconPack=ar,this.size="md",this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("dyte-icon",{class:"spinner",icon:this.iconPack.spinner,iconPack:this.iconPack,t:this.t}))}}]),e}();ol.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);box-sizing:border-box;display:block;height:var(--dyte-space-10, 40px);width:var(--dyte-space-10, 40px);--dyte-spinner-color:currentColor}.spinner{height:100%;width:100%}@-webkit-keyframes spin{to{transform:rotate(360deg)}}@keyframes spin{to{transform:rotate(360deg)}}.spinner{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;border-radius:9999px;background-color:transparent;-webkit-animation-duration:0.7s;animation-duration:0.7s}:host([size='md']){height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}:host([size='sm']){height:var(--dyte-space-4, 16px);width:var(--dyte-space-4, 16px)}";var sl=Object.freeze({__proto__:null,dyte_spinner:ol}),cl=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.size=void 0,this.variant="primary",this.kind="button",this.reverse=!1,this.disabled=!1,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("button",{part:"button"},T("span",{class:"start"},T("slot",{name:"start"})),T("span",{class:"content",part:"content"},T("slot",null)),T("span",{class:"end"},T("slot",{name:"end"}))))}}]),e}();cl.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);--icon-size:var(--dyte-button-icon-size, var(--dyte-space-5, 20px));--transition-property:var(--dyte-transition-property, all);--transition-duration:100ms;display:inline-flex;height:var(--dyte-space-8, 32px);cursor:pointer;--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--dyte-colors-text-1000, 255 255 255));font-size:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--dyte-border-radius-sm, 4px);transition-property:var(--transition-property);transition-duration:var(--transition-duration)}button{box-sizing:border-box;background-color:transparent;color:inherit;border:var(--dyte-border-width-sm, 1px) solid transparent;padding-left:var(--dyte-space-2, 8px);padding-right:var(--dyte-space-2, 8px);display:inline-flex;flex-grow:1;justify-content:center;vertical-align:baseline;gap:var(--dyte-space-1, 4px);transition-property:var(--transition-property);transition-duration:var(--transition-duration);outline:none;height:inherit;border-radius:inherit;fill:inherit;cursor:inherit;font-weight:inherit;font-family:inherit;font-size:inherit;line-height:inherit}.start,.content,.end{align-self:center}::slotted(dyte-icon),::slotted(dyte-spinner){height:var(--icon-size);width:var(--icon-size)}:host([variant='primary']){color:rgb(var(--dyte-colors-text-on-brand-1000, var(--dyte-colors-text-1000, 255 255 255)))}:host(:hover){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-600, 13 81 253) / var(--tw-bg-opacity))}button:focus-visible{border-color:rgb(var(--dyte-colors-text-1000, 255 255 255))}:host(:active){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-brand-700, 2 70 253) / var(--tw-bg-opacity))}:host([disabled]){cursor:not-allowed;opacity:0.6}:host([variant='secondary']){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='secondary']:hover){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}:host([variant='secondary']:active){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}
2:host([variant='danger']){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-bg-opacity))}:host([variant='danger']:hover){background-color:rgba(var(--dyte-colors-danger, 255 45 45) / 0.7)}:host([variant='danger']:active){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-bg-opacity))}:host([variant='ghost']){background-color:transparent;color:inherit}:host([variant='ghost'].active){--tw-text-opacity:1;color:rgba(var(--dyte-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}:host([variant='ghost']:hover){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='ghost']:active){--tw-bg-opacity:1;background-color:rgba(var(--dyte-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([kind='icon']){--icon-size:var(--dyte-space-5, 20px);width:var(--dyte-space-8, 32px)}:host([kind='icon']) button{padding-left:var(--dyte-space-0, 0px);padding-right:var(--dyte-space-0, 0px)}:host([kind='wide']){width:100%}:host([size='lg']){--icon-size:var(--dyte-space-5, 20px);height:var(--dyte-space-10, 40px);font-size:16px}:host([size='lg'][kind='icon']){--icon-size:var(--dyte-space-6, 24px);height:var(--dyte-space-10, 40px);width:var(--dyte-space-10, 40px)}:host([size='sm']){--icon-size:var(--dyte-space-4, 16px);height:var(--dyte-space-6, 24px);font-size:12px}:host([size='sm'][kind='icon']){height:var(--dyte-space-6, 24px);width:var(--dyte-space-6, 24px)}";var ul=Object.freeze({__proto__:null,dyte_button:cl}),ll=function(e){try{return JSON.parse(e)}catch(t){return e}},dl=function(){function e(t){(0,s.Z)(this,e),ke(this,t),this.icon=void 0,this.iconPack=ar,this.t=ir()}return(0,c.Z)(e,[{key:"render",value:function(){return T(C,null,T("div",{class:"icon-wrapper",innerHTML:ll(this.icon),part:"wrapper"}))}}]),e}();dl.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block;height:var(--dyte-space-10, 40px);outline:2px solid transparent;outline-offset:2px}:host .icon-wrapper{display:flex;height:100%;width:100%;flex-direction:column;align-items:center}:host svg{height:100%;width:100%;outline:2px solid transparent;outline-offset:2px}";var pl=Object.freeze({__proto__:null,dyte_icon:dl})},4402:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r=console},6758:function(e,t,n){"use strict";n.d(t,{D:function(){return u}});var r=n(4165),i=n(5861),a=n(5671),o=n(3144),s=n(4402),c={joined:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",left:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",message:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_message.mp3"},u=function(){function e(){(0,a.Z)(this,e),this.audio=document.createElement("audio"),this.audio.volume=.3}return(0,o.Z)(e,[{key:"play",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;this.playing||(this.playing=!0,this.audio.src=c[e],this.audio.volume=.3,null===(t=this.audio.play())||void 0===t||t.catch((function(t){s.l.error("[dyte-notifications] play() failed\n",{sound:e,duration:r},t)})),setTimeout((function(){n.playing=!1}),r))}},{key:"setDevice",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t){var n,i,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(a=null===(i=null===(n=this.audio)||void 0===n?void 0:n.setSinkId)||void 0===i?void 0:i.call(n,t))||void 0===a?void 0:a.catch((function(e){s.l.error("[dyte-notifications] setSinkId() error\n",e)}));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}()},4153:function(e,t,n){"use strict";n.d(t,{a:function(){return o},c:function(){return c},g:function(){return s},s:function(){return a}});var r=n(4130),i="dyte-prefs",a=function(e,t){var n=JSON.parse(r.g.getItem(i)||"{}");n[e]=JSON.stringify(t),r.g.setItem("dyte-prefs",JSON.stringify(n))},o=function(e){return JSON.parse(r.g.getItem(i)||"{}")[e]},s=function(){var e=JSON.parse(r.g.getItem(i)||"{}");return{mirrorVideo:!e["mirror-video"]||"true"===e["mirror-video"],muteNotificationSounds:!!e["mute-notification-sounds"]&&"true"===e["mute-notification-sounds"]}},c={}},8097:function(e,t,n){"use strict";n.d(t,{Z:function(){return wC}});var r={};n.r(r),n.d(r,{Decoder:function(){return ds},Encoder:function(){return ls},PacketType:function(){return cs},protocol:function(){return us}});var i=n(4942),a=n(8664),o=n(3433),s=n(1413),c=n(7762),u=n(1120);function l(){return l="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=(0,u.Z)(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},l.apply(this,arguments)}var d=n(9439),p=n(4165),h=n(5861),f=n(7326),v=n(136),m=n(7277),g=n(5671),y=n(3144),b=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var k,_=function(e){return"string"===typeof e&&b.test(e)},w=new Uint8Array(16);function x(){if(!k&&!(k="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return k(w)}for(var S=[],E=0;E<256;++E)S.push((E+256).toString(16).substr(1));var T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase();
2if(!_(n))throw TypeError("Stringified UUID is invalid");return n};var P=function(e,t,n){var r=(e=e||{}).random||(e.rng||x)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return T(r)},C=n(4569),R=n.n(C),Z=n(5524),M=n.n(Z),A=n(7724),I="object"===typeof globalThis?globalThis:"object"===typeof self?self:"object"===typeof window?window:"object"===typeof n.g?n.g:{},O="1.4.1",L=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var D=function(e){var t=new Set([e]),n=new Set,r=e.match(L);if(!r)return function(){return!1};var i=+r[1],a=+r[2],o=+r[3];if(null!=r[4])return function(t){return t===e};function s(e){return n.add(e),!1}function c(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(L);if(!r)return s(e);var u=+r[1],l=+r[2],d=+r[3];return null!=r[4]||i!==u?s(e):0===i?a===l&&o<=d?c(e):s(e):a<=l?c(e):s(e)}}(O),N=O.split(".")[0],j=Symbol.for("opentelemetry.js.api."+N),B=I;function U(e,t,n,r){var i;void 0===r&&(r=!1);var a=B[j]=null!==(i=B[j])&&void 0!==i?i:{version:O};if(!r&&a[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(o.stack||o.message),!1}if(a.version!==O){o=new Error("@opentelemetry/api: Registration of version v"+a.version+" for "+e+" does not match previously registered API v"+O);return n.error(o.stack||o.message),!1}return a[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+O+"."),!0}function V(e){var t,n,r=null===(t=B[j])||void 0===t?void 0:t.version;if(r&&D(r))return null===(n=B[j])||void 0===n?void 0:n[e]}function F(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+O+".");var n=B[j];n&&delete n[e]}var z,H=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},q=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},G=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return W("verbose",this._namespace,e)},e}();function W(e,t,n){var r=V("diag");if(r)return n.unshift(t),r[e].apply(r,q([],H(n),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(z||(z={}));var J=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},$=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},K=function(){function e(){function e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=V("diag");if(r)return r[e].apply(r,$([],J(t),!1))}}var t=this;t.setLogger=function(e,n){var r,i,a;if(void 0===n&&(n={logLevel:z.INFO}),e===t){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=o.stack)&&void 0!==r?r:o.message),!1}"number"===typeof n&&(n={logLevel:n});var s=V("diag"),c=function(e,t){function n(n,r){var i=t[n];return"function"===typeof i&&e>=r?i.bind(t):function(){}}return e<z.NONE?e=z.NONE:e>z.ALL&&(e=z.ALL),t=t||{},{error:n("error",z.ERROR),warn:n("warn",z.WARN),info:n("info",z.INFO),debug:n("debug",z.DEBUG),verbose
2:n("verbose",z.VERBOSE)}}(null!==(i=n.logLevel)&&void 0!==i?i:z.INFO,e);if(s&&!n.suppressOverrideMessage){var u=null!==(a=(new Error).stack)&&void 0!==a?a:"<failed to generate stacktrace>";s.warn("Current logger will be overwritten from "+u),c.warn("Current logger will overwrite one already registered from "+u)}return U("diag",c,t,!0)},t.disable=function(){F("diag",t)},t.createComponentLogger=function(e){return new G(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),Q=K.instance();function Y(e){return Symbol.for(e)}var X,ee=function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}},te=new ee,ne=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},re=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},ie=function(){function e(){}return e.prototype.active=function(){return te},e.prototype.with=function(e,t,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return t.call.apply(t,re([n],ne(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),ae=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},oe=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},se="context",ce=new ie,ue=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return U(se,e,K.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,oe([e,t,n],ae(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return V(se)||ce},e.prototype.disable=function(){this._getContextManager().disable(),F(se,K.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(X||(X={}));var le="0000000000000000",de="00000000000000000000000000000000",pe={traceId:de,spanId:le,traceFlags:X.NONE},he=function(){function e(e){void 0===e&&(e=pe),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),fe=Y("OpenTelemetry Context Key SPAN");function ve(e){return e.getValue(fe)||void 0}function me(){return ve(ue.getInstance().active())}function ge(e,t){return e.setValue(fe,t)}function ye(e){return e.deleteValue(fe)}function be(e,t){return ge(e,new he(t))}function ke(e){var t;return null===(t=ve(e))||void 0===t?void 0:t.spanContext()}var _e=/^([0-9a-f]{32})$/i,we=/^[0-9a-f]{16}$/i;function xe(e){return _e.test(e)&&e!==de}function Se(e){return xe(e.traceId)&&(t=e.spanId,we.test(t)&&t!==le);var t}function Ee(e){return new he(e)}var Te=ue.getInstance(),Pe=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(void 0===n&&(n=Te.active()),Boolean(null===t||void 0===t?void 0:t.root))return new he;var r,i=n&&ke(n);return"object"===typeof(r=i)&&"string"===typeof r.spanId&&"string"===typeof r.traceId&&"number"===typeof r.traceFlags&&Se(i)?new he(i):new he},e.prototype.startActiveSpan=function(e,t,n,r){var i,a,o;if(!(arguments.length<2)){2===arguments.length?o=t:3===arguments.length?(i=t,o=n):(i=t,a=n,o=r);var s=null!==a&&void 0!==a?a:Te.active(),c=this.startSpan(e,i,s),u=ge(s,c);return Te.with(u,o,void 0,c)}},e}();var Ce=new Pe,Re=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ce},e}(),Ze=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new Pe},e}()),Me=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new Re(this,e,t,n)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Ze},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)},e}(),Ae="trace",Ie=function(){function e(){this._proxyTracerProvider=new Me,this.wrapSpanContext=Ee,this.isSpanContextValid=Se,this.deleteSpan=ye,this.get
2Span=ve,this.getActiveSpan=me,this.getSpanContext=ke,this.setSpan=ge,this.setSpanContext=be}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=U(Ae,this._proxyTracerProvider,K.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return V(Ae)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){F(Ae,K.instance()),this._proxyTracerProvider=new Me},e}().getInstance(),Oe=ue.getInstance(),Le=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),De={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},Ne={set:function(e,t,n){null!=e&&(e[t]=n)}},je=Y("OpenTelemetry Baggage Key");function Be(e){return e.getValue(je)||void 0}function Ue(){return Be(ue.getInstance().active())}function Ve(e,t){return e.setValue(je,t)}function Fe(e){return e.deleteValue(je)}var ze=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},He=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qe=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map((function(e){var t=ze(e,2);return[t[0],t[1]]}))},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=new e(this._entries);try{for(var o=He(r),s=o.next();!s.done;s=o.next()){var c=s.value;a._entries.delete(c)}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.clear=function(){return new e},e}(),Ge=Symbol("BaggageEntryMetadata"),We=K.instance();function Je(e){return void 0===e&&(e={}),new qe(new Map(Object.entries(e)))}function $e(e){return"string"!==typeof e&&(We.error("Cannot create baggage metadata from unknown type: "+typeof e),e=""),{__TYPE__:Ge,toString:function(){return e}}}var Ke,Qe,Ye="propagation",Xe=new Le,et=function(){function e(){this.createBaggage=Je,this.getBaggage=Be,this.getActiveBaggage=Ue,this.setBaggage=Ve,this.deleteBaggage=Fe}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return U(Ye,e,K.instance())},e.prototype.inject=function(e,t,n){return void 0===n&&(n=Ne),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return void 0===n&&(n=De),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){F(Ye,K.instance())},e.prototype._getGlobalPropagator=function(){return V(Ye)||Xe},e}().getInstance(),tt="[object Object]",nt="[object Null]",rt="[object Undefined]",it=Function.prototype.toString,at=it.call(Object),ot=(Ke=Object.getPrototypeOf,Qe=Object,function(e){return Ke(Qe(e))}),st=Object.prototype,ct=st.hasOwnProperty,ut=Symbol?Symbol.toStringTag:void 0,lt=st.toString;function dt(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){if(null==e)return void 0===e?rt:nt;return ut&&ut in Object(e)?function(e){var t=ct.call(e,ut),n=e[ut],r=!1;try{e[ut]=void 0,r=!0}catch(a){}var i=lt.call(e);r&&(t?e[ut]=n:delete e[ut]);return i}(e):function(e){return lt.call(e)}(e)}(e)!==tt)return!1;var t=ot(e);
2if(null===t)return!0;var n=ct.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&it.call(n)===at}var pt,ht=20;function ft(e){return gt(e)?e.slice():e}function vt(e,t,n,r){var i;if(void 0===n&&(n=0),!(n>ht)){if(n++,kt(e)||kt(t)||yt(t))i=ft(t);else if(gt(e)){if(i=e.slice(),gt(t))for(var a=0,o=t.length;a<o;a++)i.push(ft(t[a]));else if(bt(t))for(a=0,o=(s=Object.keys(t)).length;a<o;a++){i[c=s[a]]=ft(t[c])}}else if(bt(e))if(bt(t)){if(!function(e,t){if(!dt(e)||!dt(t))return!1;return!0}(e,t))return t;i=Object.assign({},e);var s;for(a=0,o=(s=Object.keys(t)).length;a<o;a++){var c,u=t[c=s[a]];if(kt(u))"undefined"===typeof u?delete i[c]:i[c]=u;else{var l=i[c],d=u;if(mt(e,c,r)||mt(t,c,r))delete i[c];else{if(bt(l)&&bt(d)){var p=r.get(l)||[],h=r.get(d)||[];p.push({obj:e,key:c}),h.push({obj:t,key:c}),r.set(l,p),r.set(d,h)}i[c]=vt(i[c],u,n,r)}}}}else i=t;return i}}function mt(e,t,n){for(var r=n.get(e[t])||[],i=0,a=r.length;i<a;i++){var o=r[i];if(o.key===t&&o.obj===e)return!0}return!1}function gt(e){return Array.isArray(e)}function yt(e){return"function"===typeof e}function bt(e){return!kt(e)&&!gt(e)&&!yt(e)&&"object"===typeof e}function kt(e){return"string"===typeof e||"number"===typeof e||"boolean"===typeof e||"undefined"===typeof e||e instanceof Date||e instanceof RegExp||null===e}!function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"}(pt||(pt={}));var _t="object"===typeof globalThis?globalThis:"object"===typeof self?self:"object"===typeof window?window:"object"===typeof n.g?n.g:{},wt=",",xt=["OTEL_SDK_DISABLED"];function St(e){return xt.indexOf(e)>-1}var Et=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function Tt(e){return Et.indexOf(e)>-1}var Pt=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function Ct(e){return Pt.indexOf(e)>-1}var Rt=1/0,Zt={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:z.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rt,OTEL_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Rt,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:pt.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function Mt(e,t,n){if("undefined"!==typeof n[e]){var r=String(n[e]);t[e]="true"===r.toLowerCase()}}function At(e,t,n,r,i){if(void 0===r&&(r=-1/0),void 0===i&&(i=1/0),"undefined"!==typeof n[e]){var a=Number(n[e]);
2isNaN(a)||(t[e]=a<r?r:a>i?i:a)}}function It(e,t,n,r){void 0===r&&(r=wt);var i=n[e];"string"===typeof i&&(t[e]=i.split(r).map((function(e){return e.trim()})))}var Ot={ALL:z.ALL,VERBOSE:z.VERBOSE,DEBUG:z.DEBUG,INFO:z.INFO,WARN:z.WARN,ERROR:z.ERROR,NONE:z.NONE};function Lt(e,t,n){var r=n[e];if("string"===typeof r){var i=Ot[r.toUpperCase()];null!=i&&(t[e]=i)}}function Dt(e){var t={};for(var n in Zt){var r=n;if("OTEL_LOG_LEVEL"===r)Lt(r,t,e);else if(St(r))Mt(r,t,e);else if(Tt(r))At(r,t,e);else if(Ct(r))It(r,t,e);else{var i=e[r];"undefined"!==typeof i&&null!==i&&(t[r]=String(i))}}return t}function Nt(){var e=Dt(_t);return Object.assign({},Zt,e)}var jt=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Bt=function(){function e(e){var t;void 0===e&&(e={}),this._propagators=null!==(t=e.propagators)&&void 0!==t?t:[],this._fields=Array.from(new Set(this._propagators.map((function(e){return"function"===typeof e.fields?e.fields():[]})).reduce((function(e,t){return e.concat(t)}),[])))}return e.prototype.inject=function(e,t,n){var r,i;try{for(var a=jt(this._propagators),o=a.next();!o.done;o=a.next()){var s=o.value;try{s.inject(e,t,n)}catch(c){Q.warn("Failed to inject with "+s.constructor.name+". Err: "+c.message)}}}catch(u){r={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},e.prototype.extract=function(e,t,n){return this._propagators.reduce((function(e,r){try{return r.extract(e,t,n)}catch(i){Q.warn("Failed to inject with "+r.constructor.name+". Err: "+i.message)}return e}),e)},e.prototype.fields=function(){return this._fields.slice()},e}(),Ut=Y("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Vt(e){return!0===e.getValue(Ut)}var Ft="[_0-9a-z-*/]",zt=new RegExp("^(?:"+("[a-z]"+Ft+"{0,255}")+"|"+("[a-z0-9]"+Ft+"{0,240}@[a-z]"+Ft+"{0,13}")+")$"),Ht=/^[ -~]{0,255}[!-~]$/,qt=/,|=/;var Gt=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce((function(t,n){return t.push(n+"="+e.get(n)),t}),[]).join(",")},e.prototype._parse=function(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((function(e,t){var n=t.trim(),r=n.indexOf("=");if(-1!==r){var i=n.slice(0,r),a=n.slice(r+1,t.length);(function(e){return zt.test(e)})(i)&&function(e){return Ht.test(e)&&!qt.test(e)}(a)&&e.set(i,a)}return e}),new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}(),Wt="traceparent",Jt="tracestate",$t=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");var Kt=function(){function e(){}return e.prototype.inject=function(e,t,n){var r=Ie.getSpanContext(e);if(r&&!Vt(e)&&Se(r)){var i="00-"+r.traceId+"-"+r.spanId+"-0"+Number(r.traceFlags||X.NONE).toString(16);n.set(t,Wt,i),r.traceState&&n.set(t,Jt,r.traceState.serialize())}},e.prototype.extract=function(e,t,n){var r=n.get(t,Wt);if(!r)return e;var i=Array.isArray(r)?r[0]:r;if("string"!==typeof i)return e;var a=function(e){var t=$t.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(i);if(!a)return e;a.isRemote=!0;var o=n.get(t,Jt);if(o){var s=Array.isArray(o)?o.join(","):o;a.traceState=new Gt("string"===typeof s?s:void 0)}return Ie.setSpanContext(e,a)},e.prototype.fields=function(){return[Wt,Jt]},e}(),Qt="=",Yt=";",Xt="baggage",en=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function tn(e){var t=e.split(Yt);if(!(t.length<=0)){var n=t.shift();if(n){var r=n.split(Qt);if(2===r.length){var i,a=decodeURIComponent(r[0].trim()),o=decodeURIComponent(r[1].trim());return t.length>0&&(i=$e(t.join(Yt))),{key:a,value:o,metadata:i}}}}}var nn,rn=function(){function e(){}return e.prototype.inject=function(e,t,n){var r=et.getBaggage(e);if(r&&!Vt(e)){var i=function(e){return e.getAllEntries().map((function(e){var t=en(e,2),n=t[0],r=t[1],i=encodeURIComponent(n)+"="+encodeURIComponent(r.value);return void 0!==r.metadata&&(i+=Yt+r.metadata.toString()),i}))}(r).filter((function(e){return e.length<=4096})).slice(0,180),a=function(e){return e.reduce((function(e,t){var n=e+(""!==e?",":"")+t;return n.length>8192?e:n}),"")}(i);a.length>0&&n.set(t,Xt,a)}},e.prototype.extract=function(e,t,n){var r=n.get(t,Xt),i=Array.isArray(r)?r.join(","):r;if(!i)return e;var a={};return 0===i.length?e:(i.split(",").forEach((function(e){var t=tn(e);if(t){var n={value:t.value};t.metadata&&(n.metadata=t.metadata),a[t.key]=n}})),0===Object.entries(a).length?e:et.setBaggage(e,et.createBaggage(a)))}
2,e.prototype.fields=function(){return[Xt]},e}(),an="process.runtime.name",on="service.name",sn="telemetry.sdk.name",cn="telemetry.sdk.language",un="telemetry.sdk.version",ln=((nn={})[sn]="opentelemetry",nn[an]="browser",nn[cn]="webjs",nn[un]="1.10.0",nn);var dn,pn,hn=function(){return hn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},hn.apply(this,arguments)},fn=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(t){a(t)}}function s(e){try{c(r.throw(e))}catch(t){a(t)}}function c(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())}))},vn=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(s){a=[6,s],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},mn=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},gn=function(){function e(e,t){var n=this;this._attributes=e,this.asyncAttributesPending=null!=t,this._syncAttributes=e,this._asyncAttributesPromise=null===t||void 0===t?void 0:t.then((function(e){return n._attributes=Object.assign({},n._attributes,e),n.asyncAttributesPending=!1,e}),(function(e){return Q.debug("a resource's async attributes promise rejected: %s",e),n.asyncAttributesPending=!1,{}}))}return e.empty=function(){return e.EMPTY},e.default=function(){var t;return new e(((t={})[on]="unknown_service",t[cn]=ln[cn],t[sn]=ln[sn],t[un]=ln[un],t))},Object.defineProperty(e.prototype,"attributes",{get:function(){return this.asyncAttributesPending&&Q.error("Accessing resource attributes before async attributes settled"),this._attributes},enumerable:!1,configurable:!0}),e.prototype.waitForAsyncAttributes=function(){return fn(this,void 0,void 0,(function(){return vn(this,(function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
2))}))},e.prototype.merge=function(t){var n,r=this;if(!t)return this;var i=hn(hn({},this._syncAttributes),null!==(n=t._syncAttributes)&&void 0!==n?n:t.attributes);if(!this._asyncAttributesPromise&&!t._asyncAttributesPromise)return new e(i);var a=Promise.all([this._asyncAttributesPromise,t._asyncAttributesPromise]).then((function(e){var n,i=mn(e,2),a=i[0],o=i[1];return hn(hn(hn(hn({},r._syncAttributes),a),null!==(n=t._syncAttributes)&&void 0!==n?n:t.attributes),o)}));return new e(i,a)},e.EMPTY=new e({}),e}();!function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(dn||(dn={})),function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(pn||(pn={}));var yn,bn=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},kn=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function _n(e){var t,n,r={};if("object"!==typeof e||null==e)return r;try{for(var i=bn(Object.entries(e)),a=i.next();!a.done;a=i.next()){var o=kn(a.value,2),s=o[0],c=o[1];wn(s)?xn(c)?Array.isArray(c)?r[s]=c.slice():r[s]=c:Q.warn("Invalid attribute value set for key: "+s):Q.warn("Invalid attribute key: "+s)}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function wn(e){return"string"===typeof e&&e.length>0}function xn(e){return null==e||(Array.isArray(e)?function(e){var t,n,r;try{for(var i=bn(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(null!=o){if(!r){if(Sn(o)){r=typeof o;continue}return!1}if(typeof o!==r)return!1}}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0}(e):Sn(e))}function Sn(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}!function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(yn||(yn={}));var En=performance,Tn=Math.pow(10,6),Pn=Math.pow(10,9);function Cn(e){var t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Tn)]}function Rn(){var e=En.timeOrigin;if("number"!==typeof e){var t=En;e=t.timing&&t.timing.fetchStart}return e}function Zn(e){return In(Cn(Rn()),Cn("number"===typeof e?e:En.now()))}function Mn(e){return Array.isArray(e)&&2===e.length&&"number"===typeof e[0]&&"number"===typeof e[1]}function An(e){return Mn(e)||"number"===typeof e||e instanceof Date}function In(e,t){var n=[e[0]+t[0],e[1]+t[1]];return n[1]>=Pn&&(n[1]-=Pn,n[0]+=1),n}var On,Ln="exception.type",Dn="exception.message",Nn="exception.stacktrace",jn=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Bn=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},Un=function(){function e(e,t,n,r,i,a,o,s,c){void 0===o&&(o=[]),this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:yn.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=r,this.parentSpanId=a,this.kind=i,this.links=o;var u=Date.now();this._performanceStartTime=En.now(),this._performanceOffset=u-(this._performanceStartTime+Rn()),this._startTimeProvided=null!=s,this.startTime=this._getTime(null!==s&&void 0!==s?s:u),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return null==t||this._isSpanEnded()?this:0===e.length?(Q.warn("Invalid attribute key: "+e),this):xn(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(Q.warn("Invalid attribute value set for key: "+e),this)},e.prototype.setAttributes=function(e){var t,n;try{for(var r=jn(Object.entries(e)),i=r.next();!i.done;i=r.next()){var a=Bn(i.value,2),o=a[0],s=a[1];this.setAttribute(o,s)}}catch(c){t={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return this},e.prototype.addEvent=function(e,t,n){if(this._isSpanEnded())return this;if(0===this._spanLimits.eventCountLimit)return Q.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(Q.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),An(t)&&(An(n)||(n=t),t=void 0);var r=_n(t);return this.events.push({name:e,attributes:r,time:this._getTime(n),droppedAttributesCount:0}),this},e.prototype.setStatus=function(e){return this._isSpanEnded()||(this.status=e),this},e.prototype.updateName=function(e){return this._isSpanEnded()||(this.name=e),this},e.prototype.end=function(e){this._isSpanEnded()?Q.error("You can only call end() on a span once."):(this._ended=!0,this.endTime=this._getTime(e),this._duration=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=Pn),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(Q.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._spanProcessor.onEnd(this))},e.prototype._getTime=function(e){if("number"===typeof e&&e<En.now())return Zn(e+this._performanceOffset);if("number"===typeof e)return Cn(e);if(e instanceof Date)return Cn(e.getTime());if(Mn(e))return e;if(this._startTimeProvided)return Cn(Date.now());var t=En.now()-this._performanceStartTime;return In(this.startTime,Cn(t))},e.prototype.isRecording=function(){return!1===this._ended},e.prototype.recordException=function(e,t){var n={};
2"string"===typeof e?n[Dn]=e:e&&(e.code?n[Ln]=e.code.toString():e.name&&(n[Ln]=e.name),e.message&&(n[Dn]=e.message),e.stack&&(n[Nn]=e.stack)),n[Ln]||n[Dn]?this.addEvent("exception",n,t):Q.warn("Failed to record an exception "+e)},Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ended",{get:function(){return this._ended},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedAttributesCount",{get:function(){return this._droppedAttributesCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedEventsCount",{get:function(){return this._droppedEventsCount},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"droppedLinksCount",{get:function(){return this._droppedLinksCount},enumerable:!1,configurable:!0}),e.prototype._isSpanEnded=function(){return this._ended&&Q.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},e.prototype._truncateToLimitUtil=function(e,t){return e.length<=t?e:e.substr(0,t)},e.prototype._truncateToSize=function(e){var t=this,n=this._attributeValueLengthLimit;return n<=0?(Q.warn("Attribute value limit must be positive, got "+n),e):"string"===typeof e?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map((function(e){return"string"===typeof e?t._truncateToLimitUtil(e,n):e})):e},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(On||(On={}));var Vn=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:On.NOT_RECORD}},e.prototype.toString=function(){return"AlwaysOffSampler"},e}(),Fn=function(){function e(){}return e.prototype.shouldSample=function(){return{decision:On.RECORD_AND_SAMPLED}},e.prototype.toString=function(){return"AlwaysOnSampler"},e}();var zn=function(e){Q.error(function(e){return"string"===typeof e?e:JSON.stringify(function(e){for(var t={},n=e;null!==n;)Object.getOwnPropertyNames(n).forEach((function(e){if(!t[e]){var r=n[e];r&&(t[e]=String(r))}})),n=Object.getPrototypeOf(n);return t}(e))}(e))};function Hn(e){try{zn(e)}catch(nn){}}var qn=function(){function e(e){var t,n,r,i;this._root=e.root,this._root||(Hn(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Fn),this._remoteParentSampled=null!==(t=e.remoteParentSampled)&&void 0!==t?t:new Fn,this._remoteParentNotSampled=null!==(n=e.remoteParentNotSampled)&&void 0!==n?n:new Vn,this._localParentSampled=null!==(r=e.localParentSampled)&&void 0!==r?r:new Fn,this._localParentNotSampled=null!==(i=e.localParentNotSampled)&&void 0!==i?i:new Vn}return e.prototype.shouldSample=function(e,t,n,r,i,a){var o=Ie.getSpanContext(e);return o&&Se(o)?o.isRemote?o.traceFlags&X.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&X.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a):this._root.shouldSample(e,t,n,r,i,a)},e.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},e}(),Gn=function(){function e(e){void 0===e&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}return e.prototype.shouldSample=function(e,t){return{decision:xe(t)&&this._accumulate(t)<this._upperBound?On.RECORD_AND_SAMPLED:On.NOT_RECORD}},e.prototype.toString=function(){return"TraceIdRatioBased{"+this._ratio+"}"},e.prototype._normalize=function(e){return"number"!==typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e},e.prototype._accumulate=function(e){for(var t=0,n=0;n<e.length/8;n++){var r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t},e}(),Wn=Nt(),Jn=pt.AlwaysOn,$n=1;function Kn(){return{sampler:Qn(Wn),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:Nt().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:Nt().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:Nt().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:Nt().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:Nt().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:Nt().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:Nt().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:Nt().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}function Qn(e){switch(void 0===e&&(e=Nt()),e.OTEL_TRACES_SAMPLER){case pt.AlwaysOn:return new Fn;case pt.AlwaysOff:return new Vn;case pt.ParentBasedAlwaysOn:return new qn({root:new Fn});case pt.ParentBasedAlwaysOff:return new qn({root:new Vn});case pt.TraceIdRatio:return new Gn(Yn(e));case pt.ParentBasedTraceIdRatio:return new qn({root:new Gn(Yn(e))});default:return Q.error('OTEL_TRACES_SAMPLER value "'+e.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+Jn+'".'),new Fn}}function Yn(e){if(void 0===e.OTEL_TRACES_SAMPLER_ARG||""===e.OTEL_TRACES_SAMPLER_ARG)return Q.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+$n+"."),$n;var t=Number(e.OTEL_TRACES_SAMPLER_ARG);return isNaN(t)?(Q.error("OTEL_TRACES_SAMPLER_ARG="+e.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invali
2d, defaulting to "+$n+"."),$n):t<0||t>1?(Q.error("OTEL_TRACES_SAMPLER_ARG="+e.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+$n+"."),$n):t}function Xn(e){var t,n,r,i,a,o,s,c,u,l,d,p,h=Object.assign({},e.spanLimits),f="undefined"!==typeof process&&process?Dt({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SERVER_URL:"https://dyte-audio.fly.dev"}):Dt(_t);return h.attributeCountLimit=null!==(o=null!==(a=null!==(i=null!==(n=null===(t=e.spanLimits)||void 0===t?void 0:t.attributeCountLimit)&&void 0!==n?n:null===(r=e.generalLimits)||void 0===r?void 0:r.attributeCountLimit)&&void 0!==i?i:f.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)&&void 0!==a?a:f.OTEL_ATTRIBUTE_COUNT_LIMIT)&&void 0!==o?o:128,h.attributeValueLengthLimit=null!==(p=null!==(d=null!==(l=null!==(c=null===(s=e.spanLimits)||void 0===s?void 0:s.attributeValueLengthLimit)&&void 0!==c?c:null===(u=e.generalLimits)||void 0===u?void 0:u.attributeValueLengthLimit)&&void 0!==l?l:f.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==d?d:f.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)&&void 0!==p?p:Rt,Object.assign({},e,{spanLimits:h})}var er=function(){this.generateTraceId=nr(16),this.generateSpanId=nr(8)},tr=Array(32);function nr(e){return function(){for(var t=0;t<2*e;t++)tr[t]=Math.floor(16*Math.random())+48,tr[t]>=58&&(tr[t]+=39);return String.fromCharCode.apply(null,tr.slice(0,2*e))}}var rr,ir=function(){function e(e,t,n){this._tracerProvider=n;var r=function(e){var t={sampler:Qn()},n=Kn(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=r.sampler,this._generalLimits=r.generalLimits,this._spanLimits=r.spanLimits,this._idGenerator=t.idGenerator||new er,this.resource=n.resource,this.instrumentationLibrary=e}return e.prototype.startSpan=function(e,t,n){var r,i,a;void 0===t&&(t={}),void 0===n&&(n=Oe.active()),t.root&&(n=Ie.deleteSpan(n));var o=Ie.getSpan(n);if(Vt(n))return Q.debug("Instrumentation suppressed, returning Noop Span"),Ie.wrapSpanContext(pe);var s,c,u,l=null===o||void 0===o?void 0:o.spanContext(),d=this._idGenerator.generateSpanId();l&&Ie.isSpanContextValid(l)?(s=l.traceId,c=l.traceState,u=l.spanId):s=this._idGenerator.generateTraceId();var p=null!==(r=t.kind)&&void 0!==r?r:dn.INTERNAL,h=(null!==(i=t.links)&&void 0!==i?i:[]).map((function(e){return{context:e.context,attributes:_n(e.attributes)}})),f=_n(t.attributes),v=this._sampler.shouldSample(n,s,e,p,f,h);c=null!==(a=v.traceState)&&void 0!==a?a:c;var m={traceId:s,spanId:d,traceFlags:v.decision===pn.RECORD_AND_SAMPLED?X.SAMPLED:X.NONE,traceState:c};if(v.decision===pn.NOT_RECORD)return Q.debug("Recording is off, propagating context in a non-recording span"),Ie.wrapSpanContext(m);var g=new Un(this,n,e,m,p,u,h,t.startTime),y=_n(Object.assign(f,v.attributes));return g.setAttributes(y),g},e.prototype.startActiveSpan=function(e,t,n,r){var i,a,o;if(!(arguments.length<2)){2===arguments.length?o=t:3===arguments.length?(i=t,o=n):(i=t,a=n,o=r);var s=null!==a&&void 0!==a?a:Oe.active(),c=this.startSpan(e,i,s),u=Ie.setSpan(s,c);return Oe.with(u,o,void 0,c)}},e.prototype.getGeneralLimits=function(){return this._generalLimits},e.prototype.getSpanLimits=function(){return this._spanLimits},e.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},e}(),ar=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},or=function(){function e(e){this._spanProcessors=e}return e.prototype.forceFlush=function(){var e,t,n=[];try{for(var r=ar(this._spanProcessors),i=r.next();!i.done;i=r.next()){var a=i.value;n.push(a.forceFlush())}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return new Promise((function(e){Promise.all(n).then((function(){e()})).catch((function(t){Hn(t||new Error("MultiSpanProcessor: forceFlush failed")),e()}))}))},e.prototype.onStart=function(e,t){var n,r;try{for(var i=ar(this._spanProcessors),a=i.next();!a.done;a=i.next()){a.value.onStart(e,t)}}catch(o){n={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.onEnd=function(e){var t,n;try{for(var r=ar(this._spanProcessors),i=r.next();!i.done;i=r.next()){i.value.onEnd(e)}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.shutdown=function(){var e,t,n=[];try{for(var r=ar(this._spanProcessors),i=r.next();!i.done;i=r.next()){var a=i.value;n.push(a.shutdown())}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return new Promise((function(e,t){Promise.all(n).then((function(){e()}),t)}))},e}(),sr=function(){function e(){}return e.prototype.onStart=function(e,t){},e.prototype.onEnd=function(e){},e.prototype.shutdown=function(){return Promise.resolve()},e.prototype.forceFlush=function(){return Promise.resolve()},e}(),cr=function(){function e(){var e=this;this._promise=new Promise((function(t,n){e._resolve=t,e._reject=n}))}return Object.defineProperty(e.prototype,"promise",{get:function(){return this._promise}
2,enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this._resolve(e)},e.prototype.reject=function(e){this._reject(e)},e}(),ur=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},lr=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},dr=function(){function e(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new cr}return Object.defineProperty(e.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),e.prototype.call=function(){for(var e,t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((e=this._callback).call.apply(e,lr([this._that],ur(n),!1))).then((function(e){return t._deferred.resolve(e)}),(function(e){return t._deferred.reject(e)}))}catch(i){this._deferred.reject(i)}}return this._deferred.promise},e}();!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(rr||(rr={}));var pr,hr=function(){function e(e,t){this._exporter=e,this._finishedSpans=[],this._droppedSpansCount=0;var n=Nt();this._maxExportBatchSize="number"===typeof(null===t||void 0===t?void 0:t.maxExportBatchSize)?t.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize="number"===typeof(null===t||void 0===t?void 0:t.maxQueueSize)?t.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis="number"===typeof(null===t||void 0===t?void 0:t.scheduledDelayMillis)?t.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis="number"===typeof(null===t||void 0===t?void 0:t.exportTimeoutMillis)?t.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new dr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Q.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return e.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},e.prototype.onStart=function(e,t){},e.prototype.onEnd=function(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&X.SAMPLED)&&this._addToBuffer(e)},e.prototype.shutdown=function(){return this._shutdownOnce.call()},e.prototype._shutdown=function(){var e=this;return Promise.resolve().then((function(){return e.onShutdown()})).then((function(){return e._flushAll()})).then((function(){return e._exporter.shutdown()}))},e.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Q.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(Q.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},e.prototype._flushAll=function(){var e=this;return new Promise((function(t,n){for(var r=[],i=0,a=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize);i<a;i++)r.push(e._flushOneBatch());Promise.all(r).then((function(){t()})).catch(n)}))},e.prototype._flushOneBatch=function(){var e=this;return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Timeout"))}),e._exportTimeoutMillis);Oe.with(Oe.active().setValue(Ut,!0),(function(){var i=e._finishedSpans.splice(0,e._maxExportBatchSize),a=function(){return e._exporter.export(i,(function(e){var i;clearTimeout(r),e.code===rr.SUCCESS?t():n(null!==(i=e.error)&&void 0!==i?i:new Error("BatchSpanProcessor: span export failed"))}))},o=i.map((function(e){return e.resource})).filter((function(e){return e.asyncAttributesPending}));0===o.length?a():Promise.all(o.map((function(e){var t;return null===(t=e.waitForAsyncAttributes)||void 0===t?void 0:t.call(e)}))).then(a,(function(e){Hn(e),n(e)}))}))}))},e.prototype._maybeStartTimer=function(){var e=this;void 0===this._timer&&(this._timer=setTimeout((function(){e._flushOneBatch().then((function(){e._finishedSpans.length>0&&(e._clearTimer(),e._maybeStartTimer())})).catch((function(e){Hn(e)}))}),this._scheduledDelayMillis),this._timer)},e.prototype._clearTimer=function(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)},e}(),fr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),vr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.onInit(n),r}return fr(t,e),t.prototype.onInit=function(e){var t=this;!0!==(null===e||void 0===e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!==typeof document&&(this._visibilityChangeListener=function(){"hidden"===document.visibilityState&&t.forceFlush()},this._pageHideListener=function(){t.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))},t.prototype.onShutdown=function(){"undefined"!==typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))},t}(hr);!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(pr||(pr={}));var mr,gr=function(){function e(e){var t;void 0===e&&(e={}),this._registeredSpanProcessors=[],this._tracers=new Map;var n=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e.shift(),r=new WeakMap;e.length>0;)n=vt(n,e.shift(),0,r);return n}({},Kn(),Xn(e));this.resource=null!==(t=n.resource)&&void 0!==t?t:gn.empty(),this.resource=gn.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});var r=this._buildExporterFromEnv();if(void 0!==r){var i=new vr(r);this.activeSpanProcessor=i}else this.activeSpanProcessor=new sr}return e.prototype.getTracer=function(e,t,n){var r=e+"@"+(t||"")+":"+((null===n||void 0===n?void 0:n.schemaUrl)||"");return this._tracers.has(r)||this._tracers.set(r,new ir({name:e,version:t,schemaUrl:null===n||void 0===n?void 0:n.schemaUrl},this._config,this)),this._tracers.get(r)},e.prototype.addSpanProcessor=function(e){0===this._registeredSpanProcessors.length&&this.activeSpanProcessor.shutdown().catch((function(e){return Q.error("Error while trying to shutdown current span processor",e)})),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new or(this._registeredSpanProcessors)},e.prototype.getActiveSpanProcessor=function(){return this.activeSpanProcessor},e.prototype.register=function(e){void 0===e&&(e={}),Ie.setGlobalTracerProvider(this),void 0===e.propagator&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&Oe.setGlobalContextManager(e.contextManager),e.propagator&&et.setGlobalPropagator(e.propagator)},e.prototype.forceFlush=function(){var e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map((function(t){return new Promise((function(n){var r,i=setTimeout((function(){n(new Error("Span processor did n
2ot completed within timeout period of "+e+" ms")),r=pr.timeout}),e);t.forceFlush().then((function(){clearTimeout(i),r!==pr.timeout&&(r=pr.resolved,n(r))})).catch((function(e){clearTimeout(i),r=pr.error,n(e)}))}))}));return new Promise((function(e,n){Promise.all(t).then((function(t){var r=t.filter((function(e){return e!==pr.resolved}));r.length>0?n(r):e()})).catch((function(e){return n([e])}))}))},e.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},e.prototype._getPropagator=function(e){var t;return null===(t=this.constructor._registeredPropagators.get(e))||void 0===t?void 0:t()},e.prototype._getSpanExporter=function(e){var t;return null===(t=this.constructor._registeredExporters.get(e))||void 0===t?void 0:t()},e.prototype._buildPropagatorFromEnv=function(){var e=this,t=Array.from(new Set(Nt().OTEL_PROPAGATORS)),n=t.map((function(t){var n=e._getPropagator(t);return n||Q.warn('Propagator "'+t+'" requested through environment variable is unavailable.'),n})).reduce((function(e,t){return t&&e.push(t),e}),[]);return 0===n.length?void 0:1===t.length?n[0]:new Bt({propagators:n})},e.prototype._buildExporterFromEnv=function(){var e=Nt().OTEL_TRACES_EXPORTER;if("none"!==e&&""!==e){var t=this._getSpanExporter(e);return t||Q.error('Exporter "'+e+'" requested through environment variable is unavailable.'),t}},e._registeredPropagators=new Map([["tracecontext",function(){return new Kt}],["baggage",function(){return new rn}]]),e._registeredExporters=new Map,e}(),yr=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},br=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},kr=function(){function e(){this._enabled=!1,this._currentContext=te}return e.prototype._bindFunction=function(e,t){void 0===e&&(e=te);var n=this,r=function(){for(var r=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return n.with(e,(function(){return t.apply(r,i)}))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r},e.prototype.active=function(){return this._currentContext},e.prototype.bind=function(e,t){return void 0===e&&(e=this.active()),"function"===typeof t?this._bindFunction(e,t):t},e.prototype.disable=function(){return this._currentContext=te,this._enabled=!1,this},e.prototype.enable=function(){return this._enabled||(this._enabled=!0,this._currentContext=te),this},e.prototype.with=function(e,t,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var a=this._currentContext;this._currentContext=e||te;try{return t.call.apply(t,br([n],yr(r),!1))}finally{this._currentContext=a}},e}(),_r=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wr=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;if(t.contextManager)throw"contextManager should be defined in register method not in constructor";if(t.propagator)throw"propagator should be defined in register method not in constructor";return n}return _r(t,e),t.prototype.register=function(t){void 0===t&&(t={}),void 0===t.contextManager&&(t.contextManager=new kr),t.contextManager&&t.contextManager.enable(),e.prototype.register.call(this,t)},t}(gr),xr="=",Sr=";";function Er(e){return"string"!==typeof e||0===e.length?{}:e.split(",").map((function(e){return function(e){var t=e.split(Sr);if(!(t.length<=0)){var n=t.shift();if(n){var r=n.split(xr);if(2===r.length){var i,a=decodeURIComponent(r[0].trim()),o=decodeURIComponent(r[1].trim());return t.length>0&&(i=$e(t.join(Sr))),{key:a,value:o,metadata:i}}}}}(e)})).filter((function(e){return void 0!==e&&e.value.length>0})).reduce((function(e,t){return e[t.key]=t.value,e}),{})}!function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"}(mr||(mr={}));var Tr=",",Pr=["OTEL_SDK_DISABLED"];function Cr(e){return Pr.indexOf(e)>-1}var Rr=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function Zr(e){return Rr.indexOf(e)>-1}var Mr=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function Ar(e){return Mr.indexOf(e)>-1}var Ir=1/0,Or={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/s
2pans",OTEL_LOG_LEVEL:z.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ir,OTEL_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ir,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:128,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:128,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:mr.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function Lr(e,t,n){if("undefined"!==typeof n[e]){var r=String(n[e]);t[e]="true"===r.toLowerCase()}}function Dr(e,t,n,r,i){if(void 0===r&&(r=-1/0),void 0===i&&(i=1/0),"undefined"!==typeof n[e]){var a=Number(n[e]);isNaN(a)||(t[e]=a<r?r:a>i?i:a)}}function Nr(e,t,n,r){void 0===r&&(r=Tr);var i=n[e];"string"===typeof i&&(t[e]=i.split(r).map((function(e){return e.trim()})))}var jr={ALL:z.ALL,VERBOSE:z.VERBOSE,DEBUG:z.DEBUG,INFO:z.INFO,WARN:z.WARN,ERROR:z.ERROR,NONE:z.NONE};function Br(e,t,n){var r=n[e];if("string"===typeof r){var i=jr[r.toUpperCase()];null!=i&&(t[e]=i)}}function Ur(e){var t={};for(var n in Or){var r=n;if("OTEL_LOG_LEVEL"===r)Br(r,t,e);else if(Cr(r))Lr(r,t,e);else if(Zr(r))Dr(r,t,e);else if(Ar(r))Nr(r,t,e);else{var i=e[r];"undefined"!==typeof i&&null!==i&&(t[r]=String(i))}}return t}var Vr="object"===typeof globalThis?globalThis:"object"===typeof self?self:"object"===typeof window?window:"object"===typeof n.g?n.g:{};function Fr(){var e=Ur(Vr);return Object.assign({},Or,e)}var zr=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},Hr=1e4;function qr(e){return"number"===typeof e?e<=0?Gr(e,Hr):e:function(){var e,t=Number(null!==(e=Fr().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)&&void 0!==e?e:Fr().OTEL_EXPORTER_OTLP_TIMEOUT);return t<=0?Gr(t,Hr):t}()}function Gr(e,t){return Q.warn("Timeout must be greater than 0",e),t}var Wr,Jr=function(){function e(){var e=this;this._promise=new Promise((function(t,n){e._resolve=t,e._reject=n}))}return Object.defineProperty(e.prototype,"promise",{get:function(){return this._promise},enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this._resolve(e)},e.prototype.reject=function(e){this._reject(e)},e}(),$r=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},Kr=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},Qr=function(){function e(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Jr}return Object.defineProperty(e.prototype,"isCalled",{get:function(){return this._isCalled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"promise",{get:function(){return this._deferred.promise},enumerable:!1,configurable:!0}),e.prototype.call=function(){for(var e,t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(!this._isCalled){this._isCalled=!0;try{Promise.resolve((e=this._callback).call.apply(e,Kr([this._that],$r(n),!1))).then((function(e){return t._deferred.resolve(e)}),(function(e){return t._deferred.reject(e)}))}catch(i){this._deferred.reject(i)}}return this._deferred.promise},e}();!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Wr||(Wr={}));var Yr=function(){function e(e){void 0===e&&(e={}),this._sendingPromises=[],this.url=this.getDefaultUrl(e),"string"===typeof e.hostname&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new Qr(this._shutdown,this),this._concurrencyLimit="number"===typeof e.concurrencyLimit?e.concurrencyLimit:1/0,this.timeoutMillis=qr(e.timeoutMillis),this.onInit(e)}
2return e.prototype.export=function(e,t){this._shutdownOnce.isCalled?t({code:Wr.FAILED,error:new Error("Exporter has been shutdown")}):this._sendingPromises.length>=this._concurrencyLimit?t({code:Wr.FAILED,error:new Error("Concurrent export limit reached")}):this._export(e).then((function(){t({code:Wr.SUCCESS})})).catch((function(e){t({code:Wr.FAILED,error:e})}))},e.prototype._export=function(e){var t=this;return new Promise((function(n,r){try{Q.debug("items to be sent",e),t.send(e,n,r)}catch(i){r(i)}}))},e.prototype.shutdown=function(){return this._shutdownOnce.call()},e.prototype._shutdown=function(){return Q.debug("shutdown started"),this.onShutdown(),Promise.all(this._sendingPromises).then((function(){}))},e}(),Xr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ei=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.name="OTLPExporterError",i.data=r,i.code=n,i}return Xr(t,e),t}(Error),ti=function(){return ti=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ti.apply(this,arguments)},ni=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function ri(e,t,n,r,i,a){var o,s,c=!1,u=setTimeout((function(){if(clearTimeout(o),c=!0,s.readyState===XMLHttpRequest.DONE){var e=new ei("Request Timeout");a(e)}else s.abort()}),r);!function r(l,d){void 0===l&&(l=5),void 0===d&&(d=1e3),(s=new XMLHttpRequest).open("POST",t);Object.entries(ti(ti({},{Accept:"application/json","Content-Type":"application/json"}),n)).forEach((function(e){var t=ni(e,2),n=t[0],r=t[1];s.setRequestHeader(n,r)})),s.send(e),s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE&&!1===c)if(s.status>=200&&s.status<=299)Q.debug("xhr success",e),i(),clearTimeout(u),clearTimeout(o);else if(s.status&&(p=s.status,[429,502,503,504].includes(p))&&l>0){var t=void 0;d*=1.5,t=s.getResponseHeader("Retry-After")?function(e){if(null==e)return-1;var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var n=new Date(e).getTime()-Date.now();return n>=0?n:0}(s.getResponseHeader("Retry-After")):Math.round(Math.random()*(5e3-d)+d),o=setTimeout((function(){r(l-1,d)}),t)}else{var n=new ei("Failed to export with XHR (status: "+s.status+")",s.status);a(n),clearTimeout(u),clearTimeout(o)}var p},s.onabort=function(){if(c){var e=new ei("Request Timeout");a(e)}clearTimeout(u),clearTimeout(o)},s.onerror=function(){if(c){var e=new ei("Request Timeout");a(e)}clearTimeout(u),clearTimeout(o)}}()}var ii=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ai=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n._useXHR=!1,n._useXHR=!!t.headers||"function"!==typeof navigator.sendBeacon,n._useXHR?n._headers=Object.assign({},function(e){void 0===e&&(e={});var t={};return Object.entries(e).forEach((function(e){var n=zr(e,2),r=n[0],i=n[1];"undefined"!==typeof i?t[r]=String(i):Q.warn('Header "'+r+'" has 
2wrong value and will be ignored')})),t}(t.headers),Er(Fr().OTEL_EXPORTER_OTLP_HEADERS)):n._headers={},n}return ii(t,e),t.prototype.onInit=function(){window.addEventListener("unload",this.shutdown)},t.prototype.onShutdown=function(){window.removeEventListener("unload",this.shutdown)},t.prototype.send=function(e,t,n){var r=this;if(this._shutdownOnce.isCalled)Q.debug("Shutdown already started. Cannot send objects");else{var i=this.convert(e),a=JSON.stringify(i),o=new Promise((function(e,t){r._useXHR?ri(a,r.url,r._headers,r.timeoutMillis,e,t):function(e,t,n,r,i){navigator.sendBeacon(t,new Blob([e],n))?(Q.debug("sendBeacon - can send",e),r()):i(new ei("sendBeacon - cannot send "+e))}(a,r.url,{type:"application/json"},e,t)})).then(t,n);this._sendingPromises.push(o);var s=function(){var e=r._sendingPromises.indexOf(o);r._sendingPromises.splice(e,1)};o.then(s,s)}},t}(Yr),oi=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function si(e){return Object.keys(e).map((function(t){return ci(t,e[t])}))}function ci(e,t){return{key:e,value:ui(t)}}function ui(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(ui)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((function(e){var t=oi(e,2);return ci(t[0],t[1])}))}}:{}}Math.pow(10,6);var li=Math.pow(10,9);function di(e){return e[0]*li+e[1]}function pi(e){for(var t=e.length,n="",r=0;r<t;r+=2){var i=e.substring(r,r+2),a=parseInt(i,16);n+=String.fromCharCode(a)}return btoa(n)}function hi(e,t){var n,r=e.spanContext(),i=e.status,a=t?e.parentSpanId:null!=e.parentSpanId?pi(e.parentSpanId):void 0;return{traceId:t?r.traceId:pi(r.traceId),spanId:t?r.spanId:pi(r.spanId),parentSpanId:a,traceState:null===(n=r.traceState)||void 0===n?void 0:n.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:di(e.startTime),endTimeUnixNano:di(e.endTime),attributes:si(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(fi),droppedEventsCount:e.droppedEventsCount,status:{code:i.code,message:i.message},links:e.links.map((function(e){return function(e,t){var n;return{attributes:e.attributes?si(e.attributes):[],spanId:t?e.context.spanId:pi(e.context.spanId),traceId:t?e.context.traceId:pi(e.context.traceId),traceState:null===(n=e.context.traceState)||void 0===n?void 0:n.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)})),droppedLinksCount:e.droppedLinksCount}}function fi(e){return{attributes:e.attributes?si(e.attributes):[],name:e.name,timeUnixNano:di(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}var vi=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},mi=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function gi(e,t){for(var n=function(e){var t,n,r=new Map;try{for(var i=vi(e),a=i.next();!a.done;a=i.next()){var o=a.value,s=r.get(o.resource);s||(s=new Map,r.set(o.resource,s));var c=o.instrumentationLibrary.name+"@"+(o.instrumentationLibrary.version||"")+":"+(o.instrumentationLibrary.schemaUrl||""),u=s.get(c);u||(u=[],s.set(c,u)),u.push(o)}}
2catch(l){t={error:l}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(e),r=[],i=n.entries(),a=i.next();!a.done;){for(var o=mi(a.value,2),s=o[0],c=[],u=o[1].values(),l=u.next();!l.done;){var d=l.value;if(d.length>0){var p=d[0].instrumentationLibrary,h=p.name,f=p.version,v=p.schemaUrl,m=d.map((function(e){return hi(e,t)}));c.push({scope:{name:h,version:f},spans:m,schemaUrl:v})}l=u.next()}var g={resource:{attributes:si(s.attributes),droppedAttributesCount:0},scopeSpans:c,schemaUrl:void 0};r.push(g),a=i.next()}return r}var yi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bi="v1/traces",ki="http://localhost:4318/"+bi,_i=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,t)||this;return n._headers=Object.assign(n._headers,Er(Fr().OTEL_EXPORTER_OTLP_TRACES_HEADERS)),n}return yi(t,e),t.prototype.convert=function(e){return function(e,t){return{resourceSpans:gi(e,t)}}(e,!0)},t.prototype.getDefaultUrl=function(e){return"string"===typeof e.url?e.url:Fr().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length>0?function(e){try{var t=new URL(e);return""===t.pathname&&(t.pathname=t.pathname+"/"),t.toString()}catch(nn){return Q.warn("Could not parse export URL: '"+e+"'"),e}}(Fr().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT):Fr().OTEL_EXPORTER_OTLP_ENDPOINT.length>0?function(e,t){return e.endsWith("/")||(e+="/"),e+t}(Fr().OTEL_EXPORTER_OTLP_ENDPOINT,bi):ki},t}(ai);var wi="OT_ZONE_CONTEXT",xi=function(){function e(){this._enabled=!1,this._zoneCounter=0}return e.prototype._activeContextFromZone=function(e){return e&&e.get(wi)||te},e.prototype._bindFunction=function(e,t){var n=this,r=function(){for(var r=this,i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return n.with(e,(function(){return t.apply(r,i)}))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r},e.prototype._bindListener=function(e,t){var n=t;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"===typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),"function"===typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),t},e.prototype._createZoneName=function(){this._zoneCounter++;var e=Math.random();return this._zoneCounter+"-"+e},e.prototype._createZone=function(e,t){var n;return Zone.current.fork({name:e,properties:(n={},n[wi]=t,n)})},e.prototype._getActiveZone=function(){return Zone.current},e.prototype._patchAddEventListener=function(e,t,n){var r=this;return function(i,a,o){void 0===e.__ot_listeners&&(e.__ot_listeners={});var s=e.__ot_listeners[i];void 0===s&&(s=new WeakMap,e.__ot_listeners[i]=s);var c=r.bind(n,a);return s.set(a,c),t.call(this,i,c,o)}},e.prototype._patchRemoveEventListener=function(e,t){return function(n,r){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[n])return t.call(this,n,r);var i=e.__ot_listeners[n],a=i.get(r);return i.delete(r),t.call(this,n,a||r)}},e.prototype.active=function(){if(!this._enabled)return te;var e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||te},e.prototype.bind=function(e,t){return void 0===e&&(e=this.active()),"function"===typeof t?this._bindFunction(e,t):(void 0===(n=t)&&(n={}),"function"===typeof n.addEventListener&&"function"===typeof n.removeEventListener&&this._bindListener(e,t),t);var n},e.prototype.disable=function(){return this._enabled=!1,this},e.prototype.enable=function(){return this._enabled=!0,this},e.prototype.with=function(e,t,n){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];var a=this._createZoneName();return this._createZone(a,e).run(t,n,r)},e}(),Si=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ei=function(){function e(){}return e.prototype.createHistogram=function(e,t){return Di},e.prototype.createCounter=function(e,t){return Li}
2,e.prototype.createUpDownCounter=function(e,t){return Ni},e.prototype.createObservableGauge=function(e,t){return Bi},e.prototype.createObservableCounter=function(e,t){return ji},e.prototype.createObservableUpDownCounter=function(e,t){return Ui},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),Ti=function(){},Pi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Si(t,e),t.prototype.add=function(e,t){},t}(Ti),Ci=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Si(t,e),t.prototype.add=function(e,t){},t}(Ti),Ri=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Si(t,e),t.prototype.record=function(e,t){},t}(Ti),Zi=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),Mi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Si(t,e),t}(Zi),Ai=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Si(t,e),t}(Zi),Ii=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Si(t,e),t}(Zi),Oi=new Ei,Li=new Pi,Di=new Ri,Ni=new Ci,ji=new Mi,Bi=new Ai,Ui=new Ii;var Vi,Fi=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return Oi},e}()),zi="metrics",Hi=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return U(zi,e,K.instance())},e.prototype.getMeterProvider=function(){return V(zi)||Fi},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){F(zi,K.instance())},e}().getInstance(),qi={context:Oe,diag:Q,metrics:Hi,propagation:et,trace:Ie},Gi="process.runtime.name",Wi="service.name",Ji="telemetry.sdk.name",$i="telemetry.sdk.language",Ki="telemetry.sdk.version",Qi=((Vi={})[Ji]="opentelemetry",Vi[Gi]="browser",Vi[$i]="webjs",Vi[Ki]="1.13.0",Vi);var Yi,Xi,ea,ta=function(){return ta=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ta.apply(this,arguments)},na=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(t){a(t)}}function s(e){try{c(r.throw(e))}catch(t){a(t)}}function c(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())}))},ra=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(s){a=[6,s],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},ia=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},aa=function(){function e(e,t){var n,r=this;this._attributes=e,this.asyncAttributesPending=null!=t,this._syncAttributes=null!==(n=this._attributes)&&void 0!==n?n:{},this._asyncAttributesPromise=null===t||void 0===t?void 0:t.then((function(e){return r._attributes=Object.assign({},r._attributes,e),r.asyncAttributesPending=!1,e}),(function(e){return Q.debug("a resource's async attributes promise rejected: %s",e),r.asyncAttributesPending=!1,{}}))}return e.empty=function(){return e.EMPTY},e.default=function(){var t;return new e(((t={}
2)[Wi]="unknown_service",t[$i]=Qi[$i],t[Ji]=Qi[Ji],t[Ki]=Qi[Ki],t))},Object.defineProperty(e.prototype,"attributes",{get:function(){var e;return this.asyncAttributesPending&&Q.error("Accessing resource attributes before async attributes settled"),null!==(e=this._attributes)&&void 0!==e?e:{}},enumerable:!1,configurable:!0}),e.prototype.waitForAsyncAttributes=function(){return na(this,void 0,void 0,(function(){return ra(this,(function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.merge=function(t){var n,r=this;if(!t)return this;var i=ta(ta({},this._syncAttributes),null!==(n=t._syncAttributes)&&void 0!==n?n:t.attributes);if(!this._asyncAttributesPromise&&!t._asyncAttributesPromise)return new e(i);var a=Promise.all([this._asyncAttributesPromise,t._asyncAttributesPromise]).then((function(e){var n,i=ia(e,2),a=i[0],o=i[1];return ta(ta(ta(ta({},r._syncAttributes),a),null!==(n=t._syncAttributes)&&void 0!==n?n:t.attributes),o)}));return new e(i,a)},e.EMPTY=new e({}),e}();function oa(e){for(var t=!1,n=[],r=0;r<e.length;r++){var i=e.charAt(r);"_"==i?t=!0:/\d/.test(i)?(n.push(i),t=!0):t?(n.push(i.toUpperCase()),t=!1):0==r?n.push(i.toLowerCase()):n.push(i)}return n.join("")}function sa(e){var t,n,r,i;return e.localName=null!==(t=e.localName)&&void 0!==t?t:oa(e.name),e.jsonName=null!==(n=e.jsonName)&&void 0!==n?n:oa(e.name),e.repeat=null!==(r=e.repeat)&&void 0!==r?r:ea.NO,e.opt=null!==(i=e.opt)&&void 0!==i?i:!e.repeat&&(!e.oneof&&"message"==e.kind),e}!function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"}(Yi||(Yi={})),function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"}(Xi||(Xi={})),function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"}(ea||(ea={}));var ca=function(){function e(t){var n;(0,g.Z)(this,e),this.fields=null!==(n=t.fields)&&void 0!==n?n:[]}return(0,y.Z)(e,[{key:"prepare",value:function(){if(!this.data){var e,t=[],n=[],r=[],i=(0,c.Z)(this.fields);try{for(i.s();!(e=i.n()).done;){var a=e.value;if(a.oneof)r.includes(a.oneof)||(r.push(a.oneof),t.push(a.oneof),n.push(a.oneof));else switch(n.push(a.localName),a.kind){case"scalar":case"enum":a.opt&&!a.repeat||t.push(a.localName);break;case"message":a.repeat&&t.push(a.localName);break;case"map":t.push(a.localName)}}}catch(o){i.e(o)}finally{i.f()}this.data={req:t,known:n,oneofs:Object.values(r)}}}},{key:"is",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<0)return!0;if(null===e||void 0===e||"object"!=typeof e)return!1;this.prepare();var i=Object.keys(e),a=this.data;if(i.length<a.req.length||a.req.some((function(e){return!i.includes(e)})))return!1;if(!r&&i.some((function(e){return!a.known.includes(e)})))return!1;if(t<1)return!0;var o,s=(0,c.Z)(a.oneofs);try{var u=function(){var i=o.value,a=e[i];if(!function(e){if("object"!=typeof e||null===e||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return void 0!==e[e.oneofKind]&&2==Object.keys(e).length;case"undefined":return 1==Object.keys(e).length;default:return!1}}(a))return{v:!1};if(void 0===a.oneofKind)return"continue";var s=n.fields.find((function(e){return e.localName===a.oneofKind}));return s&&n.field(a[a.oneofKind],s,r,t)?void 0:{v:!1}};for(s.s();!(o=s.n()).done;){var l=u();if("continue"!==l&&"object"===typeof l)return l.v}}catch(f){s.e(f)}finally{s.f()}var d,p=(0,c.Z)(this.fields);try{for(p.s();!(d=p.n()).done;){var h=d.value;if(void 0===h.oneof&&!this.field(e[h.localName],h,r,t))return!1}}catch(f){p.e(f)}finally{p.f()}return!0}},{key:"field",value:function(e,t,n,r){var i=t.repeat;switch(t.kind){case"scalar":return void 0===e?t.opt:i?this.scalars(e,t.T,r,t.L):this.scalar(e,t.T,t.L);case"enum":return void 0===e?t.opt:i?this.scalars(e,Yi.INT32,r):this.scalar(e,Yi.INT32);case"message":return void 0===e||(i?this.messages(e,t.T(),n,r):this.message(e,t.T(),n,r));case"map":if("object"!=typeof e||null===e)return!1;if(r<2)return!0;
2if(!this.mapKeys(e,t.K,r))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,r,t.V.L);case"enum":return this.scalars(Object.values(e),Yi.INT32,r);case"message":return this.messages(Object.values(e),t.V.T(),n,r)}}return!0}},{key:"message",value:function(e,t,n,r){return n?t.isAssignable(e,r):t.is(e,r)}},{key:"messages",value:function(e,t,n,r){if(!Array.isArray(e))return!1;if(r<2)return!0;if(n){for(var i=0;i<e.length&&i<r;i++)if(!t.isAssignable(e[i],r-1))return!1}else for(var a=0;a<e.length&&a<r;a++)if(!t.is(e[a],r-1))return!1;return!0}},{key:"scalar",value:function(e,t,n){var r=typeof e;switch(t){case Yi.UINT64:case Yi.FIXED64:case Yi.INT64:case Yi.SFIXED64:case Yi.SINT64:switch(n){case Xi.BIGINT:return"bigint"==r;case Xi.NUMBER:return"number"==r&&!isNaN(e);default:return"string"==r}case Yi.BOOL:return"boolean"==r;case Yi.STRING:return"string"==r;case Yi.BYTES:return e instanceof Uint8Array;case Yi.DOUBLE:case Yi.FLOAT:return"number"==r&&!isNaN(e);default:return"number"==r&&Number.isInteger(e)}}},{key:"scalars",value:function(e,t,n,r){if(!Array.isArray(e))return!1;if(n<2)return!0;if(Array.isArray(e))for(var i=0;i<e.length&&i<n;i++)if(!this.scalar(e[i],t,r))return!1;return!0}},{key:"mapKeys",value:function(e,t,n){var r=Object.keys(e);switch(t){case Yi.INT32:case Yi.FIXED32:case Yi.SFIXED32:case Yi.SINT32:case Yi.UINT32:return this.scalars(r.slice(0,n).map((function(e){return parseInt(e)})),t,n);case Yi.BOOL:return this.scalars(r.slice(0,n).map((function(e){return"true"==e||"false"!=e&&e})),t,n);default:return this.scalars(r,t,n,Xi.STRING)}}}]),e}();function ua(e){var t=typeof e;if("object"==t){if(Array.isArray(e))return"array";if(null===e)return"null"}return t}function la(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}for(var da="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),pa=[],ha=0;ha<da.length;ha++)pa[da[ha].charCodeAt(0)]=ha;function fa(){for(var e=0,t=0,n=0;n<28;n+=7){var r=this.buf[this.pos++];if(e|=(127&r)<<n,0==(128&r))return this.assertBounds(),[e,t]}var i=this.buf[this.pos++];if(e|=(15&i)<<28,t=(112&i)>>4,0==(128&i))return this.assertBounds(),[e,t];for(var a=3;a<=31;a+=7){var o=this.buf[this.pos++];if(t|=(127&o)<<a,0==(128&o))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function va(e,t,n){for(var r=0;r<28;r+=7){var i=e>>>r,a=!(i>>>7==0&&0==t),o=255&(a?128|i:i);if(n.push(o),!a)return}var s=e>>>28&15|(7&t)<<4,c=!(t>>3==0);if(n.push(255&(c?128|s:s)),c){for(var u=3;u<31;u+=7){var l=t>>>u,d=!(l>>>7==0),p=255&(d?128|l:l);if(n.push(p),!d)return}n.push(t>>>31&1)}}pa["-".charCodeAt(0)]=da.indexOf("+"),pa["_".charCodeAt(0)]=da.indexOf("/");var ma=4294967296;function ga(e){var t="-"==e[0];t&&(e=e.slice(1));var n=1e6,r=0,i=0;function a(t,a){var o=Number(e.slice(t,a));i*=n,(r=r*n+o)>=ma&&(i+=r/ma|0,r%=ma)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),[t,r,i]}function ya(e,t){if(t<=2097151)return""+(ma*t+(e>>>0));var n=(e>>>24|t<<8)>>>0&16777215,r=t>>16&65535,i=(16777215&e)+6777216*n+6710656*r,a=n+8147497*r,o=2*r,s=1e7;function c(e,t){var n=e?String(e):"";return t?"0000000".slice(n.length)+n:n}return i>=s&&(a+=Math.floor(i/s),i%=s),a>=s&&(o+=Math.floor(a/s),a%=s),c(o,0)+c(a,o)+c(i,1)}function ba(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(var n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function ka(){var e=this.buf[this.pos++],t=127&e;if(0==(128&e))return this.assertBounds(),t;if(t|=(127&(e=this.buf[this.pos++]))<<7,0==(128&e))return this.assertBounds(),t;if(t|=(127&(e=this.buf[this.pos++]))<<14,0==(128&e))return this.assertBounds(),t;if(t|=(127&(e=this.buf[this.pos++]))<<21,0==(128&e))return this.assertBounds(),t;t|=(15&(e=this.buf[this.pos++]))<<28;for(var n=5;0!==(128&e)&&n<10;n++)e=this.buf[this.pos++];if(0!=(128&e))throw new Error("invalid varint");return this.assertBounds(),t>>>0}var _a=function(){var e=new DataView(new ArrayBuffer(8));return void 0!==globalThis.BigInt&&"function"===typeof e.getBigInt64&&"function"===typeof e.getBigUint64&&"function"===typeof e.setBigInt64&&"function"===typeof e.setBigUint64?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}();function wa(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}var xa=/^-?[0-9]+$/,Sa=4294967296,Ea=function(){function e(t,n){(0,g.Z)(this,e),this.lo=0|t,this.hi=0|
2n}return(0,y.Z)(e,[{key:"isZero",value:function(){return 0==this.lo&&0==this.hi}},{key:"toNumber",value:function(){var e=this.hi*Sa+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}}]),e}(),Ta=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"toString",value:function(){return _a?this.toBigInt().toString():ya(this.lo,this.hi)}},{key:"toBigInt",value:function(){return wa(_a),_a.V.setInt32(0,this.lo,!0),_a.V.setInt32(4,this.hi,!0),_a.V.getBigUint64(0,!0)}}],[{key:"from",value:function(e){if(_a)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=_a.C(e);case"number":if(0===e)return this.ZERO;e=_a.C(e);case"bigint":if(!e)return this.ZERO;if(e<_a.UMIN)throw new Error("signed value for ulong");if(e>_a.UMAX)throw new Error("ulong too large");return _a.V.setBigUint64(0,e,!0),new n(_a.V.getInt32(0,!0),_a.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!xa.test(e))throw new Error("string is no integer");var t=ga(e),r=(0,d.Z)(t,3),i=r[0],a=r[1],o=r[2];if(i)throw new Error("signed value");return new n(a,o);case"number":if(0==e)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");if(e<0)throw new Error("signed value for ulong");return new n(e,e/Sa)}throw new Error("unknown value "+typeof e)}}]),n}(Ea);Ta.ZERO=new Ta(0,0);var Pa=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"isNegative",value:function(){return 0!==(2147483648&this.hi)}},{key:"negate",value:function(){var e=~this.hi,t=this.lo;return t?t=1+~t:e+=1,new n(t,e)}},{key:"toString",value:function(){if(_a)return this.toBigInt().toString();if(this.isNegative()){var e=this.negate();return"-"+ya(e.lo,e.hi)}return ya(this.lo,this.hi)}},{key:"toBigInt",value:function(){return wa(_a),_a.V.setInt32(0,this.lo,!0),_a.V.setInt32(4,this.hi,!0),_a.V.getBigInt64(0,!0)}}],[{key:"from",value:function(e){if(_a)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=_a.C(e);case"number":if(0===e)return this.ZERO;e=_a.C(e);case"bigint":if(!e)return this.ZERO;if(e<_a.MIN)throw new Error("ulong too small");if(e>_a.MAX)throw new Error("ulong too large");return _a.V.setBigInt64(0,e,!0),new n(_a.V.getInt32(0,!0),_a.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!xa.test(e))throw new Error("string is no integer");var t=ga(e),r=(0,d.Z)(t,3),i=r[0],a=new n(r[1],r[2]);return i?a.negate():a;case"number":if(0==e)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new n(e,e/Sa):new n(-e,-e/Sa).negate()}throw new Error("unknown value "+typeof e)}}]),n}(Ea);function Ca(e,t){if(!e)throw new Error(t)}Pa.ZERO=new Pa(0,0);function Ra(e){if("number"!==typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int 32: "+e)}function Za(e){if("number"!==typeof e)throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint 32: "+e)}function Ma(e){if("number"!==typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw new Error("invalid float 32: "+e)}function Aa(e,t){switch(t){case Xi.BIGINT:return e.toBigInt();case Xi.NUMBER:return e.toNumber();default:return e.toString()}}var Ia,Oa,La=function(){function e(t){(0,g.Z)(this,e),this.info=t}return(0,y.Z)(e,[{key:"prepare",value:function(){var e;if(void 0===this.fMap){this.fMap={};var t,n=null!==(e=this.info.fields)&&void 0!==e?e:[],r=(0,c.Z)(n);try{for(r.s();!(t=r.n()).done;){var i=t.value;this.fMap[i.name]=i,this.fMap[i.jsonName]=i,this.fMap[i.localName]=i}}catch(a){r.e(a)}finally{r.f()}}}},{key:"assert",value:function(e,t,n){if(!e){var r=ua(n);throw"number"!=r&&"boolean"!=r||(r=n.toString()),new Error("Cannot parse JSON ".concat(r," for ").concat(this.info.typeName,"#").concat(t))}}},{key:"read",value:function(e,t,n){this.prepare();for(var r=[],i=0,a=Object.entries(e);i<a.length;i++){var o=(0,d.Z)(a[i],2),s=o[0],u=o[1],l=this.fMap[s];if(l){var p=l.localName,h=void 0;if(l.oneof){if(r.includes(l.oneof))throw new Error('Multiple members of the oneof group "'.concat(l.oneof,'" of ').concat(this.info.typeName," are present in JSON."));r.push(l.oneof),h=t[l.oneof]={oneofKind:p}}else h=t;if("map"==l.kind){if(null===u)continue;this.assert(la(u),l.name,u);for(var f=h[p],v=0,m=Object.entries(u);v<m.length;v++){var g=(0,d.Z)(m[v],2),y=g[0],b=g[1];this.assert(null!==b,l.name+" map value",null);var k=void 0;switch(l.V.kind){case"message":k=l.V.T().internalJsonRead(b,n);break;case"enum":if(!1===(k=this.enum(l.V.T(),b,l.name,n.ignoreUnknownFields)))continue;break;case"scalar":k=this.scalar(b,l.V.T,l.V.L,l.name)}this.assert(void 0!==k,l.name+" map value",b);var _=y;
2l.K==Yi.BOOL&&(_="true"==_||"false"!=_&&_),f[_=this.scalar(_,l.K,Xi.STRING,l.name).toString()]=k}}else if(l.repeat){if(null===u)continue;this.assert(Array.isArray(u),l.name,u);var w,x=h[p],S=(0,c.Z)(u);try{for(S.s();!(w=S.n()).done;){var E=w.value;this.assert(null!==E,l.name,null);var T=void 0;switch(l.kind){case"message":T=l.T().internalJsonRead(E,n);break;case"enum":if(!1===(T=this.enum(l.T(),E,l.name,n.ignoreUnknownFields)))continue;break;case"scalar":T=this.scalar(E,l.T,l.L,l.name)}this.assert(void 0!==T,l.name,u),x.push(T)}}catch(C){S.e(C)}finally{S.f()}}else switch(l.kind){case"message":if(null===u&&"google.protobuf.Value"!=l.T().typeName){this.assert(void 0===l.oneof,l.name+" (oneof member)",null);continue}h[p]=l.T().internalJsonRead(u,n,h[p]);break;case"enum":var P=this.enum(l.T(),u,l.name,n.ignoreUnknownFields);if(!1===P)continue;h[p]=P;break;case"scalar":h[p]=this.scalar(u,l.T,l.L,l.name)}}else if(!n.ignoreUnknownFields)throw new Error("Found unknown field while reading ".concat(this.info.typeName," from JSON format. JSON key: ").concat(s))}}},{key:"enum",value:function(e,t,n,r){if("google.protobuf.NullValue"==e[0]&&Ca(null===t,"Unable to parse field ".concat(this.info.typeName,"#").concat(n,", enum ").concat(e[0]," only accepts null.")),null===t)return 0;switch(typeof t){case"number":return Ca(Number.isInteger(t),"Unable to parse field ".concat(this.info.typeName,"#").concat(n,", enum can only be integral number, got ").concat(t,".")),t;case"string":var i=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(i=t.substring(e[2].length));var a=e[1][i];return("undefined"!==typeof a||!r)&&(Ca("number"==typeof a,"Unable to parse field ".concat(this.info.typeName,"#").concat(n,", enum ").concat(e[0],' has no value for "').concat(t,'".')),a)}Ca(!1,"Unable to parse field ".concat(this.info.typeName,"#").concat(n,", cannot parse enum value from ").concat(typeof t,'".'))}},{key:"scalar",value:function(e,t,n,r){var i;try{switch(t){case Yi.DOUBLE:case Yi.FLOAT:if(null===e)return 0;if("NaN"===e)return Number.NaN;if("Infinity"===e)return Number.POSITIVE_INFINITY;if("-Infinity"===e)return Number.NEGATIVE_INFINITY;if(""===e){i="empty string";break}if("string"==typeof e&&e.trim().length!==e.length){i="extra whitespace";break}if("string"!=typeof e&&"number"!=typeof e)break;var a=Number(e);if(Number.isNaN(a)){i="not a number";break}if(!Number.isFinite(a)){i="too large or small";break}return t==Yi.FLOAT&&Ma(a),a;case Yi.INT32:case Yi.FIXED32:case Yi.SFIXED32:case Yi.SINT32:case Yi.UINT32:if(null===e)return 0;var o;if("number"==typeof e?o=e:""===e?i="empty string":"string"==typeof e&&(e.trim().length!==e.length?i="extra whitespace":o=Number(e)),void 0===o)break;return t==Yi.UINT32?Za(o):Ra(o),o;case Yi.INT64:case Yi.SFIXED64:case Yi.SINT64:if(null===e)return Aa(Pa.ZERO,n);if("number"!=typeof e&&"string"!=typeof e)break;return Aa(Pa.from(e),n);case Yi.FIXED64:case Yi.UINT64:if(null===e)return Aa(Ta.ZERO,n);if("number"!=typeof e&&"string"!=typeof e)break;return Aa(Ta.from(e),n);case Yi.BOOL:if(null===e)return!1;if("boolean"!==typeof e)break;return e;case Yi.STRING:if(null===e)return"";if("string"!==typeof e){i="extra whitespace";break}try{encodeURIComponent(e)}catch(i){i="invalid UTF8";break}return e;case Yi.BYTES:if(null===e||""===e)return new Uint8Array(0);if("string"!==typeof e)break;return function(e){var t=3*e.length/4;"="==e[e.length-2]?t-=2:"="==e[e.length-1]&&(t-=1);for(var n,r=new Uint8Array(t),i=0,a=0,o=0,s=0;s<e.length;s++){if(void 0===(n=pa[e.charCodeAt(s)]))switch(e[s]){case"=":a=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(a){case 0:o=n,a=1;break;case 1:r[i++]=o<<2|(48&n)>>4,o=n,a=2;break;case 2:r[i++]=(15&o)<<4|(60&n)>>2,o=n,a=3;break;case 3:r[i++]=(3&o)<<6|n,a=0}}if(1==a)throw Error("invalid base64 string.");return r.subarray(0,i)}(e)}}catch(s){i=s.message}this.assert(!1,r+(i?" - "+i:""),e)}}]),e}(),Da=function(){function e(t){var n;(0,g.Z)(this,e),this.fields=null!==(n=t.fields)&&void 0!==n?n:[]}return(0,y.Z)(e,[{key:"write",value:function(e,t){var n,r={},i=e,a=(0,c.Z)(this.fields);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(o.oneof){var s=i[o.oneof];if(s.oneofKind===o.localName){var u="scalar"==o.kind||"enum"==o.kind?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,l=this.field(o,s[o.localName],u);Ca(void 0!==l),r[t.useProtoFieldName?o.name:o.jsonName]=l}}else{var d=this.field(o,i[o.localName],t);void 0!==d&&(r[t.useProtoFieldName?o.name:o.jsonName]=d)}}}catch(p){a.e(p)}finally{a.f()}return r}},{key:"field",value:function(e,t,n){var r=void 0;if("map"==e.kind){Ca("object"==typeof t&&null!==t);var i={};switch(e.V.kind){case"scalar":for(var a=0,o=Object.entries(t);a<o.length;a++){var s=(0,d.Z)(o[a],2),c=s[0],u=s[1],l=this.scalar(e.V.T,u,e.name,!1,!0);Ca(void 0!==l),i[c.toString()]=l}break;case"message":for(var p=e.V.T(),h=0,f=Object.entries(t);h<f.length;h++){var v=(0,d.Z)(f[h],2),m=v[0],g=v[1],y=this.message(p,g,e.name,n);Ca(void 0!==y),i[m.toString()]=y}break;case"enum":for(var b=e.V.T(),k=0,_=Object.entries(t);k<_.length;k++){var w=(0,d.Z)(_[k],2),x=w[0],S=w[1];Ca(void 0===S||"number"==typeof S);var E=this.enum(b,S,e.name,!1,!0,n.enumAsInteger);Ca(void 0!==E),i[x.toString()]=E}}(n.emitDefaultValues||Object.keys(i).length>0)&&(r=i)}else if(e.repeat){Ca(Array.isArray(t));var T=[];switch(e.kind){case"scalar":for(var P=0;P<t.length;P++){var C=this.scalar(e.T,t[P],e.name,e.opt,!0);Ca(void 0!==C),T.push(C)}break;case"enum":for(var R=e.T(),Z=0;Z<t.length;Z++){Ca(void 0===t[Z]||"number"==typeof t[Z]);var M=this.enum(R,t[Z],e.name,e.opt,!0,n.enumAsInteger);Ca(void 0!==M),T.push(M)}break;case"message":for(var A=e.T(),I=0;I<t.length;I++){var O=this.message(A,t[I],e.name,n);Ca(void 0!==O),T.push(O)}}(n.emitDefaultValues||T.length>0||n.emitDefaultValues)&&(r=T)}else switch(e.kind){case"scalar":r=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case"enum":r=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case"message":r=this.message(e.T(),t,e.name,n)}return r}},{key:"enum",value:function(e,t,n,r,i,a){if("google.protobuf.NullValue"==e[0])return null;if(void 0!==t){if(0!==t||i||r)return Ca("number"==typeof t),Ca(Number.isInteger(t)),a||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}else Ca(r)}},{key:"message",value:function(e,t,n,r){return void 0===t?r.emitDefaultValues?null:void 0:e.internalJsonWrite(t,r)}},{key:"scalar",value:function(e,t,n,r,i){if(void 0!==t){var a=i||r;switch(e){case Yi.INT32:case Yi.SFIXED32:case Yi.SINT32:return 0===t?a?0:void 0:(Ra(t),t);case Yi.FIXED32:case Yi.UINT32:return 0===t?a?0:void 0:(Za(t),t);case Yi.FLOAT:Ma(t);case Yi.DOUBLE:return 0===t?a?0:void 0:(Ca("number"==typeof t),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case Yi.STRING:return""===t?a?"":void 0:(Ca("string"==typeof t),t);case Yi.BOOL:return!1===t?!a&&void 0:(Ca("boolean"==typeof t),t);case Yi.UINT64:case Yi.FIXED64:Ca("number"==typeof t||"string"==typeof t||"bigint"==typeof t);var o=Ta.from(t);if(o.isZero()&&!a)return;return o.toString();case Yi.INT64:case Yi.SFIXED64:case Yi.SINT64:Ca("number"==typeof t||"string"==typeof t||"bigint"==typeof t);var s=Pa.from(t);if(s.isZero()&&!a)return;return s.toString();case Yi.BYTES:return Ca(t instanceof Uint8Array),t.byteLength?function(e){for(var t,n="",r=0,i=0,a=0;a<e.length;a++)switch(t=e[a],r){case 0:n+=da[t>>2],i=(3&t)<<4,r=1;break;case 1:n+=da[i|t>>4],i=(15&t)<<2,r=2;break;case 2:n+=da[i|t>>6],n+=da[63&t],r=0}return r&&(n+=da[i],n+="=",1==r&&(n+="=")),n}(t):a?"":void 0}}else Ca(r)}}]),e}();function Na(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xi.STRING;switch(e){case Yi.BOOL:return!1;case Yi.UINT64:case Yi.FIXED64:return Aa(Ta.ZERO,t);case Yi.INT64:case Yi.SFIXED64:case Yi.SINT64:return Aa(Pa.ZERO,t);case Yi.DOUBLE:case Yi.FLOAT:return 0;case Yi.BYTES:return new Uint8Array(0);case Yi.STRING:return"";default:return 0}}!function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=function(n,r,i,a,o){(t(r)?r[e.symbol]:r[e.symbol]=[]).push({no:i,wireType:a,data:o})},e.onWrite=function(t,n,r){var i,a=(0,c.Z)(e.list(n));try{for(a.s();!(i=a.n()).done;){var o=i.value,s=o.no,u=o.wireType,l=o.data;r.tag(s,u).raw(l)}}catch(d){a.e(d)}finally{a.f()}},e.list=function(n,r){if(t(n)){var i=n[e.symbol];return r?i.filter((function(e){return e.no==r})):i}return[]},e.last=function(t,n){return e.list(t,n).slice(-1)[0]};var t=function(t){return t&&Array.isArray(t[e.symbol])}}
2(Ia||(Ia={})),function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(Oa||(Oa={}));var ja=function(){function e(t){(0,g.Z)(this,e),this.info=t}return(0,y.Z)(e,[{key:"prepare",value:function(){var e;if(!this.fieldNoToField){var t=null!==(e=this.info.fields)&&void 0!==e?e:[];this.fieldNoToField=new Map(t.map((function(e){return[e.no,e]})))}}},{key:"read",value:function(e,t,n,r){this.prepare();for(var i=void 0===r?e.len:e.pos+r;e.pos<i;){var a=e.tag(),o=(0,d.Z)(a,2),s=o[0],c=o[1],u=this.fieldNoToField.get(s);if(u){var l=t,p=u.repeat,h=u.localName;switch(u.oneof&&(l=l[u.oneof]).oneofKind!==h&&(l=t[u.oneof]={oneofKind:h}),u.kind){case"scalar":case"enum":var f="enum"==u.kind?Yi.INT32:u.T,v="scalar"==u.kind?u.L:void 0;if(p){var m=l[h];if(c==Oa.LengthDelimited&&f!=Yi.STRING&&f!=Yi.BYTES)for(var g=e.uint32()+e.pos;e.pos<g;)m.push(this.scalar(e,f,v));else m.push(this.scalar(e,f,v))}else l[h]=this.scalar(e,f,v);break;case"message":if(p){var y=l[h],b=u.T().internalBinaryRead(e,e.uint32(),n);y.push(b)}else l[h]=u.T().internalBinaryRead(e,e.uint32(),n,l[h]);break;case"map":var k=this.mapEntry(u,e,n),_=(0,d.Z)(k,2),w=_[0],x=_[1];l[h][w]=x}}else{var S=n.readUnknownField;if("throw"==S)throw new Error("Unknown field ".concat(s," (wire type ").concat(c,") for ").concat(this.info.typeName));var E=e.skip(c);!1!==S&&(!0===S?Ia.onRead:S)(this.info.typeName,t,s,c,E)}}}},{key:"mapEntry",value:function(e,t,n){for(var r=t.uint32(),i=t.pos+r,a=void 0,o=void 0;t.pos<i;){var s=t.tag(),c=(0,d.Z)(s,2),u=c[0],l=c[1];switch(u){case 1:a=e.K==Yi.BOOL?t.bool().toString():this.scalar(t,e.K,Xi.STRING);break;case 2:switch(e.V.kind){case"scalar":o=this.scalar(t,e.V.T,e.V.L);break;case"enum":o=t.int32();break;case"message":o=e.V.T().internalBinaryRead(t,t.uint32(),n)}break;default:throw new Error("Unknown field ".concat(u," (wire type ").concat(l,") in map entry for ").concat(this.info.typeName,"#").concat(e.name))}}if(void 0===a){var p=Na(e.K);a=e.K==Yi.BOOL?p.toString():p}if(void 0===o)switch(e.V.kind){case"scalar":o=Na(e.V.T,e.V.L);break;case"enum":o=0;break;case"message":o=e.V.T().create()}return[a,o]}},{key:"scalar",value:function(e,t,n){switch(t){case Yi.INT32:return e.int32();case Yi.STRING:return e.string();case Yi.BOOL:return e.bool();case Yi.DOUBLE:return e.double();case Yi.FLOAT:return e.float();case Yi.INT64:return Aa(e.int64(),n);case Yi.UINT64:return Aa(e.uint64(),n);case Yi.FIXED64:return Aa(e.fixed64(),n);case Yi.FIXED32:return e.fixed32();case Yi.BYTES:return e.bytes();case Yi.UINT32:return e.uint32();case Yi.SFIXED32:return e.sfixed32();case Yi.SFIXED64:return Aa(e.sfixed64(),n);case Yi.SINT32:return e.sint32();case Yi.SINT64:return Aa(e.sint64(),n)}}}]),e}(),Ba=function(){function e(t){(0,g.Z)(this,e),this.info=t}return(0,y.Z)(e,[{key:"prepare",value:function(){if(!this.fields){var e=this.info.fields?this.info.fields.concat():[];this.fields=e.sort((function(e,t){return e.no-t.no}))}}},{key:"write",value:function(e,t,n){this.prepare();var r,i=(0,c.Z)(this.fields);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=void 0,s=void 0,u=a.repeat,l=a.localName;if(a.oneof){var p=e[a.oneof];if(p.oneofKind!==l)continue;o=p[l],s=!0}else o=e[l],s=!1;switch(a.kind){case"scalar":case"enum":var h="enum"==a.kind?Yi.INT32:a.T;if(u)if(Ca(Array.isArray(o)),u==ea.PACKED)this.packed(t,h,a.no,o);else{var f,v=(0,c.Z)(o);try{for(v.s();!(f=v.n()).done;){var m=f.value;this.scalar(t,h,a.no,m,!0)}}catch(T){v.e(T)}finally{v.f()}}else void 0===o?Ca(a.opt):this.scalar(t,h,a.no,o,s||a.opt);break;case"message":if(u){Ca(Array.isArray(o));var g,y=(0,c.Z)(o);try{for(y.s();!(g=y.n()).done;){var b=g.value;this.message(t,n,a.T(),a.no,b)}}catch(T){y.e(T)}finally{y.f()}}else this.message(t,n,a.T(),a.no,o);break;case"map":Ca("object"==typeof o&&null!==o);for(var k=0,_=Object.entries(o);k<_.length;k++){var w=(0,d.Z)(_[k],2),x=w[0],S=w[1];this.mapEntry(t,n,a,x,S)}}}}catch(T){i.e(T)}finally{i.f()}var E=n.writeUnknownFields;!1!==E&&(!0===E?Ia.onWrite:E)(this.info.typeName,e,t)}},{key:"mapEntry",value:function(e,t,n,r,i){e.tag(n.no,Oa.LengthDelimited),e.fork();var a=r;switch(n.K){case Yi.INT32:case Yi.FIXED32:case Yi.UINT32:case Yi.SFIXED32:case Yi.SINT32:a=Number.parseInt(r);break;case Yi.BOOL:Ca("true"==r||"false"==r),a="true"==r}switch(this.scalar(e,n.K,1,a,!0),n.V.kind){case"scalar":this.scalar(e,n.V.T,2,i,!0);break;case"enum":this.scalar(e,Yi.INT32,2,i,!0);break;case"message":this.message(e,t,n.V.T(),2,i)}e.join()}},{key:"message",value:function(e,t,n,r,i){void 0!==i&&(n.internalBinaryWrite(i,e.tag(r,Oa.LengthDelimited).fork(),t),e.join())}},{key:"scalar",value:function(e,t,n,r,i){var a=this.scalarInfo(t,r),o=(0,d.Z)(a,3),s=o[0],c=o[1];o[2]&&!i||(e.tag(n,s),e[c](r))}},{key:"packed",value:function(e,t,n,r){if(r.length){Ca(t!==Yi.BYTES&&t!==Yi.STRING),e.tag(n,Oa.LengthDelimited),e.fork();for(var i=this.scalarInfo(t),a=(0,d.Z)(i,2)[1],o=0;o<r.length;o++)e[a](r[o]);e.join()}}},{key:"scalarInfo",value:function(e,t){var n,r=Oa.Varint,i=void 0===t,a=0===t;switch(e){case Yi.INT32:n="int32";break;case Yi.STRING:a=i||!t.length,r=Oa.LengthDelimited,n="string";break;case Yi.BOOL:a=!1===t,n="bool";break;case Yi.UINT32:n="uint32";break;case Yi.DOUBLE:r=Oa.Bit64,n="double";break;case Yi.FLOAT:r=Oa.Bit32,n="float";break;case Yi.INT64:a=i||Pa.from(t).isZero(),n="int64";break;case Yi.UINT64:a=i||Ta.from(t).isZero(),n="uint64";break;case Yi.FIXED64:a=i||Ta.from(t).isZero(),r=Oa.Bit64,n="fixed64";break;case Yi.BYTES:a=i||!t.byteLength,r=Oa.LengthDelimited,n="bytes";break;case Yi.FIXED32:r=Oa.Bit32,n="fixed32";break;case Yi.SFIXED32:r=Oa.Bit32,n="sfixed32";break;case Yi.SFIXED64:a=i||Pa.from(t).isZero(),r=Oa.Bit64,n="sfixed64";break;case Yi.SINT32:n="sint32";break;case Yi.SINT64:a=i||Pa.from(t).isZero(),n="sint64"}return[r,n,i||a]}}]),e}(),Ua=Symbol.for("protobuf-ts/message-type");function Va(e,t,n){var r,i,a,o=n,s=(0,c.Z)(e.fields);try{for(s.s();!(a=s.n()).done;){var u=a.value,l=u.localName;if(u.oneof){var d=o[u.oneof];if(void 0==(null===d||void 0===d?void 0:d.oneofKind))continue;if(r=d[l],(i=t[u.oneof]).oneofKind=d.oneofKind,void 0==r){delete i[l];continue}}else if(r=o[l],i=t,void 0==r)continue;switch(u.repeat&&(i[l].length=r.length),u.kind){case"scalar":case"enum":if(u.repeat)for(var p=0;p<r.length;p++)i[l][p]=r[p];else i[l]=r;break;case"message":var h=u.T();if(u.repeat)for(var f=0;f<r.length;f++)i[l][f]=h.create(r[f]);else void 0===i[l]?i[l]=h.create(r):h.mergePartial(i[l],r);break;case"map":switch(u.V.kind){case"scalar":case"enum":Object.assign(i[l],r);break;case"message":for(var v=u.V.T(),m=0,g=Object.keys(r);m<g.length;m++){var y=g[m];i[l][y]=v.create(r[y])}}}}}catch(b){s.e(b)}finally{s.f()}}var Fa={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},za={ignoreUnknownFields:!1};var Ha=Object.values;function qa(e,t,n){if(t===n)return!0;
2if(e!==Yi.BYTES)return!1;var r=t,i=n;if(r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!=i[a])return!1;return!0}function Ga(e,t,n){if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!qa(e,t[r],n[r]))return!1;return!0}function Wa(e,t,n){if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!e.equals(t[r],n[r]))return!1;return!0}var Ja={writeUnknownFields:!0,writerFactory:function(){return new $a}};var $a=function(){function e(t){(0,g.Z)(this,e),this.stack=[],this.textEncoder=null!==t&&void 0!==t?t:new TextEncoder,this.chunks=[],this.buf=[]}return(0,y.Z)(e,[{key:"finish",value:function(){this.chunks.push(new Uint8Array(this.buf));for(var e=0,t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;for(var n=new Uint8Array(e),r=0,i=0;i<this.chunks.length;i++)n.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],n}},{key:"fork",value:function(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}},{key:"join",value:function(){var e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}},{key:"tag",value:function(e,t){return this.uint32((e<<3|t)>>>0)}},{key:"raw",value:function(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}},{key:"uint32",value:function(e){for(Za(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}},{key:"int32",value:function(e){return Ra(e),ba(e,this.buf),this}},{key:"bool",value:function(e){return this.buf.push(e?1:0),this}},{key:"bytes",value:function(e){return this.uint32(e.byteLength),this.raw(e)}},{key:"string",value:function(e){var t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}},{key:"float",value:function(e){Ma(e);var t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}},{key:"double",value:function(e){var t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}},{key:"fixed32",value:function(e){Za(e);var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}},{key:"sfixed32",value:function(e){Ra(e);var t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}},{key:"sint32",value:function(e){return Ra(e),ba(e=(e<<1^e>>31)>>>0,this.buf),this}},{key:"sfixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=Pa.from(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"fixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=Ta.from(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"int64",value:function(e){var t=Pa.from(e);return va(t.lo,t.hi,this.buf),this}},{key:"sint64",value:function(e){var t=Pa.from(e),n=t.hi>>31;return va(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}},{key:"uint64",value:function(e){var t=Ta.from(e);return va(t.lo,t.hi,this.buf),this}}]),e}(),Ka=n(5647),Qa={readUnknownField:!0,readerFactory:function(e){return new Ya(e)}};var Ya=function(){function e(t,n){(0,g.Z)(this,e),this.varint64=fa,this.uint32=ka,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=null!==n&&void 0!==n?n:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}return(0,y.Z)(e,[{key:"tag",value:function(){var e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}},{key:"skip",value:function(e){var t=this.pos;switch(e){case Oa.Varint:for(;128&this.buf[this.pos++];);break;case Oa.Bit64:this.pos+=4;case Oa.Bit32:this.pos+=4;break;case Oa.LengthDelimited:var n=this.uint32();this.pos+=n;break;case Oa.StartGroup:for(var r;(r=this.tag()[1])!==Oa.EndGroup;)this.skip(r);break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}},{key:"assertBounds",value:function(){if(this.pos>this.len)throw new RangeError("premature EOF")}},{key:"int32",value:function(){return 0|this.uint32()}},{key:"sint32",value:function(){var e=this.uint32();return e>>>1^-(1&e)}},{key:"int64",value:function(){return(0,Ka.Z)(Pa,(0,o.Z)(this.varint64()))}},{key:"uint64",value:function(){return(0,Ka.Z)(Ta,(0,o.Z)(this.varint64()))}},{key:"sint64",value:function(){var e=this.varint64(),t=(0,d.Z)(e,2),n=t[0],r=t[1],i=-(1&n);return new Pa(n=(n>>>1|(1&r)<<31)^i,r=r>>>1^i)}},{key:"bool",value:function(){var e=this.varint64(),t=(0,d.Z)(e,2),n=t[0],r=t[1];
2return 0!==n||0!==r}},{key:"fixed32",value:function(){return this.view.getUint32((this.pos+=4)-4,!0)}},{key:"sfixed32",value:function(){return this.view.getInt32((this.pos+=4)-4,!0)}},{key:"fixed64",value:function(){return new Ta(this.sfixed32(),this.sfixed32())}},{key:"sfixed64",value:function(){return new Pa(this.sfixed32(),this.sfixed32())}},{key:"float",value:function(){return this.view.getFloat32((this.pos+=4)-4,!0)}},{key:"double",value:function(){return this.view.getFloat64((this.pos+=8)-8,!0)}},{key:"bytes",value:function(){var e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}},{key:"string",value:function(){return this.textDecoder.decode(this.bytes())}}]),e}(),Xa=function(){function e(t,n,r){(0,g.Z)(this,e),this.defaultCheckDepth=16,this.typeName=t,this.fields=n.map(sa),this.options=null!==r&&void 0!==r?r:{},this.refTypeCheck=new ca(this),this.refJsonReader=new La(this),this.refJsonWriter=new Da(this),this.refBinReader=new ja(this),this.refBinWriter=new Ba(this)}return(0,y.Z)(e,[{key:"create",value:function(e){var t=function(e){var t={};Object.defineProperty(t,Ua,{enumerable:!1,value:e});var n,r=(0,c.Z)(e.fields);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=i.localName;if(!i.opt)if(i.oneof)t[i.oneof]={oneofKind:void 0};else if(i.repeat)t[a]=[];else switch(i.kind){case"scalar":t[a]=Na(i.T,i.L);break;case"enum":t[a]=0;break;case"map":t[a]={}}}}catch(o){r.e(o)}finally{r.f()}return t}(this);return void 0!==e&&Va(this,t,e),t}},{key:"clone",value:function(e){var t=this.create();return Va(this,t,e),t}},{key:"equals",value:function(e,t){return function(e,t,n){if(t===n)return!0;if(!t||!n)return!1;var r,i=(0,c.Z)(e.fields);try{for(i.s();!(r=i.n()).done;){var a=r.value,o=a.localName,s=a.oneof?t[a.oneof][o]:t[o],u=a.oneof?n[a.oneof][o]:n[o];switch(a.kind){case"enum":case"scalar":var l="enum"==a.kind?Yi.INT32:a.T;if(!(a.repeat?Ga(l,s,u):qa(l,s,u)))return!1;break;case"map":if(!("message"==a.V.kind?Wa(a.V.T(),Ha(s),Ha(u)):Ga("enum"==a.V.kind?Yi.INT32:a.V.T,Ha(s),Ha(u))))return!1;break;case"message":var d=a.T();if(!(a.repeat?Wa(d,s,u):d.equals(s,u)))return!1}}}catch(p){i.e(p)}finally{i.f()}return!0}(this,e,t)}},{key:"is",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultCheckDepth;return this.refTypeCheck.is(e,t,!1)}},{key:"isAssignable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultCheckDepth;return this.refTypeCheck.is(e,t,!0)}},{key:"mergePartial",value:function(e,t){Va(this,e,t)}},{key:"fromBinary",value:function(e,t){var n=function(e){return e?Object.assign(Object.assign({},Qa),e):Qa}(t);return this.internalBinaryRead(n.readerFactory(e),e.byteLength,n)}},{key:"fromJson",value:function(e,t){return this.internalJsonRead(e,function(e){return e?Object.assign(Object.assign({},za),e):za}(t))}},{key:"fromJsonString",value:function(e,t){var n=JSON.parse(e);return this.fromJson(n,t)}},{key:"toJson",value:function(e,t){return this.internalJsonWrite(e,function(e){return e?Object.assign(Object.assign({},Fa),e):Fa}(t))}},{key:"toJsonString",value:function(e,t){var n,r=this.toJson(e,t);return JSON.stringify(r,null,null!==(n=null===t||void 0===t?void 0:t.prettySpaces)&&void 0!==n?n:0)}},{key:"toBinary",value:function(e,t){var n=function(e){return e?Object.assign(Object.assign({},Ja),e):Ja}(t);return this.internalBinaryWrite(e,n.writerFactory(),n).finish()}},{key:"internalJsonRead",value:function(e,t,n){if(null!==e&&"object"==typeof e&&!Array.isArray(e)){var r=null!==n&&void 0!==n?n:this.create();return this.refJsonReader.read(e,r,t),r}throw new Error("Unable to parse message ".concat(this.typeName," from JSON ").concat(ua(e),"."))}},{key:"internalJsonWrite",value:function(e,t){return this.refJsonWriter.write(e,t)}},{key:"internalBinaryWrite",value:function(e,t,n){return this.refBinWriter.write(e,t,n),t}},{key:"internalBinaryRead",value:function(e,t,n,r){var i=null!==r&&void 0!==r?r:this.create();return this.refBinReader.read(e,i,n,t),i}}]),e}(),eo=n(9647),to=Object.create(null);to.open="0",to.close="1",to.ping="2",to.pong="3",to.message="4",to.upgrade="5",to.noop="6";var no=Object.create(null);
2Object.keys(to).forEach((function(e){no[to[e]]=e}));for(var ro={type:"error",data:"parser error"},io="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),ao="function"===typeof ArrayBuffer,oo=function(e,t){var n=new FileReader;return n.onload=function(){var e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)},so=function(e,t,n){var r,i=e.type,a=e.data;return io&&a instanceof Blob?t?n(a):oo(a,n):ao&&(a instanceof ArrayBuffer||(r=a,"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer))?t?n(a):oo(new Blob([a]),n):n(to[i]+(a||""))},co="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uo="undefined"===typeof Uint8Array?[]:new Uint8Array(256),lo=0;lo<64;lo++)uo[co.charCodeAt(lo)]=lo;var po="function"===typeof ArrayBuffer,ho=function(e,t){if(po){var n=function(e){var t,n,r,i,a,o=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u=new ArrayBuffer(o),l=new Uint8Array(u);for(t=0;t<s;t+=4)n=uo[e.charCodeAt(t)],r=uo[e.charCodeAt(t+1)],i=uo[e.charCodeAt(t+2)],a=uo[e.charCodeAt(t+3)],l[c++]=n<<2|r>>4,l[c++]=(15&r)<<4|i>>2,l[c++]=(3&i)<<6|63&a;return u}(e);return fo(n,t)}return{base64:!0,data:e}},fo=function(e,t){return"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e},vo=function(e,t){if("string"!==typeof e)return{type:"message",data:fo(e,t)};var n=e.charAt(0);return"b"===n?{type:"message",data:ho(e.substring(1),t)}:no[n]?e.length>1?{type:no[n],data:e.substring(1)}:{type:no[n]}:ro},mo=String.fromCharCode(30);function go(e){if(e)return function(e){for(var t in go.prototype)e[t]=go.prototype[t];return e}(e)}go.prototype.on=go.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},go.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},go.prototype.off=go.prototype.removeListener=go.prototype.removeAllListeners=go.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},go.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t)}return this},go.prototype.emitReserved=go.prototype.emit,go.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},go.prototype.hasListeners=function(e){return!!this.listeners(e).length};var yo="undefined"!==typeof self?self:"undefined"!==typeof window?window:Function("return this")();function bo(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((function(t,n){return e.hasOwnProperty(n)&&(t[n]=e[n]),t}),{})}var ko=yo.setTimeout,_o=yo.clearTimeout;function wo(e,t){t.useNativeTimers?(e.setTimeoutFn=ko.bind(yo),e.clearTimeoutFn=_o.bind(yo)):(e.setTimeoutFn=yo.setTimeout.bind(yo),e.clearTimeoutFn=yo.clearTimeout.bind(yo))}var xo,So=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i){var a;return(0,g.Z)(this,n),(a=t.call(this,e)).description=r,a.context=i,a.type="TransportError",a}return(0,y.Z)(n)}((0,a.Z)(Error)),Eo=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this)).writable=!1,wo((0,f.Z)(r),e),r.opts=e,r.query=e.query,r.socket=e.socket,r}return(0,y.Z)(n,[{key:"onError",value:function(e,t,r){return l((0,u.Z)(n.prototype),"emitReserved",this).call(this,"error",new So(e,t,r)),this}},{key:"open",value:function(){return this.readyState="opening",this.doOpen(),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(e){"open"===this.readyState&&this.write(e)}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,l((0,u.Z)(n.prototype),"emitReserved",this).call(this,"open")}}
2,{key:"onData",value:function(e){var t=vo(e,this.socket.binaryType);this.onPacket(t)}},{key:"onPacket",value:function(e){l((0,u.Z)(n.prototype),"emitReserved",this).call(this,"packet",e)}},{key:"onClose",value:function(e){this.readyState="closed",l((0,u.Z)(n.prototype),"emitReserved",this).call(this,"close",e)}},{key:"pause",value:function(e){}}]),n}(go),To="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Po=64,Co={},Ro=0,Zo=0;function Mo(e){var t="";do{t=To[e%Po]+t,e=Math.floor(e/Po)}while(e>0);return t}function Ao(){var e=Mo(+new Date);return e!==xo?(Ro=0,xo=e):e+"."+Mo(Ro++)}for(;Zo<Po;Zo++)Co[To[Zo]]=Zo;function Io(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}var Oo=!1;try{Oo="undefined"!==typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(xC){}var Lo=Oo;function Do(e){var t=e.xdomain;try{if("undefined"!==typeof XMLHttpRequest&&(!t||Lo))return new XMLHttpRequest}catch(n){}if(!t)try{return new(yo[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(n){}}function No(){}var jo=null!=new Do({xdomain:!1}).responseType,Bo=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;if((0,g.Z)(this,n),(r=t.call(this,e)).polling=!1,"undefined"!==typeof location){var i="https:"===location.protocol,a=location.port;a||(a=i?"443":"80"),r.xd="undefined"!==typeof location&&e.hostname!==location.hostname||a!==e.port,r.xs=e.secure!==i}var o=e&&e.forceBase64;return r.supportsBinary=jo&&!o,r}return(0,y.Z)(n,[{key:"name",get:function(){return"polling"}},{key:"doOpen",value:function(){this.poll()}},{key:"pause",value:function(e){var t=this;this.readyState="pausing";var n=function(){t.readyState="paused",e()};if(this.polling||!this.writable){var r=0;this.polling&&(r++,this.once("pollComplete",(function(){--r||n()}))),this.writable||(r++,this.once("drain",(function(){--r||n()})))}else n()}},{key:"poll",value:function(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}},{key:"onData",value:function(e){var t=this;(function(e,t){for(var n=e.split(mo),r=[],i=0;i<n.length;i++){var a=vo(n[i],t);if(r.push(a),"error"===a.type)break}return r})(e,this.socket.binaryType).forEach((function(e){if("opening"===t.readyState&&"open"===e.type&&t.onOpen(),"close"===e.type)return t.onClose({description:"transport closed by the server"}),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}},{key:"doClose",value:function(){var e=this,t=function(){e.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}},{key:"write",value:function(e){var t=this;this.writable=!1,function(e,t){var n=e.length,r=new Array(n),i=0;e.forEach((function(e,a){so(e,!1,(function(e){r[a]=e,++i===n&&t(r.join(mo))}))}))}(e,(function(e){t.doWrite(e,(function(){t.writable=!0,t.emitReserved("drain")}))}))}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"https":"http",n="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=Ao()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port);var r=Io(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}},{key:"request",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Uo(this.uri(),e)}},{key:"doWrite",value:function(e,t){var n=this,r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(function(e,t){n.onError("xhr post error",e,t)}))}},{key:"doPoll",value:function(){var e=this,t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(function(t,n){e.onError("xhr poll error",t,n)})),this.pollXhr=t}}]),n}(Eo),Uo=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this),wo((0,f.Z)(i),r),i.opts=r,i.method=r.method||"GET",i.uri=e,i.async=!1!==r.async,i.data=void 0!==r.data?r.data:null,i.create(),i}return(0,y.Z)(n,[{key:"create",value:function(){var e=this,t=bo(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;var r=this.xhr=new Do(t);try{r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var i in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}catch(a){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(a){}try{r.setRequestHeader("Accept","*/*")}catch(a){}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=function(){4===r.readyState&&(200===r.
2status||1223===r.status?e.onLoad():e.setTimeoutFn((function(){e.onError("number"===typeof r.status?r.status:0)}),0))},r.send(this.data)}catch(a){return void this.setTimeoutFn((function(){e.onError(a)}),0)}"undefined"!==typeof document&&(this.index=n.requestsCount++,n.requests[this.index]=this)}},{key:"onError",value:function(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}},{key:"cleanup",value:function(e){if("undefined"!==typeof this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=No,e)try{this.xhr.abort()}catch(t){}"undefined"!==typeof document&&delete n.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}},{key:"abort",value:function(){this.cleanup()}}]),n}(go);if(Uo.requestsCount=0,Uo.requests={},"undefined"!==typeof document)if("function"===typeof attachEvent)attachEvent("onunload",Vo);else if("function"===typeof addEventListener){addEventListener("onpagehide"in yo?"pagehide":"unload",Vo,!1)}function Vo(){for(var e in Uo.requests)Uo.requests.hasOwnProperty(e)&&Uo.requests[e].abort()}var Fo="function"===typeof Promise&&"function"===typeof Promise.resolve?function(e){return Promise.resolve().then(e)}:function(e,t){return t(e,0)},zo=yo.WebSocket||yo.MozWebSocket,Ho="undefined"!==typeof navigator&&"string"===typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),qo=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,e)).supportsBinary=!e.forceBase64,r}return(0,y.Z)(n,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){var e=this.uri(),t=this.opts.protocols,n=Ho?{}:bo(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=Ho?new zo(e,t,n):t?new zo(e,t):new zo(e)}catch(xC){return this.emitReserved("error",xC)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}}},{key:"addEventListeners",value:function(){var e=this;this.ws.onopen=function(){e.opts.autoUnref&&e.ws._socket.unref(),e.onOpen()},this.ws.onclose=function(t){return e.onClose({description:"websocket connection closed",context:t})},this.ws.onmessage=function(t){return e.onData(t.data)},this.ws.onerror=function(t){return e.onError("websocket error",t)}}},{key:"write",value:function(e){var t=this;this.writable=!1;for(var n=function(){var n=e[r],i=r===e.length-1;so(n,t.supportsBinary,(function(e){try{t.ws.send(e)}catch(n){}i&&Fo((function(){t.writable=!0,t.emitReserved("drain")}),t.setTimeoutFn)}))},r=0;r<e.length;r++)n()}},{key:"doClose",value:function(){"undefined"!==typeof this.ws&&(this.ws.close(),this.ws=null)}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"wss":"ws",n="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(n=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Ao()),this.supportsBinary||(e.b64=1);var r=Io(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+n+this.opts.path+(r.length?"?"+r:"")}},{key:"check",value:function(){return!!zo}}]),n}(Eo),Go={websocket:qo,polling:Bo},Wo=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Jo=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function $o(e){var t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));for(var i=Wo.exec(e||""),a={},o=14;o--;)a[Jo[o]]=i[o]||"";return-1!=n&&-1!=r&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=function(e,t){var n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,a.path),a.queryKey=function(e,t){var n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,a.query),a}var Ko=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,g.Z)(this,n),(r=t.call(this)).writeBuffer=[],e&&"object"===typeof e&&(i=e,e=null),e?(e=$o(e),i.hostname=e.host,i.secure="https"===e.protocol||"wss"===e.protocol,i.port=e.port,e.query&&(i.query=e.query)):i.host&&(i.hostname=$o(i.host).host),wo((0,f.Z)(r),i),r.secure=null!=i.secure?i.secure:"undefined"!==typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=r.secure?"443":"80"),r.hostname=i.hostname||("undefined"!==typeof location?location.hostname:"localhost"),r.port=i.port||("undefined"!==typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=i.transports||["polling","websocket"],r.writeBuffer=[],r.prevBufferLen=0,r.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},i),r.opts.path=r.opts.path.replace(/\/$/,"")+(r.opts.addTrailingSlash?"/":""),"string"===typeof r.opts.query&&(r.opts.query=function(e){for(var t={},n=e.split("&"),r=0,i=n.length;r<i;r++){var a=n[r].split("=");
2t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}(r.opts.query)),r.id=null,r.upgrades=null,r.pingInterval=null,r.pingTimeout=null,r.pingTimeoutTimer=null,"function"===typeof addEventListener&&(r.opts.closeOnBeforeunload&&(r.beforeunloadEventListener=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.beforeunloadEventListener,!1)),"localhost"!==r.hostname&&(r.offlineEventListener=function(){r.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",r.offlineEventListener,!1))),r.open(),r}return(0,y.Z)(n,[{key:"createTransport",value:function(e){var t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);var n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Go[e](n)}},{key:"open",value:function(){var e,t=this;if(this.opts.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(r){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}},{key:"setTransport",value:function(e){var t=this;this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(function(e){return t.onClose("transport close",e)}))}},{key:"probe",value:function(e){var t=this,r=this.createTransport(e),i=!1;n.priorWebsocketSuccess=!1;var a=function(){i||(r.send([{type:"ping",data:"probe"}]),r.once("packet",(function(e){if(!i)if("pong"===e.type&&"probe"===e.data){if(t.upgrading=!0,t.emitReserved("upgrading",r),!r)return;n.priorWebsocketSuccess="websocket"===r.name,t.transport.pause((function(){i||"closed"!==t.readyState&&(d(),t.setTransport(r),r.send([{type:"upgrade"}]),t.emitReserved("upgrade",r),r=null,t.upgrading=!1,t.flush())}))}else{var a=new Error("probe error");a.transport=r.name,t.emitReserved("upgradeError",a)}})))};function o(){i||(i=!0,d(),r.close(),r=null)}var s=function(e){var n=new Error("probe error: "+e);n.transport=r.name,o(),t.emitReserved("upgradeError",n)};function c(){s("transport closed")}function u(){s("socket closed")}function l(e){r&&e.name!==r.name&&o()}var d=function(){r.removeListener("open",a),r.removeListener("error",s),r.removeListener("close",c),t.off("close",u),t.off("upgrading",l)};r.once("open",a),r.once("error",s),r.once("close",c),this.once("close",u),this.once("upgrading",l),r.open()}},{key:"onOpen",value:function(){if(this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade)for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},{key:"onPacket",value:function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}},{key:"onHandshake",value:function(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}},{key:"resetPingTimeout",value:function(){var e=this;this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((function(){e.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}},{key:"onDrain",value:function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}},{key:"flush",value:function(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){var e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}},{key:"getWritablePackets",value:function(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;for(var e,t=1,n=0;n<this.writeBuffer.length;n++){var r=this.writeBuffer[n].data;if(r&&(t+="string"===typeof(e=r)?function(e){for(var t=0,n=0,r=0,i=e.length;r<i;r++)(t=e.charCodeAt(r))<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))),n>0&&t>this.maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}},{key:"write",value:function(e,t,n){return this.sendPacket("message",e,t,n),this}},{key:"send",value:function(e,t,n){return this.sendPacket("message",e,t,n),this}},{key:"sendPacket",value:function(e,t,n,r){if("function"===typeof t&&(r=t,t=void 0),"function"===typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var i={type:e,data:t,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}}},{key:"close",value:function(){var e=this,t=function(){e.onClose("forced close"),e.transport.close()},n=function n(){e.off("upgrade",n),e.off("upgradeError",n),t()},r=function(){e.once("upgrade",n),e.once("upgradeError",n)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){e.upgrading?r():t()})):this.upgrading?r():t()),this}},{key:"onError",value:function(e){n.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}},{key:"onClose",value:function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"===typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(e){for(var t=[],n=0,r=e.length;n<r;
2n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}]),n}(go);Ko.protocol=4;Ko.protocol;var Qo="function"===typeof ArrayBuffer,Yo=function(e){return"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer},Xo=Object.prototype.toString,es="function"===typeof Blob||"undefined"!==typeof Blob&&"[object BlobConstructor]"===Xo.call(Blob),ts="function"===typeof File||"undefined"!==typeof File&&"[object FileConstructor]"===Xo.call(File);function ns(e){return Qo&&(e instanceof ArrayBuffer||Yo(e))||es&&e instanceof Blob||ts&&e instanceof File}function rs(e,t){if(!e||"object"!==typeof e)return!1;if(Array.isArray(e)){for(var n=0,r=e.length;n<r;n++)if(rs(e[n]))return!0;return!1}if(ns(e))return!0;if(e.toJSON&&"function"===typeof e.toJSON&&1===arguments.length)return rs(e.toJSON(),!0);for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&rs(e[i]))return!0;return!1}function is(e){var t=[],n=e.data,r=e;return r.data=as(n,t),r.attachments=t.length,{packet:r,buffers:t}}function as(e,t){if(!e)return e;if(ns(e)){var n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){for(var r=new Array(e.length),i=0;i<e.length;i++)r[i]=as(e[i],t);return r}if("object"===typeof e&&!(e instanceof Date)){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(a[o]=as(e[o],t));return a}return e}function os(e,t){return e.data=ss(e.data,t),delete e.attachments,e}function ss(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"===typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(var n=0;n<e.length;n++)e[n]=ss(e[n],t);else if("object"===typeof e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=ss(e[r],t));return e}var cs,us=5;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(cs||(cs={}));var ls=function(){function e(t){(0,g.Z)(this,e),this.replacer=t}return(0,y.Z)(e,[{key:"encode",value:function(e){return e.type!==cs.EVENT&&e.type!==cs.ACK||!rs(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===cs.EVENT?cs.BINARY_EVENT:cs.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}},{key:"encodeAsString",value:function(e){var t=""+e.type;return e.type!==cs.BINARY_EVENT&&e.type!==cs.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}},{key:"encodeAsBinary",value:function(e){var t=is(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}]),e}(),ds=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this)).reviver=e,r}return(0,y.Z)(n,[{key:"add",value:function(e){var t;if("string"===typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");var r=(t=this.decodeString(e)).type===cs.BINARY_EVENT;r||t.type===cs.BINARY_ACK?(t.type=r?cs.EVENT:cs.ACK,this.reconstructor=new ps(t),0===t.attachments&&l((0,u.Z)(n.prototype),"emitReserved",this).call(this,"decoded",t)):l((0,u.Z)(n.prototype),"emitReserved",this).call(this,"decoded",t)}else{if(!ns(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,l((0,u.Z)(n.prototype),"emitReserved",this).call(this,"decoded",t))}}},{key:"decodeString",value:function(e){var t=0,r={type:Number(e.charAt(0))};if(void 0===cs[r.type])throw new Error("unknown packet type "+r.type);if(r.type===cs.BINARY_EVENT||r.type===cs.BINARY_ACK){for(var i=t+1;"-"!==e.charAt(++t)&&t!=e.length;);var a=e.substring(i,t);if(a!=Number(a)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(a)}if("/"===e.charAt(t+1)){for(var o=t+1;++t;){if(","===e.charAt(t))break;if(t===e.length)break}r.nsp=e.substring(o,t)}else r.nsp="/";var s=e.charAt(t+1);if(""!==s&&Number(s)==s){for(var c=t+1;++t;){var u=e.charAt(t);if(null==u||Number(u)!=u){--t;break}if(t===e.length)break}r.id=Number(e.substring(c,t+1))}if(e.charAt(++t)){var l=this.tryParse(e.substr(t));if(!n.isPayloadValid(r.type,l))throw new Error("invalid payload");r.data=l}return r}},{key:"tryParse",value:function(e){try{return JSON.parse(e,this.reviver)}catch(t){return!1}}},{key:"destroy",value:function(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}],[{key:"isPayloadValid",value:function(e,t){switch(e){case cs.CONNECT:return"object"===typeof t;case cs.DISCONNECT:return void 0===t;case cs.CONNECT_ERROR:return"string"===typeof t||"object"===typeof t;case cs.EVENT:case cs.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case cs.ACK:case cs.BINARY_ACK:return Array.isArray(t)}}}]),n}(go),ps=function(){function e(t){(0,g.Z)(this,e),this.packet=t,this.buffers=[],this.reconPack=t}return(0,y.Z)(e,[{key:"takeBinaryData",value:function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=os(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),e}();function hs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var fs=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),vs=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);
2function n(e,r,i){var a;return(0,g.Z)(this,n),(a=t.call(this)).connected=!1,a.recovered=!1,a.receiveBuffer=[],a.sendBuffer=[],a._queue=[],a._queueSeq=0,a.ids=0,a.acks={},a.flags={},a.io=e,a.nsp=r,i&&i.auth&&(a.auth=i.auth),a._opts=Object.assign({},i),a.io._autoConnect&&a.open(),a}return(0,y.Z)(n,[{key:"disconnected",get:function(){return!this.connected}},{key:"subEvents",value:function(){if(!this.subs){var e=this.io;this.subs=[hs(e,"open",this.onopen.bind(this)),hs(e,"packet",this.onpacket.bind(this)),hs(e,"error",this.onerror.bind(this)),hs(e,"close",this.onclose.bind(this))]}}},{key:"active",get:function(){return!!this.subs}},{key:"connect",value:function(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}},{key:"open",value:function(){return this.connect()}},{key:"send",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.unshift("message"),this.emit.apply(this,t),this}},{key:"emit",value:function(e){if(fs.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;var i={type:cs.EVENT,data:n,options:{}};if(i.options.compress=!1!==this.flags.compress,"function"===typeof n[n.length-1]){var a=this.ids++,o=n.pop();this._registerAckCallback(a,o),i.id=a}var s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}},{key:"_registerAckCallback",value:function(e,t){var n,r=this,i=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0!==i){var a=this.io.setTimeoutFn((function(){delete r.acks[e];for(var n=0;n<r.sendBuffer.length;n++)r.sendBuffer[n].id===e&&r.sendBuffer.splice(n,1);t.call(r,new Error("operation has timed out"))}),i);this.acks[e]=function(){r.io.clearTimeoutFn(a);for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];t.apply(r,[null].concat(n))}}else this.acks[e]=t}},{key:"emitWithAck",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise((function(n,i){r.push((function(e,t){return a?e?i(e):n(t):n(e)})),t.emit.apply(t,[e].concat(r))}))}},{key:"_addToQueue",value:function(e){var t,n=this;"function"===typeof e[e.length-1]&&(t=e.pop());var r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((function(e){if(r===n._queue[0]){if(null!==e)r.tryCount>n._opts.retries&&(n._queue.shift(),t&&t(e));else if(n._queue.shift(),t){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];t.apply(void 0,[null].concat(a))}return r.pending=!1,n._drainQueue()}})),this._queue.push(r),this._drainQueue()}},{key:"_drainQueue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.connected&&0!==this._queue.length){var t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}}},{key:"packet",value:function(e){e.nsp=this.nsp,this.io._packet(e)}},{key:"onopen",value:function(){var e=this;"function"==typeof this.auth?this.auth((function(t){e._sendConnectPacket(t)})):this._sendConnectPacket(this.auth)}},{key:"_sendConnectPacket",value:function(e){this.packet({type:cs.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}},{key:"onerror",value:function(e){this.connected||this.emitReserved("connect_error",e)}},{key:"onclose",value:function(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}},{key:"onpacket",value:function(e){if(e.nsp===this.nsp)switch(e.type){case cs.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case cs.EVENT:case cs.BINARY_EVENT:this.onevent(e);break;case cs.ACK:case cs.BINARY_ACK:this.onack(e);break;case cs.DISCONNECT:this.ondisconnect();break;case cs.CONNECT_ERROR:this.destroy();var t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}},{key:"onevent",value:function(e){var t=e.data||[];
2null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}},{key:"emitEvent",value:function(e){if(this._anyListeners&&this._anyListeners.length){var t,r=this._anyListeners.slice(),i=(0,c.Z)(r);try{for(i.s();!(t=i.n()).done;){t.value.apply(this,e)}}catch(xC){i.e(xC)}finally{i.f()}}l((0,u.Z)(n.prototype),"emit",this).apply(this,e),this._pid&&e.length&&"string"===typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}},{key:"ack",value:function(e){var t=this,n=!1;return function(){if(!n){n=!0;for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];t.packet({type:cs.ACK,id:e,data:i})}}}},{key:"onack",value:function(e){var t=this.acks[e.id];"function"===typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}},{key:"onconnect",value:function(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}},{key:"emitBuffered",value:function(){var e=this;this.receiveBuffer.forEach((function(t){return e.emitEvent(t)})),this.receiveBuffer=[],this.sendBuffer.forEach((function(t){e.notifyOutgoingListeners(t),e.packet(t)})),this.sendBuffer=[]}},{key:"ondisconnect",value:function(){this.destroy(),this.onclose("io server disconnect")}},{key:"destroy",value:function(){this.subs&&(this.subs.forEach((function(e){return e()})),this.subs=void 0),this.io._destroy(this)}},{key:"disconnect",value:function(){return this.connected&&this.packet({type:cs.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{key:"close",value:function(){return this.disconnect()}},{key:"compress",value:function(e){return this.flags.compress=e,this}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}},{key:"timeout",value:function(e){return this.flags.timeout=e,this}},{key:"onAny",value:function(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}},{key:"prependAny",value:function(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}},{key:"offAny",value:function(e){if(!this._anyListeners)return this;if(e){for(var t=this._anyListeners,n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}},{key:"listenersAny",value:function(){return this._anyListeners||[]}},{key:"onAnyOutgoing",value:function(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}},{key:"prependAnyOutgoing",value:function(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}},{key:"offAnyOutgoing",value:function(e){if(!this._anyOutgoingListeners)return this;if(e){for(var t=this._anyOutgoingListeners,n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}},{key:"listenersAnyOutgoing",value:function(){return this._anyOutgoingListeners||[]}},{key:"notifyOutgoingListeners",value:function(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){var t,n=this._anyOutgoingListeners.slice(),r=(0,c.Z)(n);try{for(r.s();!(t=r.n()).done;){t.value.apply(this,e.data)}}catch(xC){r.e(xC)}finally{r.f()}}}}]),n}(go);function ms(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ms.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},ms.prototype.reset=function(){this.attempts=0},ms.prototype.setMin=function(e){this.ms=e},ms.prototype.setMax=function(e){this.max=e},ms.prototype.setJitter=function(e){this.jitter=e};var gs=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,i){var a,o;(0,g.Z)(this,n),(a=t.call(this)).nsps={},a.subs=[],e&&"object"===typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",a.opts=i,wo((0,f.Z)(a),i),a.reconnection(!1!==i.reconnection),a.reconnectionAttempts(i.reconnectionAttempts||1/0),a.reconnectionDelay(i.reconnectionDelay||1e3),a.reconnectionDelayMax(i.reconnectionDelayMax||5e3),a.randomizationFactor(null!==(o=i.randomizationFactor)&&void 0!==o?o:.5),a.backoff=new ms({min:a.reconnectionDelay(),max:a.reconnectionDelayMax(),jitter:a.randomizationFactor()}),a.timeout(null==i.timeout?2e4:i.timeout),a._readyState="closed",a.uri=e;var s=i.parser||r;return a.encoder=new s.Encoder,a.decoder=new s.Decoder,a._autoConnect=!1!==i.autoConnect,a._autoConnect&&a.open(),a}return(0,y.Z)(n,[{key:"reconnection",value:function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}},{key:"reconnectionAttempts",value:function(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}},{key:"reconnectionDelay",value:function(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}},{key:"randomizationFactor",value:function(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}},{key:"reconnectionDelayMax",value:function(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}},{key:"timeout",value:function(e){return arguments.length?(this._timeout=e,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(e){var t=this;if(~this._readyState.indexOf("open"))return this;this.engine=new Ko(this.uri,this.opts);var n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;var i=hs(n,"open",(function(){r.onopen(),e&&e()})),a=hs(n,"error",(function(n){r.cleanup(),r._readyState="closed",t.emitReserved("error",n),e?e(n):r.maybeReconnectOnOpen()}));if(!1!==this._timeout){var o=this._timeout;0===o&&i();var s=this.setTimeoutFn((function(){i(),n.close(),n.emit("error",new Error("timeout"))}),o);this.opts.autoUnref&&s.unref(),this.subs.push((function(){clearTimeout(s)}))}return this.subs.push(i),this.subs.push(a),this}},{key:"connect",value:function(e){return this.open(e)}},{key:"onopen",value:function(){this.cleanup(),this._readyState="open",this.emitReserved("open");var e=this.engine;this.subs.push(hs(e,"ping",this.onping.bind(this)),hs(e,"data",this.ondata.bind(this)),hs(e,"error",this.onerror.bind(this)),hs(e,"close",this.onclose.bind(this)),hs(this.decoder,"decoded",this.ondecoded.bind(this)))}},{key:"onping",value:function(){this.emitReserved("ping")}},{key:"ondata",value:function(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}},{key:"ondecoded",value:function(e){var t=this;Fo((function(){t.emitReserved("packet",e)}),this.setTimeoutFn)}},{key:"onerror",value:function(e){this.emitReserved("error",e)}},{key:"socket",value:function(e,t){var n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new vs(this,e,t),this.nsps[e]=n),n}},{key:"_destroy",value:function(e){for(var t=0,n=Object.keys(this.nsps);t<n.length;t++){var r=n[t];if(this.nsps[r].active)return}this._close()}},{key:"_packet",value:function(e){for(var t=this.encoder.encode(e),n=0;n<t.length;
2n++)this.engine.write(t[n],e.options)}},{key:"cleanup",value:function(){this.subs.forEach((function(e){return e()})),this.subs.length=0,this.decoder.destroy()}},{key:"_close",value:function(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}},{key:"disconnect",value:function(){return this._close()}},{key:"onclose",value:function(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}},{key:"reconnect",value:function(){var e=this;if(this._reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var n=this.backoff.duration();this._reconnecting=!0;var r=this.setTimeoutFn((function(){t.skipReconnect||(e.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((function(n){n?(t._reconnecting=!1,t.reconnect(),e.emitReserved("reconnect_error",n)):t.onreconnect()})))}),n);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}},{key:"onreconnect",value:function(){var e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}]),n}(go),ys={};function bs(e,t){"object"===typeof e&&(t=e,e=void 0);var n,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=e;n=n||"undefined"!==typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"===typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e="undefined"!==typeof n?n.protocol+"//"+e:"https://"+e),r=$o(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),i=r.source,a=r.id,o=r.path,s=ys[a]&&o in ys[a].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||s?n=new gs(i,t):(ys[a]||(ys[a]=new gs(i,t)),n=ys[a]),r.query&&!t.query&&(t.query=r.queryKey),n.socket(r.path,t)}Object.assign(bs,{Manager:gs,Socket:vs,io:bs,connect:bs});var ks=n(2389),_s=function(e,t){var n=null;return function(){if(null!==n)return n;var r=new Blob([t],{type:"application/javascript; charset=utf-8"}),i=URL.createObjectURL(r);return n=e(i),setTimeout((function(){return URL.revokeObjectURL(i)})),n}}((function(e){var t=new Map([[0,function(){}]]),n=new Map([[0,function(){}]]),r=new Map,i=new Worker(e);i.addEventListener("message",(function(e){var i=e.data;if(function(e){return void 0!==e.method&&"call"===e.method}(i)){var a=i.params,o=a.timerId,s=a.timerType;if("interval"===s){var c=t.get(o);if("number"===typeof c){var u=r.get(c);if(void 0===u||u.timerId!==o||u.timerType!==s)throw new Error("The timer is in an undefined state.")}else{if("undefined"===typeof c)throw new Error("The timer is in an undefined state.");c()}}else if("timeout"===s){var l=n.get(o);if("number"===typeof l){var d=r.get(l);if(void 0===d||d.timerId!==o||d.timerType!==s)throw new Error("The timer is in an undefined state.")}else{if("undefined"===typeof l)throw new Error("The timer is in an undefined state.");l(),n.delete(o)}}}else{if(!function(e){return null===e.error&&"number"===typeof e.id}(i)){var p=i.error.message;throw new Error(p)}var h=i.id,f=r.get(h);if(void 0===f)throw new Error("The timer is in an undefined state.");var v=f.timerId,m=f.timerType;r.delete(h),"interval"===m?t.delete(v):n.delete(v)}}));return{clearInterval:function(e){var n=(0,ks.generateUniqueNumber)(r);r.set(n,{timerId:e,timerType:"interval"}),t.set(e,n),i.postMessage({id:n,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:function(e){var t=(0,ks.generateUniqueNumber)(r);r.set(t,{timerId:e,timerType:"timeout"}),n.set(e,t),i.postMessage({id:t,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:function(e,n){var r=(0,ks.generateUniqueNumber)(t);return t.set(r,(function(){e(),"function"===typeof t.get(r)&&i.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:r,timerType:"interval"}})}
2)),i.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:r,timerType:"interval"}}),r},setTimeout:function(e,t){var r=(0,ks.generateUniqueNumber)(n);return n.set(r,e),i.postMessage({id:null,method:"set",params:{delay:t,now:performance.now(),timerId:r,timerType:"timeout"}}),r}}}),'(()=>{"use strict";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:"call",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener("message",(i=>{let{data:s}=i;try{if("clear"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if("interval"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));(e=>{const r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if("set"!==s.method)throw new Error(\'The given method "\'.concat(s.method,\'" is not supported\'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if("interval"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,"interval"))})(i,a,n);else{if("timeout"!==d)throw new Error(\'The given type "\'.concat(d,\'" is not supported\'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,"timeout"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();'),ws=function(e){return _s().clearInterval(e)},xs=function(e,t){return _s().setInterval(e,t)};e=n.hmd(e);var Ss,Es,Ts,Ps=Object.defineProperty,Cs=function(e,t,n){return function(e,t,n){t in e?Ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!=typeof t?t+"":t,n),n},Rs=function(e,t,n){if(!t.has(e))throw TypeError("Cannot "+n)},Zs=function(e,t,n){return Rs(e,t,"read from private field"),n?n.call(e):t.get(e)},Ms=function(e,t,n){if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},As=function(e,t,n,r){return Rs(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n},Is=function(e,t,n){return Rs(e,t,"access private method"),n};(Es=Ss||(Ss={}))[Es.MAJOR_EVENT=0]="MAJOR_EVENT",Es[Es.MINOR_EVENT=1]="MINOR_EVENT",function(e){e.PRECALL_TEST_BEGIN="precall_begin",e.PRECALL_TEST_COMPLETE="precall_end",e.CALL_JOIN_BEGIN="call_join",e.NET_QUALITY_TEST_BEGIN="net_quality_test_begin",e.NET_QUALITY_TEST_END="net_quality_test_end",e.WEBSOCKET_CONNECTED="websocket_connected",e.TRANSPORT_CONNECTED="transport_connected",e.AUDIO_ON="audio_on",e.AUDIO_OFF="audio_off",e.VIDEO_ON="video_on",e.VIDEO_OFF="video_off",e.PARTICIPANT_ROLE="participant_role",e.PING_STAT="ping_stat",e.DISCONNECT="disconnect",e.RECONNECT_ATTEMPT="reconnect_attempt",e.SCREENSHARE_START_REQUESTED="screenshare_start_requested",e.SCREENSHARE_STARTED="screenshare_started",e.SCREENSHARE_STOPPED="screenshare_stopped",e.TAB_CHANGE="tab_change",e.BROWSER_BACKGROUNDED="browser_backgrounded",e.BROWSER_FOREGROUNDED="browser_foregrounded",e.DOMINANT_SPEAKER="dominant_speaker",e.AUDIO_DEVICES_UPDATES="audio_devices_updates",e.VIDEO_DEVICES_UPDATES="video_devices_updates",e.SPEAKER_DEVICES_UPDATES="speaker_devices_updates",e.SELECTED_MICROHPONE_UPDATE="selected_microphone_update",e.SELECTED_CAMERA_UPDATE="selected_camera_update",e.SELECTED_SPEAKER_UPDATE="selected_speaker_update",e.MEDIA_PERMISSION="camera_permission",e.LEGACY_SWITCH="legacy_switch",e.AUDIO_PLAY_FAILED="audio_play_failed",e.VIDEO_PLAY_FAILED="video_play_failed",e.AUDIO_TRACK_MUTED="audio_track_muted",e.VIDEO_TRACK_MUTED="video_track_muted",e.IVS_PLAYER_REBUFFERING="ivs_player_rebuffering",e.IVS_PLAYER_AUDIO_BLOCKED="ivs_player_audio_blocked",e.IVS_PLAYER_PLAYBACK_BLOCKED="ivs_player_playback_blocked",e.IVS_PLAYER_ERROR="ivs_player_error",e.IVS_PLAYER_RECOVERABLE_ERROR="ivs_player_recoverable_error",e.IVS_PLAYER_WORKER_ERROR="ivs_player_worker_error",e.IVS_PLAYER_NETWORK_UNAVAILABLE="ivs_player_network_unavailable",e.LIVESTREAM_LATENCY="livestream_latency",e.IVS_PLAYER_ANALYTICS_EVENT="ivs_player_analytics_event",e.IVS_PLAYER_PLAYBACK_RATE_CHANGED="ivs_player_playback_rate_changed",e.IVS_PLAYER_QUALITY_CHANGED="ivs_player_quality_changed",e.IVS_PLAYER_INITIALIZED="ivs_player_initialized"}(Ts||(Ts={}));var Os,Ls=new Map([[Ts.PRECALL_TEST_BEGIN,Ss.MINOR_EVENT],[Ts.PRECALL_TEST_COMPLETE,Ss.MINOR_EVENT],[Ts.CALL_JOIN_BEGIN,Ss.MAJOR_EVENT],[Ts.NET_QUALITY_TEST_BEGIN,Ss.MINOR_EVENT],[Ts.NET_QUALITY_TEST_END,Ss.MINOR_EVENT],[Ts.WEBSOCKET_CONNECTED,Ss.MINOR_EVENT],[Ts.TRANSPORT_CONNECTED,Ss.MAJOR_EVENT],[Ts.AUDIO_ON,Ss.MINOR_EVENT],[Ts.AUDIO_OFF,Ss.MINOR_EVENT],[Ts.VIDEO_ON,Ss.MINOR_EVENT],[Ts.VIDEO_OFF,Ss.MINOR_EVENT],[Ts.PARTICIPANT_ROLE,Ss.MINOR_EVENT],[Ts.PING_STAT,Ss.MAJOR_EVENT],[Ts.DISCONNECT,Ss.MAJOR_EVENT],[Ts.RECONNECT_ATTEMPT,Ss.MAJOR_EVENT],[Ts.SCREENSHARE_START_REQUESTED,Ss.MINOR_EVENT],[Ts.SCREENSHARE_STARTED,Ss.MINOR_EVENT],[Ts.SCREENSHARE_STOPPED,Ss.MINOR_EVENT],[Ts.TAB_CHANGE,Ss.MINOR_EVENT],[Ts.BROWSER_BACKGROUNDED,Ss.MINOR_EVENT],[Ts.BROWSER_FOREGROUNDED,Ss.MINOR_EVENT],[Ts.DOMINANT_SPEAKER,Ss.MINOR_EVENT],[Ts.AUDIO_DEVICES_UPDATES,Ss.MINOR_EVENT],[Ts.VIDEO_DEVICES_UPDATES,Ss.MINOR_EVENT],[Ts.SPEAKER_DEVICES_UPDATES,Ss.MINOR_EVENT],[Ts.SELECTED_MICROHPONE_UPDATE,Ss.MINOR_EVENT],[Ts.SELECTED_CAMERA_UPDATE,Ss.MINOR_EVENT],[Ts.SELECTED_SPEAKER_UPDATE,Ss.MINOR_EVENT],[Ts.MEDIA_PERMISSION,Ss.MINOR_EVENT],[Ts.LEGACY_SWITCH,Ss.MINOR_EVENT],[Ts.AUDIO_PLAY_FAILED,Ss.MINOR_EVENT],[Ts.VIDEO_PLAY_FAILED,Ss.MINOR_EVENT],[Ts.AUDIO_TRACK_MUTED,Ss.MINOR_EVENT],[Ts.VIDEO_TRACK_MUTED,Ss.MINOR_EVENT],[Ts.IVS_PLAYER_REBUFFERING,Ss.MAJOR_EVENT],[Ts.IVS_PLAYER_AUDIO_BLOCKED,Ss.MAJOR_EVENT],[Ts.IVS_PLAYER_PLAYBACK_BLOCKED,Ss.MAJOR_EVENT],[Ts.IVS_PLAYER_ERROR,Ss.MAJOR_EVENT],[Ts.IVS_PLAYER_RECOVERABLE_ERROR,Ss.MAJOR_EVENT],[Ts.IVS_PLAYER_WORKER_ERROR,Ss.MAJOR_EVENT],[Ts.IVS_PLAYER_NETWORK_UNAVAILABLE,Ss.MAJOR_EVENT],[Ts.LIVESTREAM_LATENCY,Ss.MAJOR_EVENT],[Ts.IVS_PLAYER_ANALYTICS_EVENT,Ss.MINOR_EVENT],[Ts.IVS_PLAYER_PLAYBACK_RATE_CHANGED,Ss.MINOR_EVENT],[Ts.IVS_PLAYER_QUALITY_CHANGED,Ss.MINOR_EVENT],[Ts.IVS_PLAYER_INITIALIZED,Ss.MINOR_EVENT]]),Ds="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:{},Ns={},js={get exports(){return Ns},set exports(e){Ns=e}},Bs="object"==typeof Reflect?Reflect:null,Us=Bs&&"function"==typeof Bs.apply?Bs.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};Os=Bs&&"function"==typeof Bs.ownKeys?Bs.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var Vs=Number.isNaN||function(e){return e!==e};function Fs(){Fs.init.call(this)}js.exports=Fs,Ns.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}nc(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&nc(e,"error",t,n)}(e,i,{once:!0})}))},Fs.EventEmitter=Fs,Fs.prototype._events=void 0,Fs.prototype._eventsCount=0,Fs.prototype._maxListeners=void 0;var zs,Hs,qs,Gs,Ws=10;function Js(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?Fs.defaultMaxListeners:e._maxListeners}function Ks(e,t,n,r){var i,a,o;if(Js(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=$s(e))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function Qs(){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)}
2function Ys(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=Qs.bind(r);return i.listener=n,r.wrapFn=i,i}function Xs(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):tc(i,i.length)}function ec(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 tc(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function nc(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(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(Fs,"defaultMaxListeners",{enumerable:!0,get:function(){return Ws},set:function(e){if("number"!=typeof e||e<0||Vs(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Ws=e}}),Fs.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},Fs.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||Vs(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},Fs.prototype.getMaxListeners=function(){return $s(this)},Fs.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)Us(s,this,t);else{var c=s.length,u=tc(s,c);for(n=0;n<c;++n)Us(u[n],this,t)}return!0},Fs.prototype.addListener=function(e,t){return Ks(this,e,t,!1)},Fs.prototype.on=Fs.prototype.addListener,Fs.prototype.prependListener=function(e,t){return Ks(this,e,t,!0)},Fs.prototype.once=function(e,t){return Js(t),this.on(e,Ys(this,e,t)),this},Fs.prototype.prependOnceListener=function(e,t){return Js(t),this.prependListener(e,Ys(this,e,t)),this},Fs.prototype.removeListener=function(e,t){var n,r,i,a,o;if(Js(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,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;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,o||t)}return this},Fs.prototype.off=Fs.prototype.removeListener,Fs.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,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[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},Fs.prototype.listeners=function(e){return Xs(this,e,!0)},Fs.prototype.rawListeners=function(e){return Xs(this,e,!1)},Fs.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):ec.call(e,t)},Fs.prototype.listenerCount=ec,Fs.prototype.eventNames=function(){return this._eventsCount>0?Os(this._events):[]},function(e){e.CHROMIUM="chromum",e.FIREFOX="firefox",e.SAFARI="safari"}(zs||(zs={})),function(e){e.DEV="dev",e.STAGING="staging",e.PRODUCTION="production"}(Hs||(Hs={})),function(e){e.AUDIO="AUDIO",e.VIDEO="VIDEO",e.SPEAKER="SPEAKER"}(qs||(qs={})),function(e){e[e.INIT=0]="INIT",e[e.ACCEPTED=1]="ACCEPTED",e[e.DENIED=2]="DENIED",e[e.SYS_DENIED=3]="SYS_DENIED",e[e.FAILED=4]="FAILED",e[e.NOTFOUND=5]="NOTFOUND",e[e.NOT_APPLICABLE=6]="NOT_APPLICABLE"}(Gs||(Gs={}));var rc=function(){function e(){(0,g.Z)(this,e),Cs(this,"currentChunk"),Cs(this,"flushedChunks"),this.currentChunk={entries:[]},this.flushedChunks=[]}return(0,y.Z)(e,[{key:"add",value:function(e){this.currentChunk.entries.push(e)}},{key:"flush",value:function(){var e=this.currentChunk;return this.currentChunk={entries:[]},this.flushedChunks.push(e),e}}]),e}(),ic=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.logger,a=e.peerId,o=e.env;return(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"logger"),Cs((0,f.Z)(r),"peerId"),Cs((0,f.Z)(r),"eventStore"),Cs((0,f.Z)(r),"apiEndpoint"),r.logger=i,r.peerId=a,o===Hs.PRODUCTION?r.apiEndpoint="https://collector.prod.da.dyte.
2io/api/v1/message":r.apiEndpoint="https://collector.non-prod.da.dyte.io/api/v1/message",r.eventStore=new rc,r}return(0,y.Z)(n,[{key:"sendEventsChunkToServer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={payload:t,peerId:this.peerId},e.prev=1,e.next=4,fetch(this.apiEndpoint,{method:"POST",body:JSON.stringify(n)});case 4:return e.abrupt("return",!0);case 7:return e.prev=7,e.t0=e.catch(1),e.abrupt("return",(this.logger.error("callStats::sendEventsChunkToServer::catch",{error:e.t0}),!1));case 10:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"callEvent",value:function(e){e.timestamp=new Date,this.eventStore.add(e),this.emit(e.event,e.metaData),Ls.get(e.event)===Ss.MAJOR_EVENT&&this.flush()}},{key:"flush",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.eventStore.flush(),null==(t=null==n?void 0:n.entries)||!t.length){e.next=7;break}return e.next=4,this.sendEventsChunkToServer(n);case 4:e.t0=!0,e.next=8;break;case 7:e.t0=!1;case 8:return e.abrupt("return",e.t0);case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(Ns),ac=function(){function e(t){(0,g.Z)(this,e),Cs(this,"pc1"),Cs(this,"pc2"),Cs(this,"constrainVideoBitrateKbps"),Cs(this,"constrainOfferToRemoveVideoFec",!1),Cs(this,"iceCandidateFilter");var n=new RTCPeerConnection(t),r=new RTCPeerConnection(t);this.pc1=n,this.pc2=r,this.iceCandidateFilter=e.noFilter,this.pc1.addEventListener("icecandidate",this.onIceCandidate.bind(this,this.pc2)),this.pc2.addEventListener("icecandidate",this.onIceCandidate.bind(this,this.pc1))}return(0,y.Z)(e,[{key:"onIceCandidate",value:function(t,n){if(n.candidate){var r=e.parseCandidate(n.candidate.candidate);this.iceCandidateFilter(r)&&t.addIceCandidate(n.candidate)}}},{key:"setIceCandidateFilter",value:function(e){this.iceCandidateFilter=e}},{key:"constrainVideoBitrate",value:function(e){this.constrainVideoBitrateKbps=e}},{key:"disableVideoFec",value:function(){this.constrainOfferToRemoveVideoFec=!0}},{key:"gotOffer",value:function(e){this.constrainOfferToRemoveVideoFec&&(e.sdp=e.sdp.replace(/(m=video 1 [^\r]+)(116 117)(\r\n)/g,"$1\r\n"),e.sdp=e.sdp.replace(/a=rtpmap:116 red\/90000\r\n/g,""),e.sdp=e.sdp.replace(/a=rtpmap:117 ulpfec\/90000\r\n/g,""),e.sdp=e.sdp.replace(/a=rtpmap:98 rtx\/90000\r\n/g,""),e.sdp=e.sdp.replace(/a=fmtp:98 apt=116\r\n/g,"")),this.pc1.setLocalDescription(e),this.pc2.setRemoteDescription(e),this.pc2.createAnswer().then(this.gotAnswer.bind(this),this.reportFatal.bind(this))}},{key:"gotAnswer",value:function(e){this.constrainVideoBitrateKbps&&(e.sdp=e.sdp.replace(/a=mid:video\r\n/g,"a=mid:video\r\nb=AS:".concat(this.constrainVideoBitrateKbps,"\r\n"))),this.pc2.setLocalDescription(e),this.pc1.setRemoteDescription(e)}},{key:"establishConnection",value:function(){this.pc1.createOffer().then(this.gotOffer.bind(this),this.reportFatal.bind(this))}},{key:"reportFatal",value:function(e){console.error("Error:",e)}},{key:"getRoundTripTime",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.pc1.getStats(),this.pc2.getStats()]);case 2:if(t=e.sent,n=(0,d.Z)(t,2),r=n[0],i=n[1],r.forEach((function(e){"candidate-pair"===e.type&&!0===e.nominated&&e.bytesSent>0&&(a=e)})),i.forEach((function(e){"candidate-pair"===e.type&&!0===e.nominated&&e.bytesReceived>0&&(o=e)})),!a||!o){e.next=17;break}if(e.prev=7,!a.currentRoundTripTime||!o.currentRoundTripTime){e.next=10;break}return e.abrupt("return",{rtt:a.currentRoundTripTime,backendRTT:o.currentRoundTripTime});case 10:return s=(o.lastPacketReceivedTimestamp-a.lastPacketSentTimestamp)/1e3,e.abrupt("return",{rtt:s,backendRTT:s});case 14:return e.prev=14,e.t0=e.catch(7),e.abrupt("return");case 17:case"end":return e.stop()}}),e,this,[[7,14]])})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){this.pc1.close(),this.pc2.close()}}],[{key:"parseCandidate",value:function(e){var t="candidate:",n=e.indexOf(t)+10,r=e.substr(n).split(" ");return{type:r[7],protocol:r[2],address:r[4]}}},{key:"isNotHostCandidate",value:function(e){return"host"!==e.type}},{key:"isHost",value:function(e){return"host"===e.type}},{key:"isRelay",value:function(e){return"relay"===e.type}},{key:"isReflexive",value:function(e){return"srflx"===e.type}},{key:"noFilter",value:function(e){return!0}}]),e}(),oc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"call"),Cs((0,f.Z)(r),"timeOut"),r.call=new ac(e),r}return(0,y.Z)(n,[{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;this.call.establishConnection(),this.timeOut=setTimeout(this.testFailed.bind(this),e)}},{key:"testComplete",value:function(e){clearTimeout(this.timeOut),this.call.close(),this.emit
2("done",e)}},{key:"testFailed",value:function(e){console.warn("Test failed, ",e),this.call.close(),this.emit("failed",e)}}]),n}(Ns),sc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;(0,g.Z)(this,n),r=t.call(this,e),Cs((0,f.Z)(r),"senderChannel"),Cs((0,f.Z)(r),"recieveChannel"),Cs((0,f.Z)(r),"startTime"),Cs((0,f.Z)(r),"lastBitrateMeasureTime"),Cs((0,f.Z)(r),"sentPayloadBytes",0),Cs((0,f.Z)(r),"recievedPayloadBytes",0),Cs((0,f.Z)(r),"lastReceivedPayloadBytes",0),Cs((0,f.Z)(r),"stopSending",!1),Cs((0,f.Z)(r),"testProgress",0),Cs((0,f.Z)(r),"samplePacket",""),Cs((0,f.Z)(r),"finalBitrateSum",0),Cs((0,f.Z)(r),"bitRateSampels",0),Cs((0,f.Z)(r),"maxNumberOfPacketsToSend",0),Cs((0,f.Z)(r),"bytesToKeepBuffered",0),Cs((0,f.Z)(r),"testDurationSeconds",5),r.call.setIceCandidateFilter(ac.isNotHostCandidate),r.senderChannel=r.call.pc1.createDataChannel(null);for(var i=0;i<262144;i+=1)r.samplePacket+="h";return r.maxNumberOfPacketsToSend=1,r.bytesToKeepBuffered=1024*r.maxNumberOfPacketsToSend,r.testDurationSeconds=4,r.senderChannel.addEventListener("open",r.sendingStep.bind((0,f.Z)(r))),r.call.pc2.addEventListener("datachannel",r.onRecieverChannel.bind((0,f.Z)(r))),r}return(0,y.Z)(n,[{key:"sendingStep",value:function(){var e=new Date;this.startTime||(this.startTime=e,this.lastBitrateMeasureTime=e);for(var t=0;t!==this.maxNumberOfPacketsToSend&&!(this.senderChannel.bufferedAmount>=this.bytesToKeepBuffered);t+=1){this.sentPayloadBytes+=this.samplePacket.length;try{this.senderChannel.send(this.samplePacket)}catch(r){}}var n=e.getTime()-this.startTime.getTime();n>=1e3*this.testDurationSeconds?(this.stopSending=!0,this.testProgress=100):(this.testProgress=n/(10*this.testDurationSeconds),setTimeout(this.sendingStep.bind(this),1))}},{key:"onMessageRecieved",value:function(e){this.recievedPayloadBytes+=e.data.length;var t=new Date,n=t.getTime()-this.lastBitrateMeasureTime.getTime();if(n>=1e3){var r=8*(this.recievedPayloadBytes-this.lastReceivedPayloadBytes)/(n/1e3);this.finalBitrateSum+=r,this.bitRateSampels+=1,this.lastReceivedPayloadBytes=this.recievedPayloadBytes,this.lastBitrateMeasureTime=t}if(this.stopSending&&this.sentPayloadBytes===this.recievedPayloadBytes){var i=this.finalBitrateSum/this.bitRateSampels;this.testComplete({throughput:Math.round(.001*i)})}}},{key:"testComplete",value:function(e){var t=this;this.call.getRoundTripTime().then((function(r){var i=r.rtt,a=r.backendRTT;return l((0,u.Z)(n.prototype),"testComplete",t).call(t,{RTT:i,backendRTT:a,throughput:e.throughput})}))}},{key:"onRecieverChannel",value:function(e){this.recieveChannel=e.channel,this.recieveChannel.addEventListener("message",this.onMessageRecieved.bind(this))}}]),n}(oc),cc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ac.noFilter;(0,g.Z)(this,n),r=t.call(this,e),Cs((0,f.Z)(r),"ch1"),Cs((0,f.Z)(r),"ch2"),r.call.setIceCandidateFilter(i);var a=r.call.pc1.createDataChannel(null);return r.ch1=a,a.addEventListener("open",(function(){a.send("hello")})),a.addEventListener("message",r.onCh1Recieve.bind((0,f.Z)(r))),r.call.pc2.addEventListener("datachannel",r.dataChannelHandler.bind((0,f.Z)(r))),r}return(0,y.Z)(n,[{key:"onCh1Recieve",value:function(e){"world"!==e.data?this.hangup("Invalid data transmitted."):this.testComplete({connectivity:!0})}},{key:"onCh2Recieve",value:function(e){if("hello"!==e.data)this.hangup("Invalid data transmitted.");else try{this.ch2.send("world")}catch(t){}}},{key:"dataChannelHandler",value:function(e){var t=e.channel;this.ch2=t,t.addEventListener("message",this.onCh2Recieve.bind(this))}},{key:"hangup",value:function(e){this.testFailed(e)}}]),n}(oc),uc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e,ac.isHost)}return(0,y.Z)(n)}(cc),lc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e,ac.isRelay)}return(0,y.Z)(n)}(cc),dc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){return(0,g.Z)(this,n),t.call(this,e,ac.isReflexive)}return(0,y.Z)(n)}(cc),pc=function(){function e(){(0,g.Z)(this,e),Cs(this,"ipInformation",null)}return(0,y.Z)(e,[{key:"getIPDetails",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.peerId,this.ipInformation){e.next=21;break}return e.prev=2,e.next=5,fetch("https://media-location.dyte.io");case 5:return e.next=7,e.sent.json();case 7:if(i=e.sent,!((null==(r=i.loc)?void 0:r.length)>5)){e.next=10;break}return e.abrupt("return",(this.ipInformation=i,i));case 10:throw Error("Insufficient data");case 13:e.prev=13,e.t0=e.catch(2);case 15:return e.next=17,fetch("https://location-service.dyte.io/?token=3c493932b0624c&peerId=".concat(n),{method:"POST"});case 17:return a=e.sent,e.next=20,a.json();case 20:this.ipInformation=e.sent;case 21:return e.abrupt("return",this.ipInformation);case 22:case"end":return e.stop()}}),e,this,[[2,13]])})));return function(t){return e.apply(this,arguments)}}()}]),e}(),hc=new pc,fc=[{urls:"turn:turn.dyte.in:443?transport=tcp",username:"dyte",credential:"dytein",credentialType:"password"},{urls:"turn:turn.dyte.in:3478?transport=udp",username:"dyte",credential:"dytein",credentialType:"password"}];function vc(e){var t=e.split(","),n=(0,d.Z)(t,2),r=n[0],i=n[1];return{coords:{latitude:Number(r),longitude:Number(i)}}}var mc=(0,y.Z)((function e(){(0,g.Z)(this,e),Cs(this,"transport"),Cs(this,"candidatePair"),Cs(this,"outboundVideoRtp",new Map),Cs(this,"inboundVideoRtp",new Map),Cs(this,"outboundAudioRtp",new Map),Cs(this,"inboundAudioRtp",new Map),Cs(this,"remoteInboundRtp",new Map),Cs(this,"producerStreamMap",new Map),Cs(this,"consumerStreamMap",new Map),Cs(this,"staleProducerStreamMap",!1),Cs(this,"staleConsumerStreamMap",!1)})),gc=function(){function e(){(0,g.Z)(this,e),Cs(this,"outboundProducerMap",new Map),Cs(this,"inboundConsumerMap",new Map),Cs(this,"consumerPeerIdMap",new Map),Cs(this,"overallProducingTransportsStatsMap",{}),Cs(this,"overallConsumingTransportsStatsMap",{}),Cs(this,"overallConsumersStatsMap",{}),Cs(this,"overallProducersStatsMap",{}),Cs(this,"consumerIdsWithFreezedVideo",new Set),Cs(this,"consumerIdsWithFreezedAudio",new Set),Cs(this,"producerIdsWithFreezedVideo",new Set),Cs(this,"producerIdsWithFreezedAudio",new Set),Cs(this,"freezedProducingTransportIds",new Set),Cs(this,"freezedConsumingTransportIds",new Set),Cs(this,"ipDetails"),Cs(this,"callStatsInstance")}return(0,y.Z)(e,[{key:"registerProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.generateProducerStreamMap(t);case 2:t.observer.on("close",this.deregisterProducer.bind(this,t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"processInboundConsumerVideoStats",value:function(e,t,n){var r,i,a=(null==(i=null==(r=null==this?void 0:this.callStatsInstance)?void 0:r.consumerSharedMediaStatesMap)?void 0:i.get(e))||{};t.totalVideoPacketsReceived===n.packetsReceived?(this.consumerIdsWithFreezedVideo.add(e),this.callStatsInstance&&a.video&&(this.callStatsInstance.logger.debug("callstats::measurements::consumerVideoFreezed",{consumerId:e}),this.callStatsInstance.eventHandler.emit("consumer_video_status","pause",e))):(t.totalVideoPacketsReceived=n.packetsReceived,this.consumerIdsWithFreezedVideo.has(e)&&(this.consumerIdsWithFreezedVideo.delete(e),this.callStatsInstance&&a.video&&(this.callStatsInstance.logger.debug("callstats::measurements::consumerVideoDefreezed",{consumerId:e}),this.callStatsInstance.eventHandler.emit("consumer_video_status","resume",e))))}},{key:"processInboundConsumerAudioStats",value:function(e,t,n){var r,i,a=(null==(i=null==(r=null==this?void 0:this.callStatsInstance)?void 0:r.consumerSharedMediaStatesMap)?void 0:i.get(e))||{};t.totalAudioPacketsReceived===n.packetsReceived?(this.consumerIdsWithFreezedAudio.add(e),this.callStatsInstance&&a.audio&&(this.callStatsInstance.logger.debug("callStats::measurements::consumerAudioFreezed",{consumerId:e}),this.callStatsInstance.eventHandler.emit("consumer_audio_status","pause",e))):(t.totalAudioPacketsReceived=n.packetsReceived,this.consumerIdsWithFreezedAudio.has(e)&&(this.consumerIdsWithFreezedAudio.delete(e),this.callStatsInstance&&a.audio&&(this.callStatsInstance.logger.debug("callStats::measurements::consumerAudioDefreezed",{consumerId:e}),this.callStatsInstance.eventHandler.emit("consumer_audio_status","resume",e))))}},{key:"processOutboundProducerVideoStats",value:function(e,t,n){var r,i=(null==(r=null==this?void 0:this.callStatsInstance)?void 0:r.currentUserMediaStates)||{};t.totalVideoPacketsSent===n.packetsSent?(this.producerIdsWithFreezedVideo.add(e),this.callStatsInstance&&i.video&&(this.callStatsInstance.logger.debug("callStats::measurements::producerVideoFreezed",{producerId:e}),this.callStatsInstance.eventHandler.emit("producer_video_status","pause",e))):(t.totalVideoPacketsSent=n.packetsSent,this.producerIdsWithFreezedVideo.has(e)&&(this.producerIdsWithFreezedVideo.delete(e),this.callStatsInstance&&i.video&&(this.callStatsInstance.logger.debug("callStats::measurements::producerVideoDefreezed",{producerId:e}),this.callStatsInstance.eventHandler.emit("producer_video_status","resume",e))))}},{key:"processOutboundProducerAudioStats",value:function(e,t,n){var r,i=(null==(r=null==this?void 0:this.callStatsInstance)?void 0:r.currentUserMediaStates)||{};t.totalAudioPacketsSent===n.packetsSent?(this.producerIdsWithFreezedAudio.add(e),this.callStatsInstance&&i.audio&&(this.callStatsInstance.logger.debug("callStats::measurements::producerAudioFreezed",{producerId:e}),this.callStatsInstance.eventHandler.emit("producer_audio_status","pause",e))):(t.totalAudioPacketsSent=n.packetsSent,this.producerIdsWithFreezedAudio.has(e)&&(this.producerIdsWithFreezedAudio.delete(e),this.callStatsInstance&&i.audio&&(this.callStatsInstance.logger.debug("callStats::measurements::producerAudioDefreezed",{producerId:e}),this.callStatsInstance.eventHandler.emit("producer_audio_status","resume",e))))}},{key:"processProducingTransportStats",value:function(e,t,n){var r,i=(null==(r=null==this?void 0:this.callStatsInstance)?void 0:r.currentUserMediaStates)||{},a=i.audio,o=i.video,s=i.screen,c=a||o||s;t.totalPacketsSent===n.packetsSent?(this.freezedProducingTransportIds.add(e),this.callStatsInstance&&c&&(this.callStatsInstance.logger.debug("callStats::measurements::producingTransportFreezed",{transportId:e}),this.callStatsInstance.eventHandler.emit("producing_transport_status","pause",e))):(t.totalPacketsSent=n.packetsSent,this.freezedProducingTransportIds.has(e)&&(this.freezedProducingTransportIds.delete(e),this.callStatsInstance&&c&&(this.callStatsInstance.logger.debug("callStats::measurements::producingTransportDefreezed",{transportId:e}),this.callStatsInstance.eventHandler.emit("producing_transport_status","resume",e))))}},{key:"processConsumingTransportStats",value:function(e,t,n){var r,i,a=!!Array.from((null==(i=null==(r=null==this?void 0:this.callStatsInstance)?void 0:r.consumerSharedMediaStatesMap)?void 0:i.values())||[]).reduce((function(e,t){return e||t.audio||t.video||t.screen}),!1);t.totalPacketsReceived===n.packetsSent?(this.freezedConsumingTransportIds.add(e),this.callStatsInstance&&a&&(this.callStatsInstance.logger.debug("callStats::measurements::consumingTransportFreezed",{transportId:e}),this.callStatsInstance.eventHandler.emit("consuming_transport_status","pause",e))):(t.totalPacketsReceived=n.packetsSent,this.freezedConsumingTransportIds.has(e)&&(this.freezedConsumingTransportIds.delete(e),this.callStatsInstance&&a&&(this.callStatsInstance.logger.debug("callStats::measurements::consumingTransportDefreezed",{transportId:e}),this.callStatsInstance.eventHandler.emit("consuming_transport_status","resume",e))))}},{key:"registerConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.generateConsumerStreamMap(t);case 2:this.consumerPeerIdMap.set(t.id,{producerId:t.producerId,peerId:t.appData.peerId}),t.observer.on("close",this.deregisterConsumer.bind(this,t));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"generateProducerStreamMap",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]&&u[1],e.next=3,t.getStats();case 3:r=e.sent,i=n?this.getProducerStatsFromReport(this.parseRTCReport(r,["outbound-rtp","remote-inbound-rtp"],!1,t.id))[0]:void 0,a=(0,c.Z)(r.values()),e.prev=6,a.s();case 8:if((o=a.n()).done){e.next=17;break}s=o.value,e.t0=s.type,e.next="outbound-rtp"===e.t0?13:15;break;case 13:return this.outboundProducerMap.set(s.id,t.id),e.abrupt("break",15);case 15:e.next=8;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(6),a.e(e.t1);case 22:return e.prev=22,a.f(),e.finish(22);case 25:return e.abrupt("return",i);case 26:case"end":return e.stop()}}),e,this,[[6,19,22,25]])})));return function(t){return e.apply(this,arguments)}}()},{key:"generateConsumerStreamMap",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]&&u[1],e.next=3,t.getStats();case 3:r=e.sent,i=n?this.getConsumerStatsFromReport(this.parseRTCReport(r,["inbou
2nd-rtp"],!1,t.id))[0]:void 0,a=(0,c.Z)(r.values()),e.prev=6,a.s();case 8:if((o=a.n()).done){e.next=17;break}s=o.value,e.t0=s.type,e.next="inbound-rtp"===e.t0?13:15;break;case 13:return this.inboundConsumerMap.set(s.id,t.id),e.abrupt("break",15);case 15:e.next=8;break;case 17:e.next=22;break;case 19:e.prev=19,e.t1=e.catch(6),a.e(e.t1);case 22:return e.prev=22,a.f(),e.finish(22);case 25:return e.abrupt("return",i);case 26:case"end":return e.stop()}}),e,this,[[6,19,22,25]])})));return function(t){return e.apply(this,arguments)}}()},{key:"deregisterProducer",value:function(e){var t=this;this.outboundProducerMap.forEach((function(n,r){n===e.id&&t.outboundProducerMap.delete(r)}))}},{key:"deregisterConsumer",value:function(e){var t=this;this.inboundConsumerMap.forEach((function(n,r){n===e.id&&t.inboundConsumerMap.delete(r)})),this.consumerPeerIdMap.delete(e.id)}},{key:"parseRTCReport",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,o=e,u=new mc,l=n.length?new Set(n):void 0,d=(0,c.Z)(o.values());try{for(d.s();!(t=d.n()).done;){var p=t.value;if(l){if(0===l.size)break;if(!l.has(p.type))continue;r&&l.delete(p.type)}switch(p.type){case"candidate-pair":if(!0===p.nominated||!0===p.selected){var h=p,f={bytesReceived:h.bytesReceived,bytesSent:h.bytesSent,currentRoundTripTime:h.currentRoundTripTime,totalRoundTripTime:h.totalRoundTripTime,availableOutgoingBitrate:h.availableOutgoingBitrate};u.candidatePair=f;break}break;case"transport":var v=p;a&&(a.producing&&(this.overallProducingTransportsStatsMap[a.id]||(this.overallProducingTransportsStatsMap[a.id]={totalPacketsSent:0})),a.consuming&&(this.overallConsumingTransportsStatsMap[a.id]||(this.overallConsumingTransportsStatsMap[a.id]={totalPacketsReceived:0})));var m={bytesReceived:v.bytesReceived,bytesSent:v.bytesSent,packetsSent:v.packetsSent,packetsReceived:v.packetsReceived,dtlsCipher:v.dtlsCipher,dtlsState:v.dtlsState,iceRole:v.iceRole};if(u.transport=m,a){if(a.producing){var g=this.overallProducingTransportsStatsMap[a.id];this.processProducingTransportStats(a.id,g,m)}if(a.consuming){var y=this.overallConsumingTransportsStatsMap[a.id];this.processConsumingTransportStats(a.id,y,m)}}break;case"remote-inbound-rtp":var b=p,k={jitter:b.jitter,fractionLost:b.fractionLost,roundTripTime:b.roundTripTime,roundTripTimeMeasurements:b.roundTripTimeMeasurements,totalRoundTripTime:b.totalRoundTripTime,packetsLost:b.packetsLost};u.remoteInboundRtp.set(b.localId,k);break;case"outbound-rtp":var _=p,w=i||this.outboundProducerMap.get(p.id);this.overallProducersStatsMap[w]||(this.overallProducersStatsMap[w]={totalVideoPacketsSent:0,totalAudioPacketsSent:0});var x=this.overallProducersStatsMap[w];if(["video","audio"].includes(_.mediaType)){if(!this.outboundProducerMap.has(p.id)){u.staleProducerStreamMap=!0,l&&l.delete("outbound-rtp");break}u.producerStreamMap.has(w)||u.producerStreamMap.set(w,{outboundVideoRtpId:[],outboundAudioRtpId:[]});var S={bytesSent:_.bytesSent,packetsSent:_.packetsSent,nackCount:_.nackCount};if("video"===_.mediaType){if("unknown"===_.decoderImplementation)break;var E=_,T=(0,s.Z)({frameHeight:E.frameHeight,frameWidth:E.frameWidth,framesEncoded:E.framesEncoded,framesDropped:E.framesDropped,framesPerSecond:E.framesPerSecond,framesSent:E.framesSent,keyFramesEncoded:E.keyFramesEncoded,firCount:E.firCount,encoderImplementation:E.encoderImplementation,hugeFramesSent:E.hugeFramesSent,pliCount:E.pliCount,qpSum:E.qpSum,qualityLimitationDurations:E.qualityLimitationDurations,qualityLimitationReason:E.qualityLimitationReason,qualityLimitationResolutionChanges:E.qualityLimitationResolutionChanges,totalEncodeTime:E.targetBitrate,totalPacketSendDelay:E.totalPacketSendDelay,retransmittedBytesSent:E.retransmittedBytesSent,retransmittedPacketsSent:E.retransmittedPacketsSent},S);u.outboundVideoRtp.set(p.id,T),u.producerStreamMap.get(w).outboundVideoRtpId.push(p.id),this.processOutboundProducerVideoStats(w,x,T)}else if("audio"===_.mediaType){var P=_,C=(0,s.Z)({retransmittedBytesSent:P.retransmittedBytesSent,retransmittedPacketsSent:P.retransmittedPacketsSent},S);u.outboundAudioRtp.set(p.id,C),u.producerStreamMap.get(w).outboundAudioRtpId.push(p.id),this.processOutboundProducerAudioStats(w,x,C)}}break;
2case"inbound-rtp":var R=p,Z=i||this.inboundConsumerMap.get(p.id);if(1234===R.ssrc)break;this.overallConsumersStatsMap[Z]||(this.overallConsumersStatsMap[Z]={totalVideoPacketsReceived:0,totalAudioPacketsReceived:0});var M=this.overallConsumersStatsMap[Z];if(["video","audio"].includes(R.mediaType)){if(!this.inboundConsumerMap.has(p.id)){u.staleConsumerStreamMap=!0,l&&l.delete("inbound-rtp");break}u.consumerStreamMap.has(Z)||u.consumerStreamMap.set(Z,{inboundVideoRtpId:[],inboundAudioRtpId:[]});var A={bytesReceived:R.bytesReceived,packetsReceived:R.packetsReceived,packetsLost:R.packetsLost,jitter:R.jitter,nackCount:R.nackCount};if("video"===R.mediaType){if("unknown"===R.decoderImplementation)break;var I=R,O=(0,s.Z)({frameHeight:I.frameHeight,frameWidth:I.frameWidth,framesDecoded:I.framesDecoded,framesDropped:I.framesDropped,framesPerSecond:I.framesPerSecond,framesReceived:I.framesReceived,keyFramesDecoded:I.keyFramesDecoded,firCount:I.firCount,decoderImplementation:I.decoderImplementation},A);u.inboundVideoRtp.set(p.id,O),u.consumerStreamMap.get(Z).inboundVideoRtpId.push(p.id),this.processInboundConsumerVideoStats(Z,M,O)}else if("audio"===R.mediaType){var L=R,D=(0,s.Z)({audioLevel:L.audioLevel,concealedSampels:L.concealedSampels,concealmentEvents:L.concealmentEvents,jitterBufferDelay:L.jitterBufferDelay,jitterBufferEmittedCount:L.jitterBufferEmittedCount,totalAudioEnergy:L.totalAudioEnergy,totalSamplesDuration:L.totalSamplesDuration,totalSamplesReceived:L.totalSamplesReceived},A);u.inboundAudioRtp.set(p.id,D),u.consumerStreamMap.get(Z).inboundAudioRtpId.push(p.id),this.processInboundConsumerAudioStats(Z,M,D)}}}}}catch(xC){d.e(xC)}finally{d.f()}if(u.outboundVideoRtp.forEach((function(e,t){e.remoteData=u.remoteInboundRtp.get(t)})),u.outboundAudioRtp.forEach((function(e,t){e.remoteData=u.remoteInboundRtp.get(t)})),u.candidatePair&&(u.transport?(u.transport.totalRoundTripTime=u.candidatePair.totalRoundTripTime,u.transport.availableOutgoingBitrate=u.candidatePair.availableOutgoingBitrate,u.transport.roundTripTime=u.candidatePair.currentRoundTripTime):u.transport={bytesReceived:u.candidatePair.bytesReceived,bytesSent:u.candidatePair.bytesSent,totalRoundTripTime:u.candidatePair.totalRoundTripTime,availableOutgoingBitrate:u.candidatePair.availableOutgoingBitrate,roundTripTime:u.candidatePair.currentRoundTripTime}),u.transport&&!u.transport.roundTripTime){var N=0,j=0;u.remoteInboundRtp.forEach((function(e,t){e.roundTripTime&&e.roundTripTime>N&&(N=e.roundTripTime,j=e.totalRoundTripTime)})),u.transport.roundTripTime=N,u.transport.totalRoundTripTime=j}return u}},{key:"getProducersReport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.map((function(e){return r.generateProducerStreamMap(e,!0)})),e.abrupt("return",n.length>0?Promise.all(n):void 0);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConsumersReport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.map((function(e){return r.generateConsumerStreamMap(e,!0)})),e.abrupt("return",n.length>0?Promise.all(n):void 0);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransportReport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.getStats());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getProcessedStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,a,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getTransportReport(t);case 2:if(i=e.sent,a={producing:r,consuming:n,id:t.id},o=i,s=this.parseRTCReport(o,["transport","candidate-pair","inbound-rtp","outbound-rtp","remote-inbound-rtp"],!1,void 0,a)){e.next=8;break}return e.abrupt("return");case 8:return c={stats:s.transport,transportId:t.id,consuming:n,producing:r},u=s.staleProducerStreamMap?void 0:this.getProducerStatsFromReport(s),l=s.staleConsumerStreamMap?void 0:this.getConsumerStatsFromReport(s),e.abrupt("return",{transportReport:c,producerReport:u,consumerReport:l});case 10:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"getProducerStatsFromReport",value:function(e){var t=this,n=[];
2try{e.producerStreamMap.forEach((function(r,i){var a,o;n.push({producerId:i,videoStats:r.outboundVideoRtpId.map((function(t){return e.outboundVideoRtp.get(t)})),audioStats:r.outboundAudioRtpId.map((function(t){return e.outboundAudioRtp.get(t)})),appData:(null==(o=null==(a=t.callStatsInstance.producers)?void 0:a.get(i))?void 0:o.appData)||null})}))}catch(r){this.callStatsInstance.logger.error("callStats::measurements::getProducerStatsFromReport",{error:{reason:r.reason,message:r.message}})}return n}},{key:"getConsumerStatsFromReport",value:function(e){var t=this,n=[];try{e.consumerStreamMap.forEach((function(r,i){var a=t.consumerPeerIdMap.get(i),o=a.peerId,s=a.producerId;n.push({consumerId:i,peerId:o,producerId:s,videoStats:r.inboundVideoRtpId.map((function(t){return e.inboundVideoRtp.get(t)})),audioStats:r.inboundAudioRtpId.map((function(t){return e.inboundAudioRtp.get(t)}))})}))}catch(r){console.error("getConsumersReport: ",r,e)}return n}},{key:"getUserLocation",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){try{navigator.geolocation?navigator.geolocation.getCurrentPosition((function(t){e(t)})):t()}catch(E){t(E)}})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"getConnectivity",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n={iceServers:t||fc},r=new Promise((function(e,t){try{var r=new uc(n);r.addListener("done",e),r.addListener("failed",(function(){e({connectivity:!1})})),r.start(2e3)}catch(r){t(r)}})),i=new Promise((function(e,t){try{var r=new lc(n);r.addListener("done",e),r.addListener("failed",(function(){e({connectivity:!1})})),r.start(2e3)}catch(r){t(r)}})),a=new Promise((function(e,t){try{var r=new dc(n);r.addListener("done",e),r.addListener("failed",(function(){e({connectivity:!1})})),r.start(2e3)}catch(r){t(r)}})),e.next=7,Promise.all([r,i,a]);case 7:return o=e.sent,s=(0,d.Z)(o,3),c=s[0],u=s[1],l=s[2],e.abrupt("return",{host:null==c?void 0:c.connectivity,relay:null==u?void 0:u.connectivity,reflexive:null==l?void 0:l.connectivity});case 15:return e.prev=15,e.t0=e.catch(0),e.abrupt("return",{host:!1,relay:!1,reflexive:!1});case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getThroughput",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,new Promise((function(e,n){try{var r,i=new sc({iceServers:t||fc});i.addListener("done",e),i.addListener("failed",n),i.start(1e4)}catch(r){n(r)}}));case 3:return n=e.sent,e.abrupt("return",{throughput:n.throughput,fractionalLoss:0,RTT:n.RTT,jitter:0,backendRTT:n.backendRTT});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getIPDetails",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=this.ipDetails,e.t0){e.next=6;break}return e.next=5,hc.getIPDetails({peerId:null==(t=this.callStatsInstance)?void 0:t.peerId});case 5:this.ipDetails=e.sent;case 6:return e.abrupt("return",this.ipDetails);case 9:return e.prev=9,e.t1=e.catch(0),e.abrupt("return");case 12:case"end":return e.stop()}}),e,this,[[0,9]])})));return function(){return e.apply(this,arguments)}}()},{key:"getNetworkQuality",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.getConnectivity(t),this.getThroughput(t)]);case 2:return n=e.sent,r=(0,d.Z)(n,2),i=r[0],a=r[1],e.abrupt("return",{connectivity:i,throughput:null==a?void 0:a.throughput,fractionalLoss:null==a?void 0:a.fractionalLoss,RTT:null==a?void 0:a.RTT,jitter:null==a?void 0:a.jitter,backendRTT:null==a?void 0:a.backendRTT});case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getNetworkInfo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.getConnectivity(t),this.getThroughput(t),this.getIPDetails()]);case 2:return r=e.sent,i=(0,d.Z)(r,3),a=i[0],o=i[1],s=i[2],e.abrupt("return",{ipDetails:s,effectiveNetworkType:null==(n=navigator.connection)?void 0:n.effectiveType,location:s.loc?vc(s.loc):void 0,turnConnectivity:!!a&&(a.host||a.relay||a.reflexive),connectivity:a,throughput:null==o?void 0:o.throughput,fractionalLoss:null==o?void 0:o.fractionalLoss,RTT:null==o?void 0:o.RTT,jitter:null==o?void 0:o.jitter,backendRTT:null==o?void 0:o.backendRTT});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),yc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n)}(gc),bc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.apply(this,arguments),Cs((0,f.Z)(e),"producerMap",new Map),Cs((0,f.Z)(e),"consumerMap",new Map),e}return(0,y.Z)(n,[{key:"registerProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.producerMap.set(t.id,t),e.next=3,this.generateProducerStreamMap(t);case 3:t.observer.on("close",this.deregisterProducer.bind(this,t));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"registerConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.consumerMap.set(t.id,t),e.next=3,this.generateConsumerStreamMap(t);case 3:this.consumerPeerIdMap.set(t.id,{producerId:t.producerId,peerId:t.appData.peerId}),t.observer.on("close",this.deregisterConsumer.bind(this,t));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"generateConsumerStreamMap",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,s,u,l,d,h=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>1&&void 0!==h[1]&&h[1],e.next=3,t.getStats();
2case 3:r=e.sent,i=this.parseRTCReport(r,["inbound-rtp"],!1,t.id),a=(0,o.Z)(i.consumerStreamMap.values())[0],s=n?this.getConsumerStatsFromParsedConsumerStats(i,a,t.id):void 0,u=(0,c.Z)(r.values()),e.prev=8,u.s();case 10:if((l=u.n()).done){e.next=19;break}d=l.value,e.t0=d.type,e.next="inbound-rtp"===e.t0?15:17;break;case 15:return this.inboundConsumerMap.set(d.id,t.id),e.abrupt("break",17);case 17:e.next=10;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(8),u.e(e.t1);case 24:return e.prev=24,u.f(),e.finish(24);case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}}),e,this,[[8,21,24,27]])})));return function(t){return e.apply(this,arguments)}}()},{key:"deregisterProducer",value:function(e){var t=this;this.producerMap.delete(e.id),this.outboundProducerMap.forEach((function(n,r){n===e.id&&t.outboundProducerMap.delete(r)}))}},{key:"deregisterConsumer",value:function(e){var t=this;this.consumerMap.delete(e.id),this.inboundConsumerMap.forEach((function(n,r){n===e.id&&t.inboundConsumerMap.delete(r)})),this.consumerPeerIdMap.delete(e.id)}},{key:"parseRTCReport",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,o=e,u=new mc,l=n.length?new Set(n):void 0,d=(0,c.Z)(o.values());try{for(d.s();!(t=d.n()).done;){var p=t.value;if(l){if(0===l.size)break;if(!l.has(p.type))continue;r&&l.delete(p.type)}switch(p.type){case"candidate-pair":if(!0===p.nominated||!0===p.selected){var h=p,f={bytesReceived:h.bytesReceived,bytesSent:h.bytesSent,currentRoundTripTime:h.currentRoundTripTime,totalRoundTripTime:h.totalRoundTripTime,availableOutgoingBitrate:h.availableOutgoingBitrate};u.candidatePair=f;break}break;case"transport":var v=p;a&&(a.producing&&(this.overallProducingTransportsStatsMap[a.id]||(this.overallProducingTransportsStatsMap[a.id]={totalPacketsSent:0})),a.consuming&&(this.overallConsumingTransportsStatsMap[a.id]||(this.overallConsumingTransportsStatsMap[a.id]={totalPacketsReceived:0})));var m={bytesReceived:v.bytesReceived,bytesSent:v.bytesSent,packetsSent:v.packetsSent,packetsReceived:v.packetsReceived,dtlsCipher:v.dtlsCipher,dtlsState:v.dtlsState,iceRole:v.iceRole};if(u.transport=m,a){if(a.producing){var g=this.overallProducingTransportsStatsMap[a.id];this.processProducingTransportStats(a.id,g,m)}if(a.consuming){var y=this.overallConsumingTransportsStatsMap[a.id];this.processConsumingTransportStats(a.id,y,m)}}break;case"remote-inbound-rtp":var b=p,k={jitter:b.jitter,fractionLost:b.fractionLost,roundTripTime:b.roundTripTime,roundTripTimeMeasurements:b.roundTripTimeMeasurements,totalRoundTripTime:b.totalRoundTripTime,packetsLost:b.packetsLost};u.remoteInboundRtp.set(b.localId,k);break;case"outbound-rtp":var _=p,w=i||this.outboundProducerMap.get(p.id);this.overallProducersStatsMap[w]||(this.overallProducersStatsMap[w]={totalVideoPacketsSent:0,totalAudioPacketsSent:0});var x=this.overallProducersStatsMap[w];if(["video","audio"].includes(_.mediaType)){if(!this.outboundProducerMap.has(p.id)){u.staleProducerStreamMap=!0,l&&l.delete("outbound-rtp");break}u.producerStreamMap.has(w)||u.producerStreamMap.set(w,{outboundVideoRtpId:[],outboundAudioRtpId:[]});var S={bytesSent:_.bytesSent,packetsSent:_.packetsSent,nackCount:_.nackCount};if("video"===_.mediaType){if("unknown"===_.decoderImplementation)break;var E=_,T=(0,s.Z)({frameHeight:E.frameHeight,frameWidth:E.frameWidth,framesEncoded:E.framesEncoded,framesDropped:E.framesDropped?E.framesDropped:E.droppedFrames,framesPerSecond:E.framesPerSecond?E.framesPerSecond:E.framerateMean,framesSent:E.framesSent,keyFramesEncoded:E.keyFramesEncoded,firCount:E.firCount,encoderImplementation:E.encoderImplementation,hugeFramesSent:E.hugeFramesSent,pliCount:E.pliCount,qpSum:E.qpSum,qualityLimitationReason:E.qualityLimitationReason,qualityLimitationDurations:E.qualityLimitationDurations,qualityLimitationResolutionChanges:E.qualityLimitationResolutionChanges,totalEncodeTime:E.totalEncodeTime,totalPacketSendDelay:E.totalEncodeTime,retransmittedBytesSent:E.retransmittedBytesSent,retransmittedPacketsSent:E.retransmittedPacketsSent},S);u.outboundVideoRtp.set(p.id,T),u.producerStreamMap.get(w).outboundVideoRtpId.push(p.id),this.processOutboundProducerVideoStats(w,x,T)}else if("audio"===_.mediaType){var P=_,C=(0,s.Z)({retransmittedBytesSent:P.retransmittedBytesSent,retransmittedPacketsSent:P.retransmittedPacketsSent},S);u.outboundAudioRtp.set(p.id,C),u.producerStreamMap.get(w).outboundAudioRtpId.push(p.id),this.processOutboundProducerAudioStats(w,x,C)}}break;
2case"inbound-rtp":var R=p,Z=i||this.inboundConsumerMap.get(p.id);this.overallConsumersStatsMap[Z]||(this.overallConsumersStatsMap[Z]={totalVideoPacketsReceived:0,totalAudioPacketsReceived:0});var M=this.overallConsumersStatsMap[Z];if(["video","audio"].includes(R.mediaType)){if(!this.inboundConsumerMap.has(p.id)){u.staleConsumerStreamMap=!0,l&&l.delete("inbound-rtp");break}u.consumerStreamMap.has(Z)||u.consumerStreamMap.set(Z,{inboundVideoRtpId:[],inboundAudioRtpId:[]});var A={bytesReceived:R.bytesReceived,packetsReceived:R.packetsReceived,packetsLost:R.packetsLost,jitter:R.jitter,nackCount:R.nackCount};if("video"===R.mediaType){if("unknown"===R.decoderImplementation)break;var I=R,O=(0,s.Z)({frameHeight:I.frameHeight,frameWidth:I.frameWidth,framesDecoded:I.framesDecoded,framesDropped:I.framesDropped?I.framesDropped:I.droppedFrames,framesPerSecond:I.framesPerSecond?I.framesPerSecond:I.framerateMean,framesReceived:I.framesReceived,keyFramesDecoded:I.keyFramesDecoded,firCount:I.firCount,decoderImplementation:I.decoderImplementation},A);u.inboundVideoRtp.set(p.id,O),u.consumerStreamMap.get(Z).inboundVideoRtpId.push(p.id),this.processInboundConsumerVideoStats(Z,M,O)}else if("audio"===R.mediaType){var L=R,D=(0,s.Z)({audioLevel:L.audioLevel,concealedSampels:L.concealedSampels,concealmentEvents:L.concealmentEvents,jitterBufferDelay:L.jitterBufferDelay,jitterBufferEmittedCount:L.jitterBufferEmittedCount,totalAudioEnergy:L.totalAudioEnergy,totalSamplesDuration:L.totalSamplesDuration,totalSamplesReceived:L.totalSamplesReceived},A);u.inboundAudioRtp.set(p.id,D),u.consumerStreamMap.get(Z).inboundAudioRtpId.push(p.id),this.processInboundConsumerAudioStats(Z,M,D)}}}}}catch(xC){d.e(xC)}finally{d.f()}if(u.outboundVideoRtp.forEach((function(e,t){e.remoteData=u.remoteInboundRtp.get(t)})),u.outboundAudioRtp.forEach((function(e,t){e.remoteData=u.remoteInboundRtp.get(t)})),u.candidatePair&&(u.transport?(u.transport.bytesReceived=u.candidatePair.bytesReceived,u.transport.bytesSent=u.candidatePair.bytesSent,u.transport.totalRoundTripTime=u.candidatePair.totalRoundTripTime,u.transport.availableOutgoingBitrate=u.candidatePair.availableOutgoingBitrate,u.transport.roundTripTime=u.candidatePair.currentRoundTripTime):u.transport={bytesReceived:u.candidatePair.bytesReceived,bytesSent:u.candidatePair.bytesSent,totalRoundTripTime:u.candidatePair.totalRoundTripTime,availableOutgoingBitrate:u.candidatePair.availableOutgoingBitrate,roundTripTime:u.candidatePair.currentRoundTripTime}),u.transport&&!u.transport.roundTripTime){var N=0,j=0;u.remoteInboundRtp.forEach((function(e,t){e.roundTripTime&&e.roundTripTime>N&&(N=e.roundTripTime,j=e.totalRoundTripTime)})),u.transport.roundTripTime=N,u.transport.totalRoundTripTime=j}return u}},{key:"getProducerStatsFromReport",value:function(e){var t=this,n=[];try{e.producerStreamMap.forEach((function(r,i){var a=t.producerMap.get(i).track.getSettings(),o={producerId:i,videoStats:r.outboundVideoRtpId.map((function(t){var n=e.outboundVideoRtp.get(t);return n.frameHeight||(n.frameHeight=a.height,n.frameWidth=a.width,n.framesPerSecond=a.frameRate),n})),audioStats:r.outboundAudioRtpId.map((function(t){return e.outboundAudioRtp.get(t)}))};n.push(o)}))}catch(E){console.error("getProducersReport: ",E,e)}return n}},{key:"getConsumerStatsFromParsedConsumerStats",value:function(e,t,n){var r,i=this;try{var a=this.consumerPeerIdMap.get(n),o=a.peerId,s=a.producerId,c=null==t?void 0:t.inboundVideoRtpId.map((function(t){var r=i.consumerMap.get(n).track.getSettings(),a=e.inboundVideoRtp.get(t);return a.frameHeight||(a.frameHeight=r.height,a.frameWidth=r.width,a.framesPerSecond=r.frameRate),a}));r={consumerId:n,peerId:o,producerId:s,videoStats:c,audioStats:null==t?void 0:t.inboundAudioRtpId.map((function(t){return e.inboundAudioRtp.get(t)}))}}catch(o){console.error("getConsumerStatsFromParsedConsumerStats: ",o,e)}return r}},{key:"getConsumerStatsFromReport",value:function(e){var t=this,n=[];try{e.consumerStreamMap.forEach((function(r,i){n.push(t.getConsumerStatsFromParsedConsumerStats(e,r,i))}))}catch(E){console.error("getConsumerStatsFromReport: ",E,e)}return n}}]),n}(gc),kc=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n)}(bc);function _c(e,t,n,r){if(!("function"==typeof n&&r instanceof t))throw r;n.call(null,r,e)}function wc(e,t,n){var r=e.value;return e.value=function(){var e=this;try{for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=r.apply(this,a);return s&&s instanceof Promise?s.catch((function(r){_c(e,t,n,r)})):s}catch(s){_c(this,t,n,s)}return null},e}var xc=function(e,t){return function(n,r,i){var a=i.value;return i.value=function(){var n=this;try{for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var s=a.apply(this,i);return s&&s instanceof Promise?s.catch((function(r){_c(n,e,t,r)})):s}catch(s){_c(this,e,t,s)}return null},i}},Sc=globalThis&&globalThis.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Ec=console,Tc=function(){function e(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Blink",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Hs.PRODUCTION,r=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0;switch((0,g.Z)(this,e),Cs(this,"eventHandler"),Cs(this,"measurements"),Cs(this,"producingTransport"),Cs(this,"consumingTransport"),Cs(this,"producers",new Map),Cs(this,"consumers",new Map),Cs(this,"iceServers"),Cs(this,"connectionInfoPromise"),Cs(this,"pingStatsTimeout"),Cs(this,"logger"),Cs(this,"env"),Cs(this,"peerId"),Cs(this,"consumerSharedMediaStatesMap",new Map),Cs(this,"currentUserMediaStates",{}),this.env=n,this.logger=r,this.peerId=i,this.eventHandler=new ic({logger:r,peerId:i,env:n}),this.logger.debug("callStats::engineName: ",{engineName:t}),t){case"Blink":this.measurements=new yc;break;case"Gecko":this.measurements=new bc;break;case"WebKit":this.measurements=new kc;break;default:throw Error("Unknown engineName! ".concat(t))}this.measurements.callStatsInstance=this,this.registerProducer=this.registerProducer.bind(this),this.registerConsumer=this.registerConsumer.bind(this)}return(0,y.Z)(e,[{key:"registerIceServers",value:function(e){this.iceServers=e}},{key:"registerConsumer",value:function(e){var t;this.consumerSharedMediaStatesMap.has(e.id)||this.consumerSharedMediaStatesMap.set(e.id,{}),this.consumers.set(e.id,e),this.measurements.registerConsumer(e),this.logger.debug("callStats::registerConsumer",{c
2onsumerId:e.id,consumerkind:e.kind,isScreenShare:!(null==(t=e.appData)||!t.screenShare)}),e.observer.on("close",this.deRegisterConsumer.bind(this,e))}},{key:"registerProducer",value:function(e){var t;this.producers.set(e.id,e),this.measurements.registerProducer(e),this.logger.debug("callStats::registerProducer",{producerId:e.id,producerKind:e.kind,isScreenShare:!(null==(t=e.appData)||!t.screenShare)}),e.observer.on("close",this.deRegisterProducer.bind(this,e))}},{key:"sendConsumerSharedMediaStateEvent",value:function(e,t){this.consumerSharedMediaStatesMap.has(e)||this.consumerSharedMediaStatesMap.set(e,{});var n=this.consumerSharedMediaStatesMap.get(e);this.consumerSharedMediaStatesMap.set(e,Object.assign(n,t))}},{key:"registerProducingTransport",value:function(e){var t,n=this;this.producingTransport=e,e.observer.on("close",this.disconnectProducingTransport.bind(this,e)),e.observer.on("disconnect",this.disconnectProducingTransport.bind(this,e)),Array.from((null==(t=e._producers)?void 0:t.values())||[]).forEach((function(e){n.registerProducer(e)})),e.observer.on("newproducer",this.registerProducer)}},{key:"registerConsumingTransport",value:function(e){var t,n=this;this.consumingTransport=e,e.observer.on("close",this.disconnectConsumingTransport.bind(this,e)),e.observer.on("disconnect",this.disconnectConsumingTransport.bind(this,e)),Array.from((null==(t=e._consumers)?void 0:t.values())||[]).forEach((function(e){n.registerConsumer(e)})),e.observer.on("newconsumer",this.registerConsumer)}},{key:"deRegisterConsumer",value:function(e){this.consumers.delete(e.id)}},{key:"deRegisterProducer",value:function(e){this.producers.delete(e.id)}},{key:"disconnectConsumingTransport",value:function(){this.consumingTransport=void 0}},{key:"disconnectProducingTransport",value:function(){this.producingTransport=void 0}},{key:"callEvent",value:function(e){this.eventHandler.callEvent(e)}},{key:"sendPreCallTestBeginEvent",value:function(){var e=this;this.connectionInfoPromise=this.measurements.getNetworkInfo(this.iceServers),this.eventHandler.callEvent({event:Ts.PRECALL_TEST_BEGIN,timestamp:new Date}),this.connectionInfoPromise&&this.connectionInfoPromise.then((function(t){e.eventHandler.callEvent({event:Ts.PRECALL_TEST_COMPLETE,metaData:{connectionInfo:t},timestamp:new Date})}))}},{key:"sendScreenShareToggleEvent",value:function(e,t){this.currentUserMediaStates.screen=e,this.eventHandler.callEvent({event:e?Ts.SCREENSHARE_STARTED:Ts.SCREENSHARE_STOPPED,metaData:{ssrc:t},timestamp:new Date})}},{key:"sendScreenShareRequestedEvent",value:function(){this.eventHandler.callEvent({event:Ts.SCREENSHARE_START_REQUESTED,timestamp:new Date})}},{key:"sendActiveSpeakerEvent",value:function(e){this.eventHandler.callEvent({event:Ts.DOMINANT_SPEAKER,metaData:{peerId:e},timestamp:new Date})}},{key:"devices",value:function(e,t){this.eventHandler.callEvent({event:e===qs.AUDIO&&Ts.AUDIO_DEVICES_UPDATES||e===qs.VIDEO&&Ts.VIDEO_DEVICES_UPDATES||e===qs.SPEAKER&&Ts.SPEAKER_DEVICES_UPDATES,metaData:{deviceList:t},timestamp:new Date})}},{key:"selectedDevice",value:function(e,t){this.eventHandler.callEvent({event:e===qs.AUDIO&&Ts.SELECTED_MICROHPONE_UPDATE||e===qs.VIDEO&&Ts.SELECTED_CAMERA_UPDATE||e===qs.SPEAKER&&Ts.SELECTED_SPEAKER_UPDATE,metaData:{device:t},timestamp:new Date})}},{key:"mediaPermission",value:function(e,t){this.eventHandler.callEvent({event:Ts.MEDIA_PERMISSION,metaData:{deviceType:e,permission:t},timestamp:new Date})}},{key:"mediaPlaybackFailed",value:function(e){this.eventHandler.callEvent({event:e===qs.AUDIO&&Ts.AUDIO_PLAY_FAILED||e===qs.VIDEO&&Ts.VIDEO_PLAY_FAILED,metaData:{deviceType:e},timestamp:new Date})}},{key:"mediaTrackMuted",value:function(e){this.eventHandler.callEvent({event:e===qs.AUDIO&&Ts.AUDIO_TRACK_MUTED||e===qs.VIDEO&&Ts.VIDEO_TRACK_MUTED,metaData:{deviceType:e},timestamp:new Date})}},{key:"tabChanged",value:function(e){this.eventHandler.callEvent({event:Ts.TAB_CHANGE,metaData:{isMeetingsTabActive:e},timestamp:new Date})}},{key:"browserBackgrounded",value:function(){this.eventHandler.callEvent({event:Ts.BROWSER_BACKGROUNDED,timestamp:new Date})}},{key:"browserForegrounded",value:function(){this.eventHandler.callEvent({event:Ts.BROWSER_FOREGROUNDED,timestamp:new Date})}},{key:"legacySwitch",value:function(e){this.eventHandler.callEvent({event:Ts.LEGACY_SWITCH,metadata:{on:e},timestamp:new Date})}}
2,{key:"getPreCallTestResults",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.connectionInfoPromise);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"sendCallJoinBeginEvent",value:function(e){(e=(0,s.Z)((0,s.Z)({},e),{},{meetingEnv:this.env})).deviceInfo=(0,s.Z)((0,s.Z)({},e.deviceInfo),{},{userAgent:navigator.userAgent,cpus:navigator.hardwareConcurrency,memory:navigator.deviceMemory}),this.eventHandler.callEvent({event:Ts.CALL_JOIN_BEGIN,metaData:{peerMetaData:e},timestamp:new Date})}},{key:"sendNetworkQualityTestBeginEvent",value:function(e){var t=this;this.eventHandler.callEvent({event:Ts.NET_QUALITY_TEST_BEGIN,timestamp:new Date}),new Promise(function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r,i){var a,o,u,l,d;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a=[],n.prev=1,o=(0,c.Z)(e),n.prev=3,o.s();case 5:if((u=o.n()).done){n.next=20;break}if(l=u.value,n.prev=7,!(l.iceServers&&l.iceServers.length>0)){n.next=13;break}return n.next=11,t.measurements.getNetworkQuality(l.iceServers);case 11:d=n.sent,a.push((0,s.Z)((0,s.Z)({},l),{},{networkResults:d}));case 13:n.next=18;break;case 15:n.prev=15,n.t0=n.catch(7),console.warn("Error handling ",n.t0);case 18:n.next=5;break;case 20:n.next=25;break;case 22:n.prev=22,n.t1=n.catch(3),o.e(n.t1);case 25:return n.prev=25,o.f(),n.finish(25);case 28:r({regionData:a}),n.next=34;break;case 31:n.prev=31,n.t2=n.catch(1),console.warn("Error in callstats, ",n.t2),i(n.t2);case 34:case"end":return n.stop()}}),n,null,[[1,31],[3,22,25,28],[7,15]])})));return function(e,t){return n.apply(this,arguments)}}()).then((function(e){t.eventHandler.callEvent({event:Ts.NET_QUALITY_TEST_END,timestamp:new Date,metaData:e})}))}},{key:"sendWebSocketConnectedEvent",value:function(){this.eventHandler.callEvent({event:Ts.WEBSOCKET_CONNECTED,timestamp:new Date})}},{key:"sendTransportConnectedEvent",value:function(){this.eventHandler.callEvent({event:Ts.TRANSPORT_CONNECTED,timestamp:new Date})}},{key:"sendAudioToggleEvent",value:function(e){var t;this.currentUserMediaStates.audio=e,t=e?Ts.AUDIO_ON:Ts.AUDIO_OFF,this.eventHandler.callEvent({event:t,timestamp:new Date})}},{key:"sendVideoToggleEvent",value:function(e){var t;this.currentUserMediaStates.video=e,t=e?Ts.VIDEO_ON:Ts.VIDEO_OFF,this.eventHandler.callEvent({event:t,timestamp:new Date})}},{key:"sendParticipantRoleToggleEvent",value:function(e){this.eventHandler.callEvent({event:Ts.PARTICIPANT_ROLE,timestamp:new Date,metaData:e})}},{key:"startPingStats",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7e3;this.sendPingStatsEvent(!1),this.pingStatsTimeout=setInterval(this.sendPingStatsEvent.bind(this),e)}},{key:"stopPingStats",value:function(){clearInterval(this.pingStatsTimeout)}},{key:"sendPingStatsEvent",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,s,c=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(c.length>0&&void 0!==c[0])||c[0],e.t0=this.producingTransport,!e.t0){e.next=7;break}return e.next=5,this.measurements.getProcessedStats(this.producingTransport,!1,!0);case 5:n=e.sent,e.t0=!n||!(null!=n&&n.producerReport);case 7:if(!e.t0){e.next=20;break}return this.logger.debug("callStats::sendPingStatsEvent::staleProducingTransport",{disclaimer:"Stale producer? Regenerating Stream Maps!"}),e.next=11,this.measurements.getProducersReport((0,o.Z)(this.producers.values()));case 11:if(i=e.sent,!n||!i){e.next=16;break}n.producerReport=i,e.next=20;break;case 16:return e.next=18,this.measurements.getProcessedStats(this.producingTransport,!1,!0);case 18:(!(n=e.sent)||null==n||!n.producerReport)&&this.logger.debug("callStats::sendPingStatsEvent::noProducingTransportReport",{disclaimer:"Stream maps invalid despite regenerating!"});case 20:if(e.t1=this.consumingTransport,!e.t1){e.next=26;break}return e.next=24,this.measurements.getProcessedStats(this.consumingTransport,!0,!1);case 24:r=e.sent,e.t1=!r||!r.consumerReport;case 26:if(!e.t1){e.next=39;break}return this.logger.debug("callStats::sendPingStatsEvent::staleConsumingTransport",{disclaimer:"Stale consumer? Regenerating Stream Maps!"}),e.next=30,this.measurements.getConsumersReport((0,o.Z)(this.consumers.values())
2);case 30:if(a=e.sent,!r||!a){e.next=35;break}r.consumerReport=a,e.next=39;break;case 35:return e.next=37,this.measurements.getProcessedStats(this.consumingTransport,!0,!1);case 37:(!(r=e.sent)||!r.consumerReport)&&this.logger.debug("callStats::sendPingStatsEvent::noConsumingTransportReport",{disclaimer:"Stream maps invalid despite regenerating!"});case 39:if(s={producingTransportStats:n?null==n?void 0:n.transportReport:void 0,consumingTransportStats:r?null==r?void 0:r.transportReport:void 0,producerStats:[].concat((null==n?void 0:n.producerReport)||[]).concat((null==r?void 0:r.producerReport)||[]),consumerStats:[].concat((null==r?void 0:r.consumerReport)||[]).concat((null==n?void 0:n.consumerReport)||[])},!t||0!==s.producerStats.length||0!==s.consumerStats.length){e.next=44;break}return e.next=43,this.eventHandler.flush();case 43:return e.abrupt("return");case 44:this.eventHandler.callEvent({event:Ts.PING_STAT,metaData:s,timestamp:new Date});case 45:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"sendIVSPlayerRebufferEvent",value:function(){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_REBUFFERING,timestamp:new Date})}},{key:"sendIVSPlayerAudioBlockEvent",value:function(){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_AUDIO_BLOCKED,timestamp:new Date})}},{key:"sendIVSPlayerPlaybackBlockedEvent",value:function(){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_PLAYBACK_BLOCKED,timestamp:new Date})}},{key:"sendIVSPlayerNetworkUnavailableEvent",value:function(){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_NETWORK_UNAVAILABLE,timestamp:new Date})}},{key:"sendIVSPlayerInitializedEvent",value:function(){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_INITIALIZED,timestamp:new Date})}},{key:"sendIVSPlayerWorkerErrorEvent",value:function(){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_WORKER_ERROR,timestamp:new Date})}},{key:"sendIVSPlayerErrorEvent",value:function(e){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_ERROR,timestamp:new Date,metaData:e})}},{key:"sendIVSPlayerRecoverableErrorEvent",value:function(e){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_RECOVERABLE_ERROR,timestamp:new Date,metaData:e})}},{key:"sendIVSPlayerAnalyticsEvent",value:function(e){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_ANALYTICS_EVENT,timestamp:new Date,metaData:e})}},{key:"sendIVSPlayerPlaybackRateChangedEvent",value:function(e){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_PLAYBACK_RATE_CHANGED,timestamp:new Date,metaData:{updatedPlaybackRate:e}})}},{key:"sendIVSPlayerQualityChanged",value:function(e){this.eventHandler.callEvent({event:Ts.IVS_PLAYER_QUALITY_CHANGED,timestamp:new Date,metaData:e})}},{key:"sendPlayerLiveLatency",value:function(e){this.eventHandler.callEvent({event:Ts.LIVESTREAM_LATENCY,timestamp:new Date,metaData:{latency:e}})}},{key:"sendDisconnectEvent",value:function(){this.eventHandler.callEvent({event:Ts.DISCONNECT,timestamp:new Date})}},{key:"sendReconnectEvent",value:function(){this.eventHandler.callEvent({event:Ts.RECONNECT_ATTEMPT,timestamp:new Date})}}]),e}();Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"registerIceServers",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"registerConsumer",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"registerProducer",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendConsumerSharedMediaStateEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"registerProducingTransport",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"registerConsumingTransport",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"deRegisterConsumer",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"deRegisterProducer",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"disconnectConsumingTransport",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"disconnectProducingTransport",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendPreCallTestBeginEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendScreenShareToggleEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendScreenShareRequestedEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendActiveSpeakerEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"devices",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"selectedDevice",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}
2))],Tc.prototype,"mediaPermission",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"mediaPlaybackFailed",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"mediaTrackMuted",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"tabChanged",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"browserBackgrounded",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"browserForegrounded",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"legacySwitch",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"getPreCallTestResults",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendCallJoinBeginEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendNetworkQualityTestBeginEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendWebSocketConnectedEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendTransportConnectedEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendAudioToggleEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendVideoToggleEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendParticipantRoleToggleEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"startPingStats",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"stopPingStats",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendPingStatsEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerRebufferEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerAudioBlockEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerPlaybackBlockedEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerNetworkUnavailableEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerInitializedEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerWorkerErrorEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerErrorEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerRecoverableErrorEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerAnalyticsEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerPlaybackRateChangedEvent",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendIVSPlayerQualityChanged",null),Sc([xc(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc.prototype,"sendPlayerLiveLatency",null),Tc=Sc([function(e,t){return function(n,r,i){if(i)return wc(i,e,t);var a,o=(0,c.Z)(Reflect.ownKeys(n.prototype).filter((function(e){return"constructor"!==e})));try{for(o.s();!(a=o.n()).done;){var s=a.value,u=Object.getOwnPropertyDescriptor(n.prototype,s);u.value instanceof Function&&Object.defineProperty(n.prototype,s,wc(u,e,t))}}catch(xC){o.e(xC)}finally{o.f()}}}(TypeError,(function(e,t){return Ec.error(t,e)}))],Tc);var Pc,Cc,Rc,Zc,Mc=Tc,Ac=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.apply(this,arguments),Cs((0,f.Z)(e),"stats"),Cs((0,f.Z)(e),"roomURL"),Cs((0,f.Z)(e),"peerId"),Cs((0,f.Z)(e),"backend"),Cs((0,f.Z)(e),"iceServers"),Cs((0,f.Z)(e),"initialized",!1),Cs((0,f.Z)(e),"stalled",!1),Cs((0,f.Z)(e),"ipInformation"),Cs((0,f.Z)(e),"logger"),e}return(0,y.Z)(n,[{key:"initialize",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.peerId,r=t.engineName,i=t.env,a=void 0===i?Hs.PRODUCTION:i,o=t.iceServers,s=t.apiBase,c=void 0===s?"https://api.cluster.dyte.in":s,u=t.flags,l=t.logger,d=void 0===l?console:l,e.prev=1,this.peerId=n,this.logger=
2d,e.next=6,hc.getIPDetails({peerId:n});case 6:this.ipInformation=e.sent,this.backend=new Mc(c,r,a,u,d,n),this.iceServers=o,null==(h=this.backend)||h.registerIceServers(this.iceServers),this.initialized=!0,null==(v=null==(f=this.backend)?void 0:f.eventHandler)||v.emit("initialized",this.ipInformation),this.emit("initialized",this.ipInformation),this.startPreCallTest(),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),this.logger.error("callStats::CallStatsIntegration: ",{error:{reason:e.t0.reason}}),this.stallCallStats();case 19:case"end":return e.stop()}}),e,this,[[1,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"setRoomName",value:function(e){this.roomURL=e}},{key:"configureSendTransport",value:function(e){var t;null==(t=this.backend)||t.registerProducingTransport(e)}},{key:"configureRecvTransport",value:function(e){var t;null==(t=this.backend)||t.registerConsumingTransport(e)}},{key:"candidateRegionalNetworkQualityTest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{null==(n=this.backend)||n.sendNetworkQualityTestBeginEvent(t)}catch(E){this.logger.error("callStats::sendNetworkQualityTestBeginEvent",{error:{reason:E.reason}})}case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"roomJoined",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==(n=this.backend)||n.sendCallJoinBeginEvent(t),this.backend,null==(r=this.backend)||r.startPingStats();case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"audioOff",value:function(){var e;null==(e=this.backend)||e.sendAudioToggleEvent(!1)}},{key:"audioOn",value:function(){var e;null==(e=this.backend)||e.sendAudioToggleEvent(!0)}},{key:"videoOff",value:function(){var e;null==(e=this.backend)||e.sendVideoToggleEvent(!1)}},{key:"videoOn",value:function(){var e;null==(e=this.backend)||e.sendVideoToggleEvent(!0)}},{key:"callEnded",value:function(){var e,t;null==(e=this.backend)||e.stopPingStats(),null==(t=this.backend)||t.sendDisconnectEvent()}},{key:"screenShareStart",value:function(e){var t;null==(t=this.backend)||t.sendScreenShareToggleEvent(!0,e)}},{key:"consumerSharedMediaState",value:function(e,t){var n;null==(n=this.backend)||n.sendConsumerSharedMediaStateEvent(e,t)}},{key:"screenShareStop",value:function(e){var t;null==(t=this.backend)||t.sendScreenShareToggleEvent(!1,e)}},{key:"screenShareRequested",value:function(){var e;null==(e=this.backend)||e.sendScreenShareRequestedEvent()}},{key:"activeSpeaker",value:function(e){var t;e===this.peerId&&(null==(t=this.backend)||t.sendActiveSpeakerEvent(e))}},{key:"devices",value:function(e,t){var n;null==(n=this.backend)||n.devices(e,t)}},{key:"selectedDevice",value:function(e,t){var n;null==(n=this.backend)||n.selectedDevice(e,t)}},{key:"mediaPermission",value:function(e,t){var n;null==(n=this.backend)||n.mediaPermission(e,t)}},{key:"mediaPlaybackFailed",value:function(e){var t;null==(t=this.backend)||t.mediaPlaybackFailed(e)}},{key:"mediaTrackMuted",value:function(e){var t;null==(t=this.backend)||t.mediaTrackMuted(e)}},{key:"tabChanged",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null==(e=this.backend)||e.tabChanged(t)}},{key:"browserBackgrounded",value:function(){var e;null==(e=this.backend)||e.browserBackgrounded()}},{key:"browserForegrounded",value:function(){var e;null==(e=this.backend)||e.browserForegrounded()}},{key:"legacySwitch",value:function(e){var t;null==(t=this.backend)||t.legacySwitch(e)}},{key:"startPreCallTest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==(t=this.backend)||t.sendPreCallTestBeginEvent();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onPreCallTestResults",value:function(e){var t;return null==(t=this.backend)||t.eventHandler.once("precall_end",e),e}},{key:"onReceivingConsumerAudioStatus",value:function(e){var t;null==(t=this.backend)||t.eventHandler.on("consumer_audio_status",e)}},{key:"onReceivingConsumerVideoStatus",value:function(e){var t;null==(t=this.backend)||t.eventHandler.on("consumer_video_status",e)}},{key:"onReceivingProducerAudioStatus",value:function(e){var t;null==(t=this.backend)||t.eventHandler.on("producer_audio_status",e)}},{key:"onReceivingProducerVideoStatus",value:function(e){var t;null==(t=this.backend)||t.eventHandler.on("producer_video_status",e)}},{key:"onReceivingProducingTransportStatus",value:function(e){var t;null==(t=this.backend)||t.eventHandler.on("producing_transport_status",e)}},{key:"onReceivingConsumingTransportStatus",value:function(e){var t;null==(t=this.backend)||t.eventHandler.on("consuming_transport_status",e)}},{key:"onSafeInitialization",value:function(e){if(this.initialized)e(this.ipInformation,!1);else if(!this.stalled){var t=function(t){e(t,!0)};return this.once("initialized",t),t}return function(){}}},{key:"removeInitializationListener",value:function(e){this.removeListener("initialized",e)}},{key:"stallCallStats",value:function(){this.stalled=!0,this.removeAllListeners("initialized")}},{key:"ivsPlayerEvent",value:function(e,t){var n,r,i,a,o,s,c,u,l,d,p;switch(e){case"PlayerRebuffering":null==(n=this.backend)||n.sendIVSPlayerRebufferEvent();break;case"PlayerAudioBlocked":null==(r=this.backend)||r.sendIVSPlayerAudioBlockEvent();break;case"PlayerPlaybackBlocked":null==(i=this.backend)||i.sendIVSPlayerPlaybackBlockedEvent();break;case"PlayerNetworkUnavailable":null==(a=this.backend)||a.sendIVSPlayerNetworkUnavailableEvent();break;case"PlayerInitialized":null==(o=this.backend)||o.sendIVSPlayerInitializedEvent();break;case"PlayerWorkerError":null==(s=this.backend)||s.sendIVSPlayerWorkerErrorEvent();break;case"PlayerError":null==(c=this.backend)||c.sendIVSPlayerErrorEvent(t);break;case"PlayerRecoverableError":null==(u=this.backend)||u.sendIVSPlayerRecoverableErrorEvent(t);break;case"PlayerAnalyticsEvent":null==(l=this.backend)||l.sendIVSPlayerAnalyticsEvent(t);break;case"PlayerPlaybackRateChanged":null==(d=this.backend)||d.sendIVSPlayerPlaybackRateChangedEvent(t);break;case"PlayerQualityChanged":null==(p=this.backend)||p.sendIVSPlayerQualityChanged(t)}}},{key:"livestreamLatency",value:function(e){var t;null==(t=this.backend)||t.sendPlayerLiveLatency(e)}}]),n}(Ns),Ic=new Ac;Ic.setMaxListeners(30),Array.prototype.at||Object.assign(Array.prototype,{at:function(e){var t=this.length,n=e>=0?e:t+e;return n<0||n>=t?void 0:this[n]}}),String.prototype.at||Object.assign(String.prototype,{at:function(e){var t=this.length,n=e>=0?e:t+e;return n<0||n>=t?void 0:this[n]}}),function(e){e.skip="SKIP",e.onAccept="ON_ACCEPT",e.skipOnPrivilegedUserEntry="SKIP_ON_PRIVILEGED_USER_ENTRY",e.skipOnAccept="SKIP_ON_ACCEPT"}(Pc||(Pc={})),function(e){e.none="NONE",e.recorder="RECORDER",e.livestreamer="LIVESTREAMER"}(Cc||(Cc={})),function(e){e.groupCall="GROUP_CALL",e.webinar="WEBINAR",e.audioRoom="AUDIO_ROOM",e.livestream="LIVESTREAM"}(Rc||(Rc={})),function(e){e.SKIP="skip",e.SKIP_ON_PRIVILEGED_USER_ENTRY="skipOnPrivilegedUserEntry",e.ON_ACCEPT="skipOnAccept",e.SKIP_ON_ACCEPT="skipOnAccept"}(Zc||(Zc={})),Rc.groupCall,Pc.skipOnAccept,Cc.none,Rc.groupCall,Cc.none,Pc.skipOnAccept;var Oc,Lc="hXgU8Wc8pwuGNq9ms5q9Hh";function Dc(){var e={};return(arguments.length>
20&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(t){e[t.feature.name]={enabled:t.enabled,value:t.feature_state_value}})),e}"undefined"!=typeof process&&null!=(Oc=null==process?void 0:{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SERVER_URL:"https://dyte-audio.fly.dev"})&&Oc.FLAGSMITH_ENVIRONMENT_KEY&&(Lc={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SERVER_URL:"https://dyte-audio.fly.dev"}.FLAGSMITH_ENVIRONMENT_KEY);var Nc=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lc;(0,g.Z)(this,e),Cs(this,"flags",{}),Cs(this,"environmentKey",null),this.environmentKey=t,this.identify=this.identify.bind(this),this.getValue=this.getValue.bind(this),this.hasFeature=this.hasFeature.bind(this),this.getAllFlags=this.getAllFlags.bind(this)}return(0,y.Z)(e,[{key:"identify",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2&&void 0!==u[2]&&u[2],i=u.length>3&&void 0!==u[3]?u[3]:5e3,a=JSON.parse(JSON.stringify(n)),o=Object.entries(a).map((function(e){return{trait_key:e[0],trait_value:e[1]}})),e.prev=4,s="_"+(Math.random()+1).toString(36).substring(2),e.next=8,R().post("https://edge.api.flagsmith.com/api/v1/identities/",{identifier:t+(r?s:""),traits:o},{headers:{"Content-Type":"application/json","X-Environment-Key":this.environmentKey},timeout:i});case 8:c=e.sent,this.flags=Dc(c.data.flags||[]),e.next=14;break;case 12:e.prev=12,e.t0=e.catch(4);case 14:return e.abrupt("return",this.flags);case 15:case"end":return e.stop()}}),e,this,[[4,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getValue",value:function(e){return this.flags&&this.flags[e]&&this.flags[e].value}},{key:"hasFeature",value:function(e){return this.flags&&this.flags[e]&&this.flags[e].enabled}},{key:"getAllFlags",value:function(){return this.flags}}]),e}(),jc=new Nc,Bc=[-2,-1,0,1,2],Uc=[0,1,2,3,4];var Vc=function(e,t,n){var r,i,a;if(0==t)r=i=a=n;else{var o=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<.16666666666666666?e+6*(t-e)*n:n<.5?t:n<.6666666666666666?e+(t-e)*(.6666666666666666-n)*6:e},s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*a)]},Fc=function(e,t,n){var r=function(e){return e.toString(16).padStart(2,"0")};return"#".concat(r(e)).concat(r(t)).concat(r(n))},zc=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bc,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,r=[],i=function(e){var t="0",n="0",r="0";if(4==e.length)t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],r="0x"+e[3]+e[3];else{if(7!=e.length)throw new Error("[dyte] Invalid hex color code provided");t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],r="0x"+e[5]+e[6]}return[+t,+n,+r]}(e),a=(0,d.Z)(i,3),o=function(e,t,n){e/=255,t/=255,n/=255;var r,i,a=Math.max(e,t,n),o=Math.min(e,t,n),s=(a+o)/2;if(a==o)r=i=0;else{var c=a-o;switch(i=s>.5?c/(2-a-o):c/(a+o),a){case e:r=(t-n)/c+(t<n?6:0);break;case t:r=(n-e)/c+2;break;case n:r=(e-t)/c+4}r/=6}return[r,i,s]}(a[0],a[1],a[2]),s=(0,d.Z)(o,3),u=s[0],l=s[1],p=s[2],h=Math.round(100*p);h>70?n=.8:h>60?n=.9:h<10?n=.075:h<42&&(n=.3);var f=t.findIndex((function(e){return 0===e}));if(-1===f)throw new Error("Invalid reducer provided, it must contain atleast one zero");var v,m=(100-h)/(5-f),g=h/(f+1),y=(0,c.Z)(t);try{for(y.s();!(v=y.n()).done;){var b=v.value,k=Vc(u,l,(b<0?h+b*g*n:b>0?h+b*m*n:h)/100),_=(0,d.Z)(k,3),w=_[0],x=_[1],S=_[2];r.push(Fc(w,x,S))}}catch(xC){y.e(xC)}finally{y.f()}return r};function Hc(e,t){return e===t||e!==e&&t!==t}function qc(e,t){for(var n=e.length;n--;)if(Hc(e[n][0],t))return n;return-1}var Gc=Array.prototype.splice;function Wc(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])}}Wc.prototype.clear=function(){this.__data__=[],this.size=0},Wc.prototype.delete=function(e){var t=this.__data__,n=qc(t,e);return!(n<0)&&(n==t.length-1?t.pop():Gc.call(t,n,1),--this.size,!0)},Wc.prototype.get=function(e){var t=this.__data__,n=qc(t,e);return n<0?void 0:t[n][1]},Wc.prototype.has=function(e){return qc(this.__data__,e)>-1},Wc.prototype.set=function(e,t){var n=this.__data__,r=qc(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Jc="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,$c="object"==typeof self&&self&&self.Object===Object&&self,Kc=Jc||$c||Function("return this")(),Qc=Kc.Symbol,Yc=Object.prototype,Xc=Yc.hasOwnProperty,eu=Yc.toString,tu=Qc?Qc.toStringTag:void 0;var nu=Object.prototype.toString;
2var ru="[object Null]",iu="[object Undefined]",au=Qc?Qc.toStringTag:void 0;function ou(e){return null==e?void 0===e?iu:ru:au&&au in Object(e)?function(e){var t=Xc.call(e,tu),n=e[tu];try{e[tu]=void 0;var r=!0}catch(a){}var i=eu.call(e);return r&&(t?e[tu]=n:delete e[tu]),i}(e):function(e){return nu.call(e)}(e)}function su(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var cu="[object AsyncFunction]",uu="[object Function]",lu="[object GeneratorFunction]",du="[object Proxy]";function pu(e){if(!su(e))return!1;var t=ou(e);return t==uu||t==lu||t==cu||t==du}var hu=Kc["__core-js_shared__"],fu=function(){var e=/[^.]+$/.exec(hu&&hu.keys&&hu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var vu=Function.prototype.toString;function mu(e){if(null!=e){try{return vu.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var gu=/^\[object .+?Constructor\]$/,yu=Function.prototype,bu=Object.prototype,ku=yu.toString,_u=bu.hasOwnProperty,wu=RegExp("^"+ku.call(_u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xu(e){return!(!su(e)||function(e){return!!fu&&fu in e}(e))&&(pu(e)?wu:gu).test(mu(e))}function Su(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return xu(n)?n:void 0}var Eu=Su(Kc,"Map"),Tu=Su(Object,"create");var Pu=Object.prototype.hasOwnProperty;var Cu=Object.prototype.hasOwnProperty;function Ru(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zu(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Mu(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])}}Ru.prototype.clear=function(){this.__data__=Tu?Tu(null):{},this.size=0},Ru.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ru.prototype.get=function(e){var t=this.__data__;if(Tu){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Pu.call(t,e)?t[e]:void 0},Ru.prototype.has=function(e){var t=this.__data__;return Tu?void 0!==t[e]:Cu.call(t,e)},Ru.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Tu&&void 0===t?"__lodash_hash_undefined__":t,this},Mu.prototype.clear=function(){this.size=0,this.__data__={hash:new Ru,map:new(Eu||Wc),string:new Ru}},Mu.prototype.delete=function(e){var t=Zu(this,e).delete(e);return this.size-=t?1:0,t},Mu.prototype.get=function(e){return Zu(this,e).get(e)},Mu.prototype.has=function(e){return Zu(this,e).has(e)},Mu.prototype.set=function(e,t){var n=Zu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Au(e){var t=this.__data__=new Wc(e);this.size=t.size}Au.prototype.clear=function(){this.__data__=new Wc,this.size=0},Au.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Au.prototype.get=function(e){return this.__data__.get(e)},Au.prototype.has=function(e){return this.__data__.has(e)},Au.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wc){var r=n.__data__;if(!Eu||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mu(r)}return n.set(e,t),this.size=n.size,this};var Iu=function(){try{var e=Su(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ou=Iu;function Lu(e,t,n){"__proto__"==t&&Ou?Ou(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Du=Object.prototype.hasOwnProperty;function Nu(e,t,n){var r=e[t];(!Du.call(e,t)||!Hc(r,n)||void 0===n&&!(t in e))&&Lu(e,t,n)}function ju(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),i?Lu(n,s,c):Nu(n,s,c)}return n}function Bu(e){return null!=e&&"object"==typeof e}function Uu(e){return Bu(e)&&"[object Arguments]"==ou(e)}var Vu=Object.prototype,Fu=Vu.hasOwnProperty,zu=Vu.propertyIsEnumerable,Hu=Uu(function(){return arguments}())?Uu:function(e){return Bu(e)&&Fu.call(e,"callee")&&!zu.call(e,"callee")},qu=Hu,Gu=Array.isArray;var Wu="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ju=Wu&&e&&!e.nodeType&&e,$u=Ju&&Ju.exports===Wu?Kc.Buffer:void 0,Ku=($u?$u.isBuffer:void 0)||function(){return!1},Qu=9007199254740991,Yu=/^(?:0|[1-9]\d*)$/;function Xu(e,t){var n=typeof e;return!!(t=null==t?Qu:t)&&("number"==n||"symbol"!=n&&Yu.test(e))&&e>-1&&e%1==0&&e<t}var el=9007199254740991;function tl(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=el}var nl={};function rl(e){return function(t){return e(t)}}
2nl["[object Float32Array]"]=nl["[object Float64Array]"]=nl["[object Int8Array]"]=nl["[object Int16Array]"]=nl["[object Int32Array]"]=nl["[object Uint8Array]"]=nl["[object Uint8ClampedArray]"]=nl["[object Uint16Array]"]=nl["[object Uint32Array]"]=!0,nl["[object Arguments]"]=nl["[object Array]"]=nl["[object ArrayBuffer]"]=nl["[object Boolean]"]=nl["[object DataView]"]=nl["[object Date]"]=nl["[object Error]"]=nl["[object Function]"]=nl["[object Map]"]=nl["[object Number]"]=nl["[object Object]"]=nl["[object RegExp]"]=nl["[object Set]"]=nl["[object String]"]=nl["[object WeakMap]"]=!1;var il="object"==typeof exports&&exports&&!exports.nodeType&&exports,al=il&&e&&!e.nodeType&&e,ol=al&&al.exports===il&&Jc.process,sl=function(){try{return al&&al.require&&al.require("util").types||ol&&ol.binding&&ol.binding("util")}catch(e){}}(),cl=sl&&sl.isTypedArray,ul=cl?rl(cl):function(e){return Bu(e)&&tl(e.length)&&!!nl[ou(e)]},ll=ul,dl=Object.prototype.hasOwnProperty;function pl(e,t){var n=Gu(e),r=!n&&qu(e),i=!n&&!r&&Ku(e),a=!n&&!r&&!i&&ll(e),o=n||r||i||a,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var u in e)(t||dl.call(e,u))&&(!o||!("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Xu(u,c)))&&s.push(u);return s}var hl=Object.prototype;function fl(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||hl)}function vl(e,t){return function(n){return e(t(n))}}var ml=vl(Object.keys,Object),gl=Object.prototype.hasOwnProperty;function yl(e){if(!fl(e))return ml(e);var t=[];for(var n in Object(e))gl.call(e,n)&&"constructor"!=n&&t.push(n);return t}function bl(e){return null!=e&&tl(e.length)&&!pu(e)}function kl(e){return bl(e)?pl(e):yl(e)}var _l=Object.prototype.hasOwnProperty;function wl(e){if(!su(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=fl(e),n=[];for(var r in e)"constructor"==r&&(t||!_l.call(e,r))||n.push(r);return n}function xl(e){return bl(e)?pl(e,!0):wl(e)}var Sl="object"==typeof exports&&exports&&!exports.nodeType&&exports,El=Sl&&e&&!e.nodeType&&e,Tl=El&&El.exports===Sl?Kc.Buffer:void 0,Pl=Tl?Tl.allocUnsafe:void 0;function Cl(){return[]}var Rl=Object.prototype.propertyIsEnumerable,Zl=Object.getOwnPropertySymbols,Ml=Zl?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}(Zl(e),(function(t){return Rl.call(e,t)})))}:Cl,Al=Ml;function Il(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Ol=vl(Object.getPrototypeOf,Object),Ll=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Il(t,Al(e)),e=Ol(e);return t}:Cl,Dl=Ll;function Nl(e,t,n){var r=t(e);return Gu(e)?r:Il(r,n(e))}function jl(e){return Nl(e,kl,Al)}function Bl(e){return Nl(e,xl,Dl)}var Ul=Su(Kc,"DataView"),Vl=Su(Kc,"Promise"),Fl=Su(Kc,"Set"),zl=Su(Kc,"WeakMap"),Hl="[object Map]",ql="[object Promise]",Gl="[object Set]",Wl="[object WeakMap]",Jl="[object DataView]",$l=mu(Ul),Kl=mu(Eu),Ql=mu(Vl),Yl=mu(Fl),Xl=mu(zl),ed=ou;(Ul&&ed(new Ul(new ArrayBuffer(1)))!=Jl||Eu&&ed(new Eu)!=Hl||Vl&&ed(Vl.resolve())!=ql||Fl&&ed(new Fl)!=Gl||zl&&ed(new zl)!=Wl)&&(ed=function(e){var t=ou(e),n="[object Object]"==t?e.constructor:void 0,r=n?mu(n):"";if(r)switch(r){case $l:return Jl;case Kl:return Hl;case Ql:return ql;case Yl:return Gl;case Xl:return Wl}return t});var td=ed,nd=Object.prototype.hasOwnProperty;var rd=Kc.Uint8Array;function id(e){var t=new e.constructor(e.byteLength);return new rd(t).set(new rd(e)),t}var ad=/\w*$/;
2var od=Qc?Qc.prototype:void 0,sd=od?od.valueOf:void 0;var cd="[object Boolean]",ud="[object Date]",ld="[object Map]",dd="[object Number]",pd="[object RegExp]",hd="[object Set]",fd="[object String]",vd="[object Symbol]",md="[object ArrayBuffer]",gd="[object DataView]",yd="[object Float32Array]",bd="[object Float64Array]",kd="[object Int8Array]",_d="[object Int16Array]",wd="[object Int32Array]",xd="[object Uint8Array]",Sd="[object Uint8ClampedArray]",Ed="[object Uint16Array]",Td="[object Uint32Array]";function Pd(e,t,n){var r=e.constructor;switch(t){case md:return id(e);case cd:case ud:return new r(+e);case gd:return function(e,t){var n=t?id(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case yd:case bd:case kd:case _d:case wd:case xd:case Sd:case Ed:case Td:return function(e,t){var n=t?id(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case ld:return new r;case dd:case fd:return new r(e);case pd:return function(e){var t=new e.constructor(e.source,ad.exec(e));return t.lastIndex=e.lastIndex,t}(e);case hd:return new r;case vd:return function(e){return sd?Object(sd.call(e)):{}}(e)}}var Cd=Object.create,Rd=function(){function e(){}return function(t){if(!su(t))return{};if(Cd)return Cd(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Zd=Rd;var Md=sl&&sl.isMap,Ad=Md?rl(Md):function(e){return Bu(e)&&"[object Map]"==td(e)},Id=Ad;var Od=sl&&sl.isSet,Ld=Od?rl(Od):function(e){return Bu(e)&&"[object Set]"==td(e)},Dd=Ld,Nd=1,jd=2,Bd=4,Ud="[object Arguments]",Vd="[object Function]",Fd="[object GeneratorFunction]",zd="[object Object]",Hd={};function qd(e,t,n,r,i,a){var o,s=t&Nd,c=t&jd,u=t&Bd;if(n&&(o=i?n(e,r,i,a):n(e)),void 0!==o)return o;if(!su(e))return e;var l=Gu(e);if(l){if(o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&nd.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,o)}else{var d=td(e),p=d==Vd||d==Fd;if(Ku(e))return function(e,t){if(t)return e.slice();var n=e.length,r=Pl?Pl(n):new e.constructor(n);return e.copy(r),r}(e,s);if(d==zd||d==Ud||p&&!i){if(o=c||p?{}:function(e){return"function"!=typeof e.constructor||fl(e)?{}:Zd(Ol(e))}(e),!s)return c?function(e,t){return ju(e,Dl(e),t)}(e,function(e,t){return e&&ju(t,xl(t),e)}(o,e)):function(e,t){return ju(e,Al(e),t)}(e,function(e,t){return e&&ju(t,kl(t),e)}(o,e))}else{if(!Hd[d])return i?e:{};o=Pd(e,d,s)}}a||(a=new Au);var h=a.get(e);if(h)return h;a.set(e,o),Dd(e)?e.forEach((function(r){o.add(qd(r,t,n,r,e,a))})):Id(e)&&e.forEach((function(r,i){o.set(i,qd(r,t,n,i,e,a))}));var f=l?void 0:(u?c?Bl:jl:c?xl:kl)(e);return function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););}(f||e,(function(r,i){f&&(r=e[i=r]),Nu(o,i,qd(r,t,n,i,e,a))})),o}Hd[Ud]=Hd["[object Array]"]=Hd["[object ArrayBuffer]"]=Hd["[object DataView]"]=Hd["[object Boolean]"]=Hd["[object Date]"]=Hd["[object Float32Array]"]=Hd["[object Float64Array]"]=Hd["[object Int8Array]"]=Hd["[object Int16Array]"]=Hd["[object Int32Array]"]=Hd["[object Map]"]=Hd["[object Number]"]=Hd[zd]=Hd["[object RegExp]"]=Hd["[object Set]"]=Hd["[object String]"]=Hd["[object Symbol]"]=Hd["[object Uint8Array]"]=Hd["[object Uint8ClampedArray]"]=Hd["[object Uint16Array]"]=Hd["[object Uint32Array]"]=!0,Hd["[object Error]"]=Hd[Vd]=Hd["[object WeakMap]"]=!1;var Gd=1,Wd=4;function Jd(e){return qd(e,Gd|Wd)}var $d="[object Symbol]";var Kd,Qd,Yd,Xd,ep,tp="Expected a function";function np(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(tp);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(np.Cache||Mu),n}np.Cache=Mu,function(e){e.GroupCall="GROUP_CALL",e.Webinar="WEBINAR",e.AudioRoom="AUDIO_ROOM",e.Livestream="LIVESTREAM"}(Kd||(Kd={})),function(e){e.Skip="SKIP",e.OnPrivilegedUserEntry="ON_PRIVILEGED_USER_ENTRY",e.SkipOnAccept="SKIP_ON_ACCEPT"}(Qd||(Qd={})),function(e){e.Allowed="ALLOWED",e.NotAllowed="NOT_ALLOWED",e.CanRequest="CAN_REQUEST"}(Yd||(Yd={})),function(e){e.Allowed="ALLOWED",e.NotAllowed="NOT_ALLOWED"}(Xd||(Xd={})),function(e){e.FULL_ACCESS="FULL_ACCESS",e.VIEW_ONLY="VIEW_ONLY"}(ep||(ep={}));
2var rp={border_radius:"rounded",border_width:"thin",spacing_base:4,theme:"dark",colors:{brand:function(e){var t=zc(e,Bc),n=(0,d.Z)(t,5);return{300:n[0],400:n[1],500:n[2],600:n[3],700:n[4]}}("#2160FD"),background:function(e){var t=zc(e,Uc),n=(0,d.Z)(t,5);return{1e3:n[0],900:n[1],800:n[2],700:n[3],600:n[4]}}("#141414"),danger:"#FF2D2D",text:"#EEEEEE",text_on_brand:"#EEEEEE",success:"#62A504",video_bg:"#191919",warning:"#FFCD07"}};function ip(){return Jd(rp)}var ap={permissions:{can_accept_production_requests:!1,can_edit_display_name:!0,accept_waiting_requests:!1,disable_participant_audio:!1,disable_participant_screensharing:!1,disable_participant_video:!1,can_spotlight:!1,kick_participant:!1,pin_participant:!1,can_record:!1,can_livestream:!1,waiting_room_type:Qd.Skip,plugins:{can_close:!0,can_start:!0,can_edit_config:!1,config:{}},polls:{can_create:!0,can_vote:!0,can_view:!0},media:{video:{can_produce:Yd.Allowed,can_consume:Xd.Allowed},audio:{can_produce:Yd.Allowed},screenshare:{can_produce:Yd.Allowed,can_consume:Xd.Allowed}},chat:{public:{can_send:!0,text:!0,files:!0},private:{can_send:!1,can_receive:!1,text:!1,files:!1}},hidden_participant:!1,is_recorder:!1,recorder_type:Cc.none,show_participant_list:!0,can_change_participant_permissions:!1,connected_meetings:{can_alter_connected_meetings:!1,can_switch_connected_meetings:!1,can_switch_to_parent_meeting:!1}},ui:{oldTheme:{setup_screen:{is_enabled:!1},alone_here:{is_enabled:!1},waiting_room:{is_enabled:!1,enable_preview:!0},control_bar:{is_enabled:!0,elements:{plugins:!0,screenshare:!0,invite:!1,participants:!0,chat:!0,reactions:!1,polls:!0,fullscreen:!0,layout:!0}},header:{is_enabled:!0,elements:{timer:!0,title:!0,participant_count:!0,change_layout:!0}},pip_mode:!0,auto_tune:!0,colors:{primary:"#2160FD",secondary:"#1A1A1A",text:"#EEEEEE",background:"#1A1A1A",textPrimary:"#EEEEEE",videoBackground:"#1A1A1A"},dimensions:{mode:"fillParent"},grid:{multi:{maxVideoCount:6,videoFit:"cover"},single:{maxVideoCount:6,videoFit:"cover"},defaultView:"MULTI"},controls:{pip_toggle:!1},plugins:[]},design_tokens:ip(),config_diff:{}},config:{view_type:Kd.GroupCall,media:{video:{quality:"vga",frame_rate:24},screenshare:{quality:"hd",frame_rate:5}},max_video_streams:{mobile:6,desktop:6},max_screenshare_count:1},version:"hybrid"};Cc.none,Pc.skip;var op={permissions:{can_accept_production_requests:!1,can_edit_display_name:!0,accept_waiting_requests:!1,disable_participant_audio:!1,disable_participant_screensharing:!1,disable_participant_video:!1,can_spotlight:!1,kick_participant:!1,pin_participant:!1,can_record:!1,can_livestream:!1,waiting_room_type:Qd.Skip,plugins:{can_close:!0,can_start:!0,can_edit_config:!1,config:{}},polls:{can_create:!0,can_vote:!0,can_view:!0},media:{video:{can_produce:Yd.Allowed},audio:{can_produce:Yd.Allowed},screenshare:{can_produce:Yd.Allowed}},chat:{public:{can_send:!0,text:!0,files:!0},private:{can_send:!1,can_receive:!1,text:!1,files:!1}},hidden_participant:!1,is_recorder:!1,recorder_type:Cc.none,show_participant_list:!0,can_change_participant_permissions:!1,connected_meetings:{can_alter_connected_meetings:!1,can_switch_connected_meetings:!1,can_switch_to_parent_meeting:!1}},ui:{design_tokens:ip(),config_diff:{}},config:{view_type:Kd.GroupCall,media:{video:{quality:"vga",frame_rate:24},screenshare:{quality:"hd",frame_rate:5}},max_video_streams:{mobile:6,desktop:6},max_screenshare_count:1},version:"2.0.0"};function sp(){return Jd(op)}var cp,up,lp={},dp={get exports(){return lp},set exports(e){lp=e}};function pp(){if(up)return cp;up=1;var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,a=365.25*r;function o(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return cp=function(s,c){c=c||{};var u=typeof s;if("string"===u&&s.length>0)return function(o){if(o=String(o),!(o.length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(s){var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*a;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}(s);if("number"===u&&isFinite(s))return c.long?function(i){var a=Math.abs(i);return a>=r?o(i,a,r,"day"):a>=n?o(i,a,n,"hour"):a>=t?o(i,a,t,"minute"):a>=e?o(i,a,e,"second"):i+" ms"}(s):function(i){var a=Math.abs(i);return a>=r?Math.round(i/r)+"d":a>=n?Math.round(i/n)+"h":a>=t?Math.round(i/t)+"m":a>=e?Math.round(i/e)+"s":i+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}var hp=function(e){function t(e){var r,i,a,o=null;function s(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(s.enabled){var a=s,o=Number(new Date),c=o-(r||o);a.diff=c,a.prev=r,a.curr=o,r=o,n[0]=t.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var u=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(e,r){if("%%"===e)return"%";u++;var i=t.formatters[r];if("function"==typeof i){var o=n[u];e=i.call(a,o),n.splice(u,1),u--}return e})),t.formatArgs.call(a,n),(a.log||t.log).apply(a,n)}}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==o?o:(i!==t.namespaces&&(i=t.namespaces,a=t.enabled(e)),a)},set:function(e){o=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){var r=t(this.namespace+("undefined"==typeof n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){var e=[].concat((0,o.Z)(t.names.map(r)),(0,o.Z)(t.skips.map(r).map((function(e){return"-"+e})))).join(",");return t.enable(""),e},t.enable=function(e){var n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=pp(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(n){t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(n){}return!e&&"undefined"!=typeof process&&"env"in process&&(e={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SERVER_URL:"https://dyte-audio.fly.dev"}.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&
2("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=hp(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(dp,lp);var fp="mediasoup-client",vp=function(){function e(t){(0,g.Z)(this,e),t?(this._debug=lp("".concat(fp,":").concat(t)),this._warn=lp("".concat(fp,":WARN:").concat(t)),this._error=lp("".concat(fp,":ERROR:").concat(t))):(this._debug=lp(fp),this._warn=lp("".concat(fp,":WARN")),this._error=lp("".concat(fp,":ERROR"))),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}return(0,y.Z)(e,[{key:"debug",get:function(){return this._debug}},{key:"warn",get:function(){return this._warn}},{key:"error",get:function(){return this._error}}]),e}(),mp=new vp("EnhancedEventEmitter"),gp=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this)).setMaxListeners(1/0),e}return(0,y.Z)(n,[{key:"emit",value:function(e){for(var t,r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return(t=l((0,u.Z)(n.prototype),"emit",this)).call.apply(t,[this,e].concat(i))}},{key:"safeEmit",value:function(e){var t=l((0,u.Z)(n.prototype),"listenerCount",this).call(this,e);try{for(var r,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return(r=l((0,u.Z)(n.prototype),"emit",this)).call.apply(r,[this,e].concat(a))}catch(E){return mp.error("safeEmit() | event listener threw an error [eventName:%s]:%o",e,E),Boolean(t)}}},{key:"on",value:function(e,t){return l((0,u.Z)(n.prototype),"on",this).call(this,e,t),this}},{key:"off",value:function(e,t){return l((0,u.Z)(n.prototype),"off",this).call(this,e,t),this}},{key:"addListener",value:function(e,t){return l((0,u.Z)(n.prototype),"on",this).call(this,e,t),this}},{key:"prependListener",value:function(e,t){return l((0,u.Z)(n.prototype),"prependListener",this).call(this,e,t),this}},{key:"once",value:function(e,t){return l((0,u.Z)(n.prototype),"once",this).call(this,e,t),this}},{key:"prependOnceListener",value:function(e,t){return l((0,u.Z)(n.prototype),"prependOnceListener",this).call(this,e,t),this}},{key:"removeListener",value:function(e,t){return l((0,u.Z)(n.prototype),"off",this).call(this,e,t),this}},{key:"removeAllListeners",value:function(e){return l((0,u.Z)(n.prototype),"removeAllListeners",this).call(this,e),this}},{key:"listenerCount",value:function(e){return l((0,u.Z)(n.prototype),"listenerCount",this).call(this,e)}},{key:"listeners",value:function(e){return l((0,u.Z)(n.prototype),"listeners",this).call(this,e)}},{key:"rawListeners",value:function(e){return l((0,u.Z)(n.prototype),"rawListeners",this).call(this,e)}}]),n}(Ns.EventEmitter),yp=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,e)).name="UnsupportedError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace((0,f.Z)(r),n):r.stack=new Error(e).stack,r}return(0,y.Z)(n)}((0,a.Z)(Error)),bp=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,e)).name="InvalidStateError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace((0,f.Z)(r),n):r.stack=new Error(e).stack,r}return(0,y.Z)(n)}((0,a.Z)(Error));function kp(e,t){return"undefined"==typeof e?t:JSON.parse(JSON.stringify(e))}function _p(){return Math.round(1e7*Math.random())}var wp={};!function(e){var t=lp("h264-profile-level-id");t.log=console.info.bind(console);e.ProfileConstrainedBaseline=1,e.ProfileBaseline=2,e.ProfileMain=3,e.ProfileConstrainedHigh=4,e.ProfileHigh=5;var n=0,r=10;
2e.Level1_b=n,e.Level1=r,e.Level1_1=11,e.Level1_2=12,e.Level1_3=13,e.Level2=20,e.Level2_1=21,e.Level2_2=22,e.Level3=30,e.Level3_1=31,e.Level3_2=32,e.Level4=40,e.Level4_1=41,e.Level4_2=42,e.Level5=50,e.Level5_1=51,e.Level5_2=52;var i=(0,y.Z)((function e(t,n){(0,g.Z)(this,e),this.profile=t,this.level=n}));e.ProfileLevelId=i;var a=new i(1,31),o=function(){function e(t){(0,g.Z)(this,e),this._mask=~u("x",t),this._maskedValue=u("1",t)}return(0,y.Z)(e,[{key:"isMatch",value:function(e){return this._maskedValue===(e&this._mask)}}]),e}(),s=(0,y.Z)((function e(t,n,r){(0,g.Z)(this,e),this.profile_idc=t,this.profile_iop=n,this.profile=r})),c=[new s(66,new o("x1xx0000"),1),new s(77,new o("1xxx0000"),1),new s(88,new o("11xx0000"),1),new s(66,new o("x0xx0000"),2),new s(88,new o("10xx0000"),2),new s(77,new o("0x0x0000"),3),new s(100,new o("00000000"),5),new s(100,new o("00001100"),4)];function u(e,t){return(t[0]===e)<<7|(t[1]===e)<<6|(t[2]===e)<<5|(t[3]===e)<<4|(t[4]===e)<<3|(t[5]===e)<<2|(t[6]===e)<<1|(t[7]===e)<<0}function l(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})["level-asymmetry-allowed"];return 1===e||"1"===e}e.parseProfileLevelId=function(e){if("string"!=typeof e||6!==e.length)return null;var a=parseInt(e,16);if(0===a)return null;var o,s=255&a,u=a>>8&255,l=a>>16&255;switch(s){case 11:o=16&u?n:11;break;case r:case 12:case 13:case 20:case 21:case 22:case 30:case 31:case 32:case 40:case 41:case 42:case 50:case 51:case 52:o=s;break;default:return t("parseProfileLevelId() | unrecognized level_idc:%s",s),null}for(var d=0,p=c;d<p.length;d++){var h=p[d];if(l===h.profile_idc&&h.profile_iop.isMatch(u))return new i(h.profile,o)}return t("parseProfileLevelId() | unrecognized profile_idc/profile_iop combination"),null},e.profileLevelIdToString=function(e){if(e.level==n)switch(e.profile){case 1:return"42f00b";case 2:return"42100b";case 3:return"4d100b";default:return t("profileLevelIdToString() | Level 1_b not is allowed for profile:%s",e.profile),null}var r;switch(e.profile){case 1:r="42e0";break;case 2:r="4200";break;case 3:r="4d00";break;case 4:r="640c";break;case 5:r="6400";break;default:return t("profileLevelIdToString() | unrecognized profile:%s",e.profile),null}var i=e.level.toString(16);return 1===i.length&&(i="0".concat(i)),"".concat(r).concat(i)},e.parseSdpProfileLevelId=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})["profile-level-id"];return t?e.parseProfileLevelId(t):a},e.isSameProfile=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.parseSdpProfileLevelId(t),i=e.parseSdpProfileLevelId(n);return Boolean(r&&i&&r.profile===i.profile)},e.generateProfileLevelIdForAnswer=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!a["profile-level-id"]&&!o["profile-level-id"])return t("generateProfileLevelIdForAnswer() | no profile-level-id in local and remote params"),null;var s=e.parseSdpProfileLevelId(a),c=e.parseSdpProfileLevelId(o);if(!s)throw new TypeError("invalid local_profile_level_id");if(!c)throw new TypeError("invalid remote_profile_level_id");if(s.profile!==c.profile)throw new TypeError("H264 Profile mismatch");var u=l(a)&&l(o),d=s.level,p=function(e,t){return function(e,t){return e===n?t!==r&&t!==n:t===n?e!==r:e<t}(e,t)?e:t}(d,c.level),h=u?d:p;return t("generateProfileLevelIdForAnswer() | result: [profile:%s, level:%s]",s.profile,h),e.profileLevelIdToString(new i(s.profile,h))}}(wp);function xp(e){if("object"!=typeof e)throw new TypeError("caps is not an object");if(e.codecs&&!Array.isArray(e.codecs))throw new TypeError("caps.codecs is not an array");e.codecs||(e.codecs=[]);var t,n=(0,c.Z)(e.codecs);try{for(n.s();!(t=n.n()).done;){Sp(t.value)}}catch(xC){n.e(xC)}finally{n.f()}if(e.headerExtensions&&!Array.isArray(e.headerExtensions))throw new TypeError("caps.headerExtensions is not an array");e.headerExtensions||(e.headerExtensions=[]);var r,i=(0,c.Z)(e.headerExtensions);try{for(i.s();!(r=i.n()).done;){Tp(r.value)}}
2catch(xC){i.e(xC)}finally{i.f()}}function Sp(e){var t=new RegExp("^(audio|video)/(.+)","i");if("object"!=typeof e)throw new TypeError("codec is not an object");if(!e.mimeType||"string"!=typeof e.mimeType)throw new TypeError("missing codec.mimeType");var n=t.exec(e.mimeType);if(!n)throw new TypeError("invalid codec.mimeType");if(e.kind=n[1].toLowerCase(),e.preferredPayloadType&&"number"!=typeof e.preferredPayloadType)throw new TypeError("invalid codec.preferredPayloadType");if("number"!=typeof e.clockRate)throw new TypeError("missing codec.clockRate");"audio"===e.kind?"number"!=typeof e.channels&&(e.channels=1):delete e.channels,(!e.parameters||"object"!=typeof e.parameters)&&(e.parameters={});for(var r=0,i=Object.keys(e.parameters);r<i.length;r++){var a=i[r],o=e.parameters[a];if(void 0===o&&(e.parameters[a]="",o=""),"string"!=typeof o&&"number"!=typeof o)throw new TypeError("invalid codec parameter [key:".concat(a,"s, value:").concat(o,"]"));if("apt"===a&&"number"!=typeof o)throw new TypeError("invalid codec apt parameter")}(!e.rtcpFeedback||!Array.isArray(e.rtcpFeedback))&&(e.rtcpFeedback=[]);var s,u=(0,c.Z)(e.rtcpFeedback);try{for(u.s();!(s=u.n()).done;){Ep(s.value)}}catch(xC){u.e(xC)}finally{u.f()}}function Ep(e){if("object"!=typeof e)throw new TypeError("fb is not an object");if(!e.type||"string"!=typeof e.type)throw new TypeError("missing fb.type");(!e.parameter||"string"!=typeof e.parameter)&&(e.parameter="")}function Tp(e){if("object"!=typeof e)throw new TypeError("ext is not an object");if("audio"!==e.kind&&"video"!==e.kind)throw new TypeError("invalid ext.kind");if(!e.uri||"string"!=typeof e.uri)throw new TypeError("missing ext.uri");if("number"!=typeof e.preferredId)throw new TypeError("missing ext.preferredId");if(e.preferredEncrypt&&"boolean"!=typeof e.preferredEncrypt)throw new TypeError("invalid ext.preferredEncrypt");if(e.preferredEncrypt||(e.preferredEncrypt=!1),e.direction&&"string"!=typeof e.direction)throw new TypeError("invalid ext.direction");e.direction||(e.direction="sendrecv")}function Pp(e){if("object"!=typeof e)throw new TypeError("params is not an object");if(e.mid&&"string"!=typeof e.mid)throw new TypeError("params.mid is not a string");if(!Array.isArray(e.codecs))throw new TypeError("missing params.codecs");var t,n=(0,c.Z)(e.codecs);try{for(n.s();!(t=n.n()).done;){Cp(t.value)}}catch(xC){n.e(xC)}finally{n.f()}if(e.headerExtensions&&!Array.isArray(e.headerExtensions))throw new TypeError("params.headerExtensions is not an array");e.headerExtensions||(e.headerExtensions=[]);var r,i=(0,c.Z)(e.headerExtensions);try{for(i.s();!(r=i.n()).done;){Rp(r.value)}}catch(xC){i.e(xC)}finally{i.f()}if(e.encodings&&!Array.isArray(e.encodings))throw new TypeError("params.encodings is not an array");e.encodings||(e.encodings=[]);var a,o=(0,c.Z)(e.encodings);try{for(o.s();!(a=o.n()).done;){Zp(a.value)}}catch(xC){o.e(xC)}finally{o.f()}if(e.rtcp&&"object"!=typeof e.rtcp)throw new TypeError("params.rtcp is not an object");e.rtcp||(e.rtcp={}),function(e){if("object"!=typeof e)throw new TypeError("rtcp is not an object");if(e.cname&&"string"!=typeof e.cname)throw new TypeError("invalid rtcp.cname");(!e.reducedSize||"boolean"!=typeof e.reducedSize)&&(e.reducedSize=!0)}(e.rtcp)}function Cp(e){var t=new RegExp("^(audio|video)/(.+)","i");if("object"!=typeof e)throw new TypeError("codec is not an object");if(!e.mimeType||"string"!=typeof e.mimeType)throw new TypeError("missing codec.mimeType");var n=t.exec(e.mimeType);if(!n)throw new TypeError("invalid codec.mimeType");if("number"!=typeof e.payloadType)throw new TypeError("missing codec.payloadType");if("number"!=typeof e.clockRate)throw new TypeError("missing codec.clockRate");"audio"===n[1].toLowerCase()?"number"!=typeof e.channels&&(e.channels=1):delete e.channels,(!e.parameters||"object"!=typeof e.parameters)&&(e.parameters={});for(var r=0,i=Object.keys(e.parameters);r<i.length;r++){var a=i[r],o=e.parameters[a];if(void 0===o&&(e.parameters[a]="",o=""),"string"!=typeof o&&"number"!=typeof o)throw new TypeError("invalid codec parameter [key:".concat(a,"s, value:").concat(o,"]"));if("apt"===a&&"number"!=typeof o)throw new TypeError("invalid codec apt parameter")}(!e.rtcpFeedback||!Array.isArray(e.rtcpFeedback))&&(e.rtcpFeedback=[]);var s,u=(0,c.Z)(e.rtcpFeedback);try{for(u.s();!(s=u.n()).done;){Ep(s.value)}}catch(xC){u.e(xC)}finally{u.f()}}function Rp(e){if("object"!=typeof e)throw new TypeError("ext is not an object");
2if(!e.uri||"string"!=typeof e.uri)throw new TypeError("missing ext.uri");if("number"!=typeof e.id)throw new TypeError("missing ext.id");if(e.encrypt&&"boolean"!=typeof e.encrypt)throw new TypeError("invalid ext.encrypt");e.encrypt||(e.encrypt=!1),(!e.parameters||"object"!=typeof e.parameters)&&(e.parameters={});for(var t=0,n=Object.keys(e.parameters);t<n.length;t++){var r=n[t],i=e.parameters[r];if(void 0===i&&(e.parameters[r]="",i=""),"string"!=typeof i&&"number"!=typeof i)throw new TypeError("invalid header extension parameter")}}function Zp(e){if("object"!=typeof e)throw new TypeError("encoding is not an object");if(e.ssrc&&"number"!=typeof e.ssrc)throw new TypeError("invalid encoding.ssrc");if(e.rid&&"string"!=typeof e.rid)throw new TypeError("invalid encoding.rid");if(e.rtx&&"object"!=typeof e.rtx)throw new TypeError("invalid encoding.rtx");if(e.rtx&&"number"!=typeof e.rtx.ssrc)throw new TypeError("missing encoding.rtx.ssrc");if((!e.dtx||"boolean"!=typeof e.dtx)&&(e.dtx=!1),e.scalabilityMode&&"string"!=typeof e.scalabilityMode)throw new TypeError("invalid encoding.scalabilityMode")}function Mp(e){if("object"!=typeof e)throw new TypeError("caps is not an object");if(!e.numStreams||"object"!=typeof e.numStreams)throw new TypeError("missing caps.numStreams");!function(e){if("object"!=typeof e)throw new TypeError("numStreams is not an object");if("number"!=typeof e.OS)throw new TypeError("missing numStreams.OS");if("number"!=typeof e.MIS)throw new TypeError("missing numStreams.MIS")}(e.numStreams)}function Ap(e){if("object"!=typeof e)throw new TypeError("params is not an object");if("number"!=typeof e.streamId)throw new TypeError("missing params.streamId");var t=!1;if("boolean"==typeof e.ordered?t=!0:e.ordered=!0,e.maxPacketLifeTime&&"number"!=typeof e.maxPacketLifeTime)throw new TypeError("invalid params.maxPacketLifeTime");if(e.maxRetransmits&&"number"!=typeof e.maxRetransmits)throw new TypeError("invalid params.maxRetransmits");if(e.maxPacketLifeTime&&e.maxRetransmits)throw new TypeError("cannot provide both maxPacketLifeTime and maxRetransmits");if(t&&e.ordered&&(e.maxPacketLifeTime||e.maxRetransmits))throw new TypeError("cannot be ordered with maxPacketLifeTime or maxRetransmits");if(!t&&(e.maxPacketLifeTime||e.maxRetransmits)&&(e.ordered=!1),e.label&&"string"!=typeof e.label)throw new TypeError("invalid params.label");if(e.protocol&&"string"!=typeof e.protocol)throw new TypeError("invalid params.protocol")}function Ip(e,t){var n,r={codecs:[],headerExtensions:[]},i=(0,c.Z)(t.codecs||[]);try{var a=function(){var t=n.value;if(Vp(t))return"continue";var i=(e.codecs||[]).find((function(e){return Fp(e,t,{strict:!0,modify:!0})}));if(!i)return"continue";var a={mimeType:i.mimeType,kind:i.kind,clockRate:i.clockRate,channels:i.channels,localPayloadType:i.preferredPayloadType,localRtxPayloadType:void 0,remotePayloadType:t.preferredPayloadType,remoteRtxPayloadType:void 0,localParameters:i.parameters,remoteParameters:t.parameters,rtcpFeedback:zp(i,t)};r.codecs.push(a)};for(i.s();!(n=i.n()).done;)a()}catch(xC){i.e(xC)}finally{i.f()}var o,s=(0,c.Z)(r.codecs);try{var u=function(){var n=o.value,r=e.codecs.find((function(e){return Vp(e)&&e.parameters.apt===n.localPayloadType})),i=t.codecs.find((function(e){return Vp(e)&&e.parameters.apt===n.remotePayloadType}));r&&i&&(n.localRtxPayloadType=r.preferredPayloadType,n.remoteRtxPayloadType=i.preferredPayloadType)};for(s.s();!(o=s.n()).done;)u()}catch(xC){s.e(xC)}finally{s.f()}var l,d=(0,c.Z)(t.headerExtensions);try{var p=function(){var t=l.value,n=e.headerExtensions.find((function(e){return function(e,t){return!(e.kind&&t.kind&&e.kind!==t.kind||e.uri!==t.uri)}(e,t)}));if(!n)return"continue";var i={kind:t.kind,uri:t.uri,sendId:n.preferredId,recvId:t.preferredId,encrypt:n.preferredEncrypt,direction:"sendrecv"};switch(t.direction){case"sendrecv":i.direction="sendrecv";break;case"recvonly":i.direction="sendonly";break;case"sendonly":i.direction="recvonly";break;case"inactive":i.direction="inactive"}r.headerExtensions.push(i)};for(d.s();!(l=d.n()).done;)p()}catch(xC){d.e(xC)}finally{d.f()}return r}function Op(e){var t,n={codecs:[],headerExtensions:[]},r=(0,c.Z)(e.codecs);try{for(r.s();!(t=r.n()).done;){var i=t.value,a={mimeType:i.mimeType,kind:i.kind,preferredPayloadType:i.remotePayloadType,clockRate:i.clockRate,channels:i.channels,parameters:i.localParameters,rtcpFeedback:i.rtcpFeedback};if(n.codecs.push(a),i.remoteRtxPayloadType){var o={mimeType:"".concat(i.kind,"/rtx"),kind:i.kind,preferredPayloadType:i.remoteRtxPayloadType,clockRate:i.clockRate,parameters:{apt:i.remotePayloadType},rtcpFeedback:[]};n.codecs.push(o)}}}catch(xC){r.e(xC)}finally{r.f()}var s,u=(0,c.Z)(e.headerExtensions);try{for(u.s();!(s=u.n()).done;){var l=s.value;if("sendrecv"===l.direction||"recvonly"===l.direction){var d={kind:l.kind,uri:l.uri,preferredId:l.recvId,preferredEncrypt:l.encrypt,direction:l.direction};n.headerExtensions.push(d)}}}catch(xC){u.e(xC)}finally{u.f()}return n}function Lp(e,t){var n,r={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}},i=(0,c.Z)(t.codecs);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.kind===e){var o={mimeType:a.mimeType,payloadType:a.localPayloadType,clockRate:a.clockRate,channels:a.channels,parameters:a.localParameters,rtcpFeedback:a.rtcpFeedback};if(r.codecs.push(o),a.localRtxPayloadType){var s={mimeType:"".concat(a.kind,"/rtx"),payloadType:a.localRtxPayloadType,clockRate:a.clockRate,parameters:{apt:a.localPayloadType},rtcpFeedback:[]};r.codecs.push(s)}}}}
2catch(xC){i.e(xC)}finally{i.f()}var u,l=(0,c.Z)(t.headerExtensions);try{for(l.s();!(u=l.n()).done;){var d=u.value;if(!(d.kind&&d.kind!==e||"sendrecv"!==d.direction&&"sendonly"!==d.direction)){var p={uri:d.uri,id:d.sendId,encrypt:d.encrypt,parameters:{}};r.headerExtensions.push(p)}}}catch(xC){l.e(xC)}finally{l.f()}return r}function Dp(e,t){var n,r={mid:void 0,codecs:[],headerExtensions:[],encodings:[],rtcp:{}},i=(0,c.Z)(t.codecs);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.kind===e){var o={mimeType:a.mimeType,payloadType:a.localPayloadType,clockRate:a.clockRate,channels:a.channels,parameters:a.remoteParameters,rtcpFeedback:a.rtcpFeedback};if(r.codecs.push(o),a.localRtxPayloadType){var s={mimeType:"".concat(a.kind,"/rtx"),payloadType:a.localRtxPayloadType,clockRate:a.clockRate,parameters:{apt:a.localPayloadType},rtcpFeedback:[]};r.codecs.push(s)}}}}catch(xC){i.e(xC)}finally{i.f()}var u,l=(0,c.Z)(t.headerExtensions);try{for(l.s();!(u=l.n()).done;){var d=u.value;if(!(d.kind&&d.kind!==e||"sendrecv"!==d.direction&&"sendonly"!==d.direction)){var p={uri:d.uri,id:d.sendId,encrypt:d.encrypt,parameters:{}};r.headerExtensions.push(p)}}}catch(xC){l.e(xC)}finally{l.f()}if(r.headerExtensions.some((function(e){return"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"===e.uri}))){var h,f=(0,c.Z)(r.codecs);try{for(f.s();!(h=f.n()).done;){var v=h.value;v.rtcpFeedback=(v.rtcpFeedback||[]).filter((function(e){return"goog-remb"!==e.type}))}}catch(xC){f.e(xC)}finally{f.f()}}else if(r.headerExtensions.some((function(e){return"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"===e.uri}))){var m,g=(0,c.Z)(r.codecs);try{for(g.s();!(m=g.n()).done;){var y=m.value;y.rtcpFeedback=(y.rtcpFeedback||[]).filter((function(e){return"transport-cc"!==e.type}))}}catch(xC){g.e(xC)}finally{g.f()}}else{var b,k=(0,c.Z)(r.codecs);try{for(k.s();!(b=k.n()).done;){var _=b.value;_.rtcpFeedback=(_.rtcpFeedback||[]).filter((function(e){return"transport-cc"!==e.type&&"goog-remb"!==e.type}))}}catch(xC){k.e(xC)}finally{k.f()}}return r}function Np(e,t){var n=[];if(t){for(var r=0;r<e.length;++r)if(Fp(e[r],t)){n.push(e[r]),Vp(e[r+1])&&n.push(e[r+1]);break}if(0===n.length)throw new TypeError("no matching codec found")}else n.push(e[0]),Vp(e[1])&&n.push(e[1]);return n}function jp(e){Pp(e=kp(e,{}));var t={mid:"probator",codecs:[],headerExtensions:[],encodings:[{ssrc:1234}],rtcp:{cname:"probator"}};return t.codecs.push(e.codecs[0]),t.codecs[0].payloadType=127,t.headerExtensions=e.headerExtensions,t}function Bp(e,t){return t.codecs.some((function(t){return t.kind===e}))}function Up(e,t){if(Pp(e),0===e.codecs.length)return!1;var n=e.codecs[0];return t.codecs.some((function(e){return e.remotePayloadType===n.payloadType}))}function Vp(e){return!!e&&/.+\/rtx$/i.test(e.mimeType)}function Fp(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.strict,i=void 0!==r&&r,a=n.modify,o=void 0!==a&&a,s=e.mimeType.toLowerCase();if(s!==t.mimeType.toLowerCase()||e.clockRate!==t.clockRate||e.channels!==t.channels)return!1;switch(s){case"video/h264":if(i){var c;if((e.parameters["packetization-mode"]||0)!==(t.parameters["packetization-mode"]||0)||!wp.isSameProfile(e.parameters,t.parameters))return!1;try{c=wp.generateProfileLevelIdForAnswer(e.parameters,t.parameters)}catch(u){return!1}
2o&&(c?(e.parameters["profile-level-id"]=c,t.parameters["profile-level-id"]=c):(delete e.parameters["profile-level-id"],delete t.parameters["profile-level-id"]))}break;case"video/vp9":if(i)if((e.parameters["profile-id"]||0)!==(t.parameters["profile-id"]||0))return!1}return!0}function zp(e,t){var n,r=[],i=(0,c.Z)(e.rtcpFeedback||[]);try{var a=function(){var e=n.value,i=(t.rtcpFeedback||[]).find((function(t){return t.type===e.type&&(t.parameter===e.parameter||!t.parameter&&!e.parameter)}));i&&r.push(i)};for(i.s();!(n=i.n()).done;)a()}catch(xC){i.e(xC)}finally{i.f()}return r}var Hp={},qp={},Gp=Ds&&Ds.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qp,"__esModule",{value:!0}),qp.Logger=void 0;var Wp=Gp(lp),Jp="awaitqueue",$p=function(){function e(t){(0,g.Z)(this,e),t?(this._debug=(0,Wp.default)("".concat(Jp,":").concat(t)),this._warn=(0,Wp.default)("".concat(Jp,":WARN:").concat(t)),this._error=(0,Wp.default)("".concat(Jp,":ERROR:").concat(t))):(this._debug=(0,Wp.default)(Jp),this._warn=(0,Wp.default)("".concat(Jp,":WARN")),this._error=(0,Wp.default)("".concat(Jp,":ERROR"))),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}return(0,y.Z)(e,[{key:"debug",get:function(){return this._debug}},{key:"warn",get:function(){return this._warn}},{key:"error",get:function(){return this._error}}]),e}();qp.Logger=$p,Object.defineProperty(Hp,"__esModule",{value:!0});var Kp=Hp.AwaitQueue=Hp.AwaitQueueRemovedTaskError=Hp.AwaitQueueStoppedError=void 0,Qp=new qp.Logger,Yp=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,null!=e?e:"AwaitQueue stopped")).name="AwaitQueueStoppedError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace((0,f.Z)(r),n),r}return(0,y.Z)(n)}((0,a.Z)(Error));Hp.AwaitQueueStoppedError=Yp;var Xp=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,null!=e?e:"AwaitQueue task removed")).name="AwaitQueueRemovedTaskError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace((0,f.Z)(r),n),r}return(0,y.Z)(n)}((0,a.Z)(Error));Hp.AwaitQueueRemovedTaskError=Xp;var eh,th=function(){function e(){(0,g.Z)(this,e),this.pendingTasks=new Map,this.nextTaskId=0,this.stopping=!1}return(0,y.Z)(e,[{key:"size",get:function(){return this.pendingTasks.size}},{key:"push",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null!=n?n:t.name,Qp.debug("push() [name:".concat(n,"]")),"function"==typeof t){e.next=2;break}throw new TypeError("given task is not a function");case 2:if(n)try{Object.defineProperty(t,"name",{value:n})}catch(i){}return e.abrupt("return",new Promise((function(e,i){var a={id:r.nextTaskId++,task:t,name:n,enqueuedAt:Date.now(),executedAt:void 0,completed:!1,resolve:function(t){if(!a.completed){a.completed=!0,r.pendingTasks.delete(a.id),Qp.debug("resolving task [name:".concat(a.name,"]")),e(t);var n=r.pendingTasks.values(),i=(0,d.Z)(n,1)[0];i&&!i.executedAt&&r.execute(i)}},reject:function(e){if(!a.completed&&(a.completed=!0,r.pendingTasks.delete(a.id),Qp.debug("rejecting task [name:".concat(a.name,"]: %s"),String(e)),i(e),!r.stopping)){var t=r.pendingTasks.values(),n=(0,d.Z)(t,1)[0];n&&!n.executedAt&&r.execute(n)}}};r.pendingTasks.set(a.id,a),1===r.pendingTasks.size&&r.execute(a)})));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"stop",value:function(){Qp.debug("stop()"),this.stopping=!0;var e,t=(0,c.Z)(this.pendingTasks.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;Qp.debug("stop() | stopping task [name:".concat(n.name,"]"))}}catch(xC){t.e(xC)}finally{t.f()}this.stopping=!1}},{key:"remove",value:function(e){Qp.debug("remove() [taskIdx:".concat(e,"]"));var t=Array.from(this.pendingTasks.values())[e];t?t.reject(new Xp):Qp.debug("stop() | no task with given idx [taskIdx:".concat(e,"]"))}},{key:"dump",value:function(){var e=Date.now(),t=0;return Array.from(this.pendingTasks.values()).map((function(n){return{idx:t++,task:n.task,name:n.name,enqueuedTime:n.executedAt?n.executedAt-n.enqueuedAt:e-n.enqueuedAt,executionTime:n.executedAt?e-n.executedAt:0}}))}},{key:"execute",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Qp.debug("execute() [name:".concat(t.name,"]")),!t.executedAt){e.next=2;break}throw new Error("task already being executed");case 2:return t.executedAt=Date.now(),e.prev=3,e.next=6,t.task();case 6:n=e.sent,t.resolve(n),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),t.reject(e.t0);case 13:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(t){return e.apply(this,arguments)}}()}]),e}();Kp=Hp.AwaitQueue=th;var nh="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:Ds):function(e){return(eh||(eh=Promise.resolve())).then(e).catch((function(e){return setTimeout((function(){throw e}
2),0)}))},rh=new vp("Producer"),ih=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.id,a=e.localId,o=e.rtpSender,s=e.track,c=e.rtpParameters,u=e.stopTracks,l=e.disableTrackOnPause,d=e.zeroRtpOnPause,p=e.appData;return(0,g.Z)(this,n),(r=t.call(this))._closed=!1,r._observer=new gp,rh.debug("constructor()"),r._id=i,r._localId=a,r._rtpSender=o,r._track=s,r._kind=s.kind,r._rtpParameters=c,r._paused=!!l&&!s.enabled,r._maxSpatialLayer=void 0,r._stopTracks=u,r._disableTrackOnPause=l,r._zeroRtpOnPause=d,r._appData=p||{},r.onTrackEnded=r.onTrackEnded.bind((0,f.Z)(r)),r.handleTrack(),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"localId",get:function(){return this._localId}},{key:"closed",get:function(){return this._closed}},{key:"kind",get:function(){return this._kind}},{key:"rtpSender",get:function(){return this._rtpSender}},{key:"track",get:function(){return this._track}},{key:"rtpParameters",get:function(){return this._rtpParameters}},{key:"paused",get:function(){return this._paused}},{key:"maxSpatialLayer",get:function(){return this._maxSpatialLayer}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"observer",get:function(){return this._observer}},{key:"close",value:function(){this._closed||(rh.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit("@close"),this._observer.safeEmit("close"))}},{key:"transportClosed",value:function(){this._closed||(rh.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}},{key:"getStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new bp("closed");case 2:return e.abrupt("return",new Promise((function(e,n){t.safeEmit("@getstats",e,n)})));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pause",value:function(){var e=this;rh.debug("pause()"),this._closed?rh.error("pause() | Producer closed"):(this._paused=!0,this._track&&this._disableTrackOnPause&&(this._track.enabled=!1),this._zeroRtpOnPause&&new Promise((function(t,n){e.safeEmit("@pause",t,n)})).catch((function(){})),this._observer.safeEmit("pause"))}},{key:"resume",value:function(){var e=this;rh.debug("resume()"),this._closed?rh.error("resume() | Producer closed"):(this._paused=!1,this._track&&this._disableTrackOnPause&&(this._track.enabled=!0),this._zeroRtpOnPause&&new Promise((function(t,n){e.safeEmit("@resume",t,n)})).catch((function(){})),this._observer.safeEmit("resume"))}},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.track,rh.debug("replaceTrack() [track:%o]",n),!this._closed){e.next=6;break}if(n&&this._stopTracks)try{n.stop()}catch(i){}throw new bp("closed");case 6:if(!n||"ended"!==n.readyState){e.next=8;break}throw new bp("track ended");case 8:if(n!==this._track){e.next=11;break}return rh.debug("replaceTrack() | same track, ignored"),e.abrupt("return");case 11:return e.next=13,new Promise((function(e,t){r.safeEmit("@replacetrack",n,e,t)}));case 13:this.destroyTrack(),this._track=n,this._track&&this._disableTrackOnPause&&(this._paused?this._paused&&(this._track.enabled=!1):this._track.enabled=!0),this.handleTrack();case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new bp("closed");case 2:if("video"===this._kind){e.next=4;break}throw new yp("not a video Producer");case 4:if("number"==typeof t){e.next=6;break}throw new TypeError("invalid spatialLayer");case 6:if(e.t0=t!==this._maxSpatialLayer,!e.t0){e.next=11;break}return e.next=10,new Promise((function(e,r){n.safeEmit("@setmaxspatiallayer",t,e,r)})).catch((function(){}));case 10:this._maxSpatialLayer=t;case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new bp("closed");case 2:if("object"==typeof t){e.next=4;break}throw new TypeError("invalid params");case 4:return e.next=6,new Promise((function(e,r){n.safeEmit("@setrtpencodingparameters",t,e,r)}));case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onTrackEnded",value:function(){rh.debug('track "ended" event'),this.safeEmit("trackended"),this._observer.safeEmit("trackended")}},{key:"handleTrack",value:function(){this._track&&this._track.addEventListener("ended",this.onTrackEnded)}},{key:"destroyTrack",value:function(){if(this._track)try{this._track.removeEventListener("ended",this.onTrackEnded),this._stopTracks&&this._track.stop()}catch(e){}}}]),n}(gp),ah=new vp("Consumer"),oh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.id,a=e.localId,o=e.producerId,s=e.rtpReceiver,c=e.track,u=e.rtpParameters,l=e.appData;return(0,g.Z)(this,n),(r=t.call(this))._closed=!1,r._observer=new gp,ah.debug("constructor()"),r._id=i,r._localId=a,r._producerId=o,r._rtpReceiver=s,r._track=c,r._rtpParameters=u,r._paused=!c.enabled,r._appData=l||{},r.onTrackEnded=r.onTrackEnded.bind((0,f.Z)(r)),r.handleTrack(),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"localId",get:function(){return this._localId}},{key:"producerId",get:function(){return this._producerId}},{key:"closed",get:function(){return this._closed}},{key:"kind",get:function(){return this._track.kind}},{key:"rtpReceiver",get:function(){return this._rtpReceiver}},{key:"track",get:function(){return this._track}},{key:"rtpParameters",get:function(){return this._rtpParameters}},{key:"paused",get:function(){return this._paused}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"observer",get:function(){return this._observer}},{key:"close",value:function(){this._closed||(ah.debug("close()"),this._closed=!0,this.destroyTrack(),this.emit
2("@close"),this._observer.safeEmit("close"))}},{key:"transportClosed",value:function(){this._closed||(ah.debug("transportClosed()"),this._closed=!0,this.destroyTrack(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}},{key:"getStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new bp("closed");case 2:return e.abrupt("return",new Promise((function(e,n){t.safeEmit("@getstats",e,n)})));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pause",value:function(){ah.debug("pause()"),this._closed?ah.error("pause() | Consumer closed"):this._paused?ah.debug("pause() | Consumer is already paused"):(this._paused=!0,this._track.enabled=!1,this.emit("@pause"),this._observer.safeEmit("pause"))}},{key:"resume",value:function(){ah.debug("resume()"),this._closed?ah.error("resume() | Consumer closed"):this._paused?(this._paused=!1,this._track.enabled=!0,this.emit("@resume"),this._observer.safeEmit("resume")):ah.debug("resume() | Consumer is already resumed")}},{key:"onTrackEnded",value:function(){ah.debug('track "ended" event'),this.safeEmit("trackended"),this._observer.safeEmit("trackended")}},{key:"handleTrack",value:function(){this._track.addEventListener("ended",this.onTrackEnded)}},{key:"destroyTrack",value:function(){try{this._track.removeEventListener("ended",this.onTrackEnded),this._track.stop()}catch(e){}}}]),n}(gp),sh=new vp("DataProducer"),ch=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.id,a=e.dataChannel,o=e.sctpStreamParameters,s=e.appData;return(0,g.Z)(this,n),(r=t.call(this))._closed=!1,r._observer=new gp,sh.debug("constructor()"),r._id=i,r._dataChannel=a,r._sctpStreamParameters=o,r._appData=s||{},r.handleDataChannel(),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"closed",get:function(){return this._closed}},{key:"sctpStreamParameters",get:function(){return this._sctpStreamParameters}},{key:"readyState",get:function(){return this._dataChannel.readyState}},{key:"label",get:function(){return this._dataChannel.label}},{key:"protocol",get:function(){return this._dataChannel.protocol}},{key:"bufferedAmount",get:function(){return this._dataChannel.bufferedAmount}},{key:"bufferedAmountLowThreshold",get:function(){return this._dataChannel.bufferedAmountLowThreshold},set:function(e){this._dataChannel.bufferedAmountLowThreshold=e}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"observer",get:function(){return this._observer}},{key:"close",value:function(){this._closed||(sh.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}},{key:"transportClosed",value:function(){this._closed||(sh.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}},{key:"send",value:function(e){if(sh.debug("send()"),this._closed)throw new bp("closed");this._dataChannel.send(e)}},{key:"handleDataChannel",value:function(){var e=this;this._dataChannel.addEventListener("open",(function(){e._closed||(sh.debug('DataChannel "open" event'),e.safeEmit("open"))})),this._dataChannel.addEventListener("error",(function(t){if(!e._closed){var n=t.error;n||(n=new Error("unknown DataChannel error")),"sctp-failure"===n.errorDetail?sh.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",n.sctpCauseCode,n.message):sh.error('DataChannel "error" event: %o',n),e.safeEmit("error",n)}})),this._dataChannel.addEventListener("close",(function(){e._closed||(sh.warn('DataChannel "close" event'),e._closed=!0,e.emit("@close"),e.safeEmit("close"),e._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(function(){e._closed||sh.warn('DataChannel "message" event in a DataProducer, message discarded')})),this._dataChannel.addEventListener("bufferedamountlow",(function(){e._closed||e.safeEmit("bufferedamountlow")}))}}]),n}(gp),uh=new vp("DataConsumer"),lh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.id,a=e.dataProducerId,o=e.dataChannel,s=e.sctpStreamParameters,c=e.appData;return(0,g.Z)(this,n),(r=t.call(this))._closed=!1,r._observer=new gp,uh.debug("constructor()"),r._id=i,r._dataProducerId=a,r._dataChannel=o,r._sctpStreamParameters=s,r._appData=c||{}
2,r.handleDataChannel(),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"dataProducerId",get:function(){return this._dataProducerId}},{key:"closed",get:function(){return this._closed}},{key:"sctpStreamParameters",get:function(){return this._sctpStreamParameters}},{key:"readyState",get:function(){return this._dataChannel.readyState}},{key:"label",get:function(){return this._dataChannel.label}},{key:"protocol",get:function(){return this._dataChannel.protocol}},{key:"binaryType",get:function(){return this._dataChannel.binaryType},set:function(e){this._dataChannel.binaryType=e}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"observer",get:function(){return this._observer}},{key:"close",value:function(){this._closed||(uh.debug("close()"),this._closed=!0,this._dataChannel.close(),this.emit("@close"),this._observer.safeEmit("close"))}},{key:"transportClosed",value:function(){this._closed||(uh.debug("transportClosed()"),this._closed=!0,this._dataChannel.close(),this.safeEmit("transportclose"),this._observer.safeEmit("close"))}},{key:"handleDataChannel",value:function(){var e=this;this._dataChannel.addEventListener("open",(function(){e._closed||(uh.debug('DataChannel "open" event'),e.safeEmit("open"))})),this._dataChannel.addEventListener("error",(function(t){if(!e._closed){var n=t.error;n||(n=new Error("unknown DataChannel error")),"sctp-failure"===n.errorDetail?uh.error("DataChannel SCTP error [sctpCauseCode:%s]: %s",n.sctpCauseCode,n.message):uh.error('DataChannel "error" event: %o',n),e.safeEmit("error",n)}})),this._dataChannel.addEventListener("close",(function(){e._closed||(uh.warn('DataChannel "close" event'),e._closed=!0,e.emit("@close"),e.safeEmit("close"),e._observer.safeEmit("close"))})),this._dataChannel.addEventListener("message",(function(t){e._closed||e.safeEmit("message",t.data)}))}}]),n}(gp),dh=new vp("Transport"),ph=(0,y.Z)((function e(t){var n=this;(0,g.Z)(this,e),this.consumerOptions=t,this.promise=new Promise((function(e,t){n.resolve=e,n.reject=t}))})),hh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.direction,a=e.id,o=e.iceParameters,s=e.iceCandidates,c=e.dtlsParameters,u=e.sctpParameters,l=e.iceServers,d=e.iceTransportPolicy,p=e.additionalSettings,h=e.proprietaryConstraints,f=e.appData,v=e.handlerFactory,m=e.extendedRtpCapabilities,y=e.canProduceByKind;return(0,g.Z)(this,n),(r=t.call(this))._closed=!1,r._connectionState="new",r._producers=new Map,r._consumers=new Map,r._dataProducers=new Map,r._dataConsumers=new Map,r._probatorConsumerCreated=!1,r._awaitQueue=new Kp,r._pendingConsumerTasks=[],r._consumerCreationInProgress=!1,r._pendingPauseConsumers=new Map,r._consumerPauseInProgress=!1,r._pendingResumeConsumers=new Map,r._consumerResumeInProgress=!1,r._pendingCloseConsumers=new Map,r._consumerCloseInProgress=!1,r._observer=new gp,dh.debug("constructor() [id:%s, direction:%s]",a,i),r._id=a,r._direction=i,r._extendedRtpCapabilities=m,r._canProduceByKind=y,r._maxSctpMessageSize=u?u.maxMessageSize:null,delete(p=kp(p,{})).iceServers,delete p.iceTransportPolicy,delete p.bundlePolicy,delete p.rtcpMuxPolicy,delete p.sdpSemantics,r._handler=v(),r._handler.run({direction:i,iceParameters:o,iceCandidates:s,dtlsParameters:c,sctpParameters:u,iceServers:l,iceTransportPolicy:d,additionalSettings:p,proprietaryConstraints:h,extendedRtpCapabilities:m}),r._appData=f||{},r.handleHandler(),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"closed",get:function(){return this._closed}},{key:"direction",get:function(){return this._direction}},{key:"handler",get:function(){return this._handler}},{key:"connectionState",get:function(){return this._connectionState}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"producers",get:function(){return this._producers}},{key:"observer",get:function(){return this._observer}},{key:"close",value:function(){if(!this._closed){dh.debug("close()"),this._closed=!0,this._awaitQueue.stop(),this._handler.close();var e,t=(0,c.Z)(this._producers.values());try{for(t.s();!(e=t.n()).done;){e.value.transportClosed()}}catch(xC){t.e(xC)}finally{t.f()}this._producers.clear();var n,r=(0,c.Z)(this._consumers.values());try{for(r.s();!(n=r.n()).done;){n.value.transportClosed()}}catch(xC){r.e(xC)}finally{r.f()}this._consumers.clear();var i,a=(0,c.Z)(this._dataProducers.values());try{for(a.s();!(i=a.n()).done;){i.value.transportClosed()}}catch(xC){a.e(xC)}finally{a.f()}this._dataProducers.clear();var o,s=(0,c.Z)(this._dataConsumers.values());try{for(s.s();!(o=s.n()).done;){o.value.transportClosed()}}catch(xC){s.e(xC)}finally{s.f()}this._dataConsumers.clear(),this._observer.safeEmit("close")}}},{key:"getStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new bp("closed");case 2:return e.abrupt("return",this._handler.getTransportStats());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.iceParameters,dh.debug("restartIce()"),!this._closed){e.next=3;break}throw new bp("closed");case 3:if(n){e.next=5;break}throw new TypeError("missing iceParameters");case 5:return e.abrupt("return",this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r._handler.restartIce(n));case 1:case"end":return e.stop()}}),e)}))),"transport.restartIce()"));case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=this,r=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(r.length>0&&void 0!==r[0]?r[0]:{}).iceServers,dh.debug("updateIceServers()"),!this._closed){e.next=3;break}throw new bp("closed");case 3:if(Array.isArray(t)){e.next=5;break}throw new TypeError("missing iceServers");case 5:return e.abrupt("return",this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",n._handler.updateIceServers(t));case 1:case"end":return e.stop()}}),e)}))),"transport.updateIceServers()"));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"produce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c,u,l,d,f,v,m=this,g=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(t=g.length>0&&void 0!==g[0]?g[0]:{}).track,r=t.encodings,i=t.codecOptions,a=t.codec,o=t.stopTracks,s=void 0===o||o,c=t.disableTrackOnPause,u=void 0===c||c,l=t.zeroRtpOnPause,d=void 0!==l&&l,f=t.appData,v=void 0===f?{}:f,dh.debug("produce() [track:%o]",n),!this._closed){e.next=3;break}throw new bp("closed");case 3:if(!n){e.next=20;break}if("send"===this._direction){e.next=6;break}throw new yp("not a sending Transport");case 6:if(!this._canProduceByKind[n.kind]){e.next=17;break}if("ended"!==n.readyState){e.next=9;break}throw new bp("track ended");case 9:if(0!==this.listenerCount("connect")||"new"!==this._connectionState){e.next=11;break}throw new TypeError('no "connect" listener set into this transport');case 11:if(0!==this.listenerCount("produce")){e.next=13;break}throw new TypeError('no "produce" listener set into this transport');case 13:if(!v||"object"==typeof v){e.next=15;break}throw new TypeError("if given, appData must be an object");case 15:e.next=18;break;case 17:throw new yp("cannot produce ".concat(n.kind));case 18:e.next=21;break;case 20:throw new TypeError("missing track");case 21:return e.abrupt("return",this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){var t,o,c,l,h,f,g,y;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||Array.isArray(r)){e.next=2;break}throw TypeError("encodings must be an array");case 2:return r&&0===r.length?t=void 0:r&&(t=r.map((function(e){var t={active:!0};return!1===e.active&&(t.active=!1),"boolean"==typeof e.dtx&&(t.dtx=e.dtx),"string"==typeof e.scalabilityMode&&(t.scalabilityMode=e.scalabilityMode),"number"==typeof e.scaleResolutionDownBy&&(t.scaleResolutionDownBy=e.scaleResolutionDownBy),"number"==typeof e.maxBitrate&&(t.maxBitrate=e.maxBitrate),"number"==typeof e.maxFramerate&&(t.maxFramerate=e.maxFramerate),"boolean"==typeof e.adaptivePtime&&(t.adaptivePtime=e.adaptivePtime),"string"==typeof e.priority&&(t.priority=e.priority),"string"==typeof e.networkPriority&&(t.networkPriority=e.networkPriority),t}))),e.next=5,m._handler.send({track:n,encodings:t,codecOptions:i,codec:a});
2case 5:return o=e.sent,c=o.localId,l=o.rtpParameters,h=o.rtpSender,e.prev=9,Pp(l),e.next=13,new Promise((function(e,t){m.safeEmit("produce",{kind:n.kind,rtpParameters:l,appData:v},e,t)}));case 13:return f=e.sent,g=f.id,y=new ih({id:g,localId:c,rtpSender:h,track:n,rtpParameters:l,stopTracks:s,disableTrackOnPause:u,zeroRtpOnPause:d,appData:v}),e.abrupt("return",(m._producers.set(y.id,y),m.handleProducer(y),m._observer.safeEmit("newproducer",y),y));case 19:throw e.prev=19,e.t0=e.catch(9),m._handler.stopSending(c).catch((function(){})),e.t0;case 22:case"end":return e.stop()}}),e,null,[[9,19]])}))),"transport.produce()").catch((function(e){if(s)try{n.stop()}catch(t){}throw e})));case 22:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"consume",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.id,r=t.producerId,i=t.kind,a=t.rtpParameters,o=t.streamId,s=t.appData,c=void 0===s?{}:s,dh.debug("consume()"),a=kp(a,void 0),!this._closed){e.next=3;break}throw new bp("closed");case 3:if("recv"===this._direction){e.next=5;break}throw new yp("not a receiving Transport");case 5:if("string"==typeof n){e.next=7;break}throw new TypeError("missing id");case 7:if("string"==typeof r){e.next=9;break}throw new TypeError("missing producerId");case 9:if("audio"===i||"video"===i){e.next=11;break}throw new TypeError("invalid kind '".concat(i,"'"));case 11:if(0!==this.listenerCount("connect")||"new"!==this._connectionState){e.next=13;break}throw new TypeError('no "connect" listener set into this transport');case 13:if(!c||"object"==typeof c){e.next=15;break}throw new TypeError("if given, appData must be an object");case 15:if(Up(a,this._extendedRtpCapabilities)){e.next=17;break}throw new yp("cannot consume this Producer");case 17:return u=new ph({id:n,producerId:r,kind:i,rtpParameters:a,streamId:o,appData:c}),e.abrupt("return",(this._pendingConsumerTasks.push(u),nh((function(){if(l._closed)throw new bp("closed");!1===l._consumerCreationInProgress&&l.createPendingConsumers()})),u.promise));case 19:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"produceData",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c,u,l,d,f=this,v=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(t=v.length>0&&void 0!==v[0]?v[0]:{}).ordered,r=void 0===n||n,i=t.maxPacketLifeTime,a=t.maxRetransmits,o=t.label,s=void 0===o?"":o,c=t.protocol,u=void 0===c?"":c,l=t.appData,d=void 0===l?{}:l,dh.debug("produceData()"),!this._closed){e.next=3;break}throw new bp("closed");case 3:if("send"===this._direction){e.next=5;break}throw new yp("not a sending Transport");case 5:if(!this._maxSctpMessageSize){e.next=14;break}if(0!==this.listenerCount("connect")||"new"!==this._connectionState){e.next=8;break}throw new TypeError('no "connect" listener set into this transport');case 8:if(0!==this.listenerCount("producedata")){e.next=10;break}throw new TypeError('no "producedata" listener set into this transport');case 10:if(!d||"object"==typeof d){e.next=12;break}throw new TypeError("if given, appData must be an object");case 12:e.next=15;break;case 14:throw new yp("SCTP not enabled by remote Transport");case 15:return e.abrupt("return",((i||a)&&(r=!1),this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){var t,n,o,c,l,h;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f._handler.sendDataChannel({ordered:r,maxPacketLifeTime:i,maxRetransmits:a,label:s,protocol:u});case 2:return t=e.sent,n=t.dataChannel,Ap(o=t.sctpStreamParameters),e.next=8,new Promise((function(e,t){f.safeEmit("producedata",{sctpStreamParameters:o,label:s,protocol:u,appData:d},e,t)}));case 8:return c=e.sent,l=c.id,h=new ch({id:l,dataChannel:n,sctpStreamParameters:o,appData:d}),e.abrupt("return",(f._dataProducers.set(h.id,h),f.handleDataProducer(h),f._observer.safeEmit("newdataproducer",h),h));case 12:case"end":return e.stop()}}),e)}))),"transport.produceData()")));case 16:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"consumeData",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.id,r=t.dataProducerId,i=t.sctpStreamParameters,a=t.label,o=void 0===a?"":a,s=t.protocol,c=void 0===s?"":s,u=t.appData,l=void 0===u?{}:u,dh.debug("consumeData()"),i=kp(i,void 0),!this._closed){e.next=3;break}throw new bp("closed");case 3:if("recv"===this._direction){e.next=5;break}throw new yp("not a receiving Transport");case 5:if(!this._maxSctpMessageSize){e.next=16;break}if("string"==typeof n){e.next=8;break}throw new TypeError("missing id");case 8:if("string"==typeof r){e.next=10;break}throw new TypeError("missing dataProducerId");case 10:if(0!==this.listenerCount("connect")||"new"!==this._connectionState){e.next=12;break}throw new TypeError('no "connect" listener set into this transport');case 12:if(!l||"object"==typeof l){e.next=14;break}throw new TypeError("if given, appData must be an object");case 14:e.next=17;break;case 16:throw new yp("SCTP not enabled by remote Transport");case 17:return e.abrupt("return",(Ap(i),this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){var t,a,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d._handler.receiveDataChannel
2({sctpStreamParameters:i,label:o,protocol:c});case 2:return t=e.sent,a=t.dataChannel,s=new lh({id:n,dataProducerId:r,dataChannel:a,sctpStreamParameters:i,appData:l}),e.abrupt("return",(d._dataConsumers.set(s.id,s),d.handleDataConsumer(s),d._observer.safeEmit("newdataconsumer",s),s));case 6:case"end":return e.stop()}}),e)}))),"transport.consumeData()")));case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createPendingConsumers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._consumerCreationInProgress=!0,this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){var n,r,i,a,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S,E,T,P,C,R,Z,M,A;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t._pendingConsumerTasks.length){e.next=3;break}return dh.debug("createPendingConsumers() | there is no Consumer to be created"),e.abrupt("return");case 3:n=(0,o.Z)(t._pendingConsumerTasks),t._pendingConsumerTasks=[],i=[],a=(0,c.Z)(n);try{for(a.s();!(s=a.n()).done;)u=s.value,l=u.consumerOptions,d=l.id,h=l.kind,f=l.rtpParameters,v=l.streamId,i.push({trackId:d,kind:h,rtpParameters:f,streamId:v})}catch(xC){a.e(xC)}finally{a.f()}return e.prev=8,e.next=11,t._handler.receive(i);case 11:for(m=e.sent,g=0;g<m.length;g++)y=n[g],b=m[g],k=y.consumerOptions,_=k.id,w=k.producerId,x=k.kind,S=k.rtpParameters,E=k.appData,T=b.localId,P=b.rtpReceiver,C=b.track,R=new oh({id:_,localId:T,producerId:w,rtpReceiver:P,track:C,rtpParameters:S,appData:E}),t._consumers.set(R.id,R),t.handleConsumer(R),!t._probatorConsumerCreated&&!r&&"video"===x&&(r=R),t._observer.safeEmit("newconsumer",R),y.resolve(R);e.next=19;break;case 15:e.prev=15,e.t0=e.catch(8),Z=(0,c.Z)(n);try{for(Z.s();!(M=Z.n()).done;)M.value.reject(e.t0)}catch(xC){Z.e(xC)}finally{Z.f()}case 19:if(!r){e.next=31;break}return e.prev=20,A=jp(r.rtpParameters),e.next=24,t._handler.receive([{trackId:"probator",kind:"video",rtpParameters:A}]);case 24:dh.debug("createPendingConsumers() | Consumer for RTP probation created"),t._probatorConsumerCreated=!0,e.next=31;break;case 28:e.prev=28,e.t1=e.catch(20),dh.error("createPendingConsumers() | failed to create Consumer for RTP probation:%o",e.t1);case 31:case"end":return e.stop()}}),e,null,[[8,15],[20,28]])}))),"transport.createPendingConsumers()").then((function(){t._consumerCreationInProgress=!1,t._pendingConsumerTasks.length>0&&t.createPendingConsumers()})).catch((function(){}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pausePendingConsumers",value:function(){var e=this;this._consumerPauseInProgress=!0,this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function t(){var n,r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e._pendingPauseConsumers.size){t.next=3;break}return dh.debug("pausePendingConsumers() | there is no Consumer to be paused"),t.abrupt("return");case 3:return n=Array.from(e._pendingPauseConsumers.values()),e._pendingPauseConsumers.clear(),t.prev=5,r=n.map((function(e){return e.localId})),t.next=9,e._handler.pauseReceiving(r);case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(5),dh.error("pausePendingConsumers() | failed to pause Consumers:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[5,11]])}))),"transport.pausePendingConsumers").then((function(){e._consumerPauseInProgress=!1,e._pendingPauseConsumers.size>0&&e.pausePendingConsumers()})).catch((function(){}))}},{key:"resumePendingConsumers",value:function(){var e=this;this._consumerResumeInProgress=!0,this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function t(){var n,r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e._pendingResumeConsumers.size){t.next=3;break}return dh.debug("resumePendingConsumers() | there is no Consumer to be resumed"),t.abrupt("return");case 3:return n=Array.from(e._pendingResumeConsumers.values()),e._pendingResumeConsumers.clear(),t.prev=5,r=n.map((function(e){return e.localId})),t.next=9,e._handler.resumeReceiving(r);case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(5),dh.error("resumePendingConsumers() | failed to resume Consumers:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[5,11]])}))),"transport.resumePendingConsumers").then((function(){e._consumerResumeInProgress=!1,e._pendingResumeConsumers.size>0&&e.resumePendingConsumers()})).catch((function(){}))}},{key:"closePendingConsumers",value:function(){var e=this;this._consumerCloseInProgress=!0,this._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function t(){var n;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==e._pendingCloseConsumers.size){t.next=3;break}return dh.debug("closePendingConsumers() | there is no Consumer to be closed"),t.abrupt("return");case 3:return n=Array.from(e._pendingCloseConsumers.values()),e._pendingCloseConsumers.clear(),t.prev=5,t.next=8,e._handler.stopReceiving(n.map((function(e){return e.localId})));case 8:t.next=13;break;case 10:t.prev=10,t.t0=t.catch(5),dh.error("closePendingConsumers() | failed to close Consumers:",t.t0);case 13:case"end":return t.stop()}}),t,null,[[5,10]])}))),"transport.closePendingConsumers").then((function(){e._consumerCloseInProgress=!1,e._pendingCloseConsumers.size>0&&e.closePendingConsumers()})).catch((function(){}))}},{key:"handleHandler",value:function(){var e=this,t=this._handler;t.on("@connect",(function(t,n,r){var i=t.dtlsParameters;
2e._closed?r(new bp("closed")):e.safeEmit("connect",{dtlsParameters:i},n,r)})),t.on("@connectionstatechange",(function(t){t!==e._connectionState&&(dh.debug("connection state changed to %s",t),e._connectionState=t,e._closed||e.safeEmit("connectionstatechange",t))}))}},{key:"handleProducer",value:function(e){var t=this;e.on("@close",(function(){t._producers.delete(e.id),!t._closed&&t._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function n(){return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",t._handler.stopSending(e.localId));case 1:case"end":return n.stop()}}),n)}))),"producer @close event").catch((function(e){return dh.warn("producer.close() failed:%o",e)}))})),e.on("@pause",(function(n,r){t._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function n(){return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",t._handler.pauseSending(e.localId));case 1:case"end":return n.stop()}}),n)}))),"producer @pause event").then(n).catch(r)})),e.on("@resume",(function(n,r){t._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function n(){return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",t._handler.resumeSending(e.localId));case 1:case"end":return n.stop()}}),n)}))),"producer @resume event").then(n).catch(r)})),e.on("@replacetrack",(function(n,r,i){t._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function r(){return(0,p.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",t._handler.replaceTrack(e.localId,n));case 1:case"end":return r.stop()}}),r)}))),"producer @replacetrack event").then(r).catch(i)})),e.on("@setmaxspatiallayer",(function(n,r,i){t._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function r(){return(0,p.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",t._handler.setMaxSpatialLayer(e.localId,n));case 1:case"end":return r.stop()}}),r)}))),"producer @setmaxspatiallayer event").then(r).catch(i)})),e.on("@setrtpencodingparameters",(function(n,r,i){t._awaitQueue.push((0,h.Z)((0,p.Z)().mark((function r(){return(0,p.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",t._handler.setRtpEncodingParameters(e.localId,n));case 1:case"end":return r.stop()}}),r)}))),"producer @setrtpencodingparameters event").then(r).catch(i)})),e.on("@getstats",(function(n,r){if(t._closed)return r(new bp("closed"));t._handler.getSenderStats(e.localId).then(n).catch(r)}))}},{key:"handleConsumer",value:function(e){var t=this;e.on("@close",(function(){t._consumers.delete(e.id),t._pendingPauseConsumers.delete(e.id),t._pendingResumeConsumers.delete(e.id),!t._closed&&(t._pendingCloseConsumers.set(e.id,e),!1===t._consumerCloseInProgress&&t.closePendingConsumers())})),e.on("@pause",(function(){t._pendingResumeConsumers.has(e.id)&&t._pendingResumeConsumers.delete(e.id),t._pendingPauseConsumers.set(e.id,e),nh((function(){t._closed||!1===t._consumerPauseInProgress&&t.pausePendingConsumers()}))})),e.on("@resume",(function(){t._pendingPauseConsumers.has(e.id)&&t._pendingPauseConsumers.delete(e.id),t._pendingResumeConsumers.set(e.id,e),nh((function(){t._closed||!1===t._consumerResumeInProgress&&t.resumePendingConsumers()}))})),e.on("@getstats",(function(n,r){if(t._closed)return r(new bp("closed"));t._handler.getReceiverStats(e.localId).then(n).catch(r)}))}},{key:"handleDataProducer",value:function(e){var t=this;e.on("@close",(function(){t._dataProducers.delete(e.id)}))}},{key:"handleDataConsumer",value:function(e){var t=this;e.on("@close",(function(){t._dataConsumers.delete(e.id)}))}}]),n}(gp),fh=new vp("Device");var vh=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.handlerName,r=t.handlerFactory,i=t.Handler;if((0,g.Z)(this,e),this._loaded=!1,this._observer=new gp,fh.debug("constructor()"),i){if(fh.warn("constructor() | Handler option is DEPRECATED, use handlerName or handlerFactory instead"),"string"!=typeof i)throw new TypeError("non string Handler option no longer supported, use handlerFactory instead");n=i}if(n&&r)throw new TypeError("just one of handlerName or handlerInterface can be given");if(r)this._handlerFactory=r;else{if(n)fh.debug("constructor() | handler given: %s",n);else{if(n=function(){var e,t,n,r;if("object"==typeof navigator&&"ReactNative"===navigator.product)return"undefined"==typeof RTCPeerConnection?void fh.warn("this._detectDevice() | unsupported react-native-webrtc without RTCPeerConnection, forgot to call registerGlobals()?"):"undefined"!=typeof RTCRtpTransceiver?(fh.debug("this._detectDevice() | ReactNative UnifiedPlan handler chosen"),"ReactNativeUnifiedPlan"):(fh.debug("this._detectDevice() | ReactNative PlanB handler chosen"),"ReactNative");if("object"==typeof navigator&&"string"==typeof navigator.userAgent){var i=navigator.userAgent;i=null==i?void 0:i.replace("motorola edge","motorola x");var a=M().getParser(i),o=a.getEngine();if(a.satisfies({chrome:">=111",chromium:">=111","microsoft edge":">=111"}))return"Chrome111";if(a.satisfies({chrome:">=74",chromium:">=74","microsoft edge":">=88"}))return"Chrome74";if(a.satisfies({chrome:">=70",chromium:">=70"}))return"Chrome70";if(a.satisfies({firefox:">=60"}))return"Firefox60";if(a.satisfies({ios:{OS:">=14.3",firefox:">=30.0"}}))return"Safari12";if(a.satisfies({safari:">=12.0"})&&"undefined"!=typeof RTCRtpTransceiver&&RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection"))return"Safari12";if("iOS"===(null===(t=null===(e=a.parsedResult)||void 0===e?void 0:e.os)||void 0===t?void 0:t.name)&&"undefined"!=typeof RTCRtpTransceiver&&RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection"))return"Safari12";if(a.satisfies({"microsoft edge":">=11"})&&a.satisfies({"microsoft edge":"<=18"}))return"Edge11";if(o.name&&"blink"===o.name.toLowerCase()){var s=i.match(/(?:(?:Chrome|Chromium))[ /](\w+)/i);if(s){var c=Number(s[1]);return c>=111?"Chrome111":c>=74?"Chrome74":"Chrome70"}return"Chrome111"}return"iOS"===(null===(r=null===(n=a.parsedResult)||void 0===n?void 0:n.os)||void 0===r?void 0:r.name)&&"undefined"!=typeof RTCRtpTransceiver&&RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection")||o.name&&"webkit"===o.name.toLowerCase()&&o.version&&parseFloat(o.version)>605?"Safari12":void fh.warn("this._detectDevice() | browser not supported [name:%s, version:%s]",a.getBrowserName(),a.getBrowserVersion())}fh.warn("this._detectDevice() | unknown device")}(),!n)throw new yp("device not supported");fh.debug("constructor() | detected handler: %s",n)}this.switchDevice(n)}var a=this._handlerFactory();this._handlerName=a.name,a.close(),this._extendedRtpCapabilities=void 0,this._recvRtpCapabilities=void 0,this._canProduceByKind={audio:!1,video:!1},this._sctpCapabilities=void 0}return(0,y.Z)(e,[{key:"handlerName",get:function(){return this._handlerName}},{key:"loaded",get:function(){return this._loaded}},{key:"rtpCapabilities",get:function(){if(!this._loaded)throw new bp("not loaded");return this._recvRtpCapabilities}},{key:"sctpCapabilities",get:function(){if(!this._loaded)throw new bp("not loaded");return this._sctpCapabilities}},{key:"observer",get:function(){return this._observer}},{key:"load",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.routerRtpCapabilities,fh.debug("load() [routerRtpCapabilities:%o]",n),n=kp(n,void 0),e.prev=2,!this._loaded){e.next=5;break}throw new bp("already loaded");case 5:return xp(n),r=this._handlerFactory(),e.next=8,r.getNativeRtpCapabilities();case 8:return i=e.sent,fh.debug("load() | got native RTP capabilities:%o",i),xp(i),this._extendedRtpCapabilities=Ip(i,n),fh.debug("load() | got extended RTP capabilities:%o",this._extendedRtpCapabilities),this._canProduceByKind.audio=Bp("audio",this._extendedRtpCapabilities),this._canProduceByKind.video=Bp("video",this._extendedRtpCapabilities),this._recvRtpCapabilities=Op(this._extendedRtpCapabilities),xp(this._recvRtpCapabilities),fh.debug("load() | got receiving RTP capabilities:%o",this._recvRtpCapabilities),e.next=20,r.getNativeSctpCapabilities();case 20:this._sctpCapabilities=e.sent,fh.debug("load() | got native SCTP capabilities:%o",this._sctpCapabilities),Mp(this._sctpCapabilities),fh.debug("load() succeeded"),this._loaded=!0,r.close(),e.next=31;break;case 28:throw e.prev=28,e.t0=e.catch(2),r&&r.close(),e.t0;case 31:case"end":return e.stop()}}),e,this,[[2,28]])})));return function(t){return e.apply(this,arguments)}}()},{key:"canProduce",value:function(e){if(!this._loaded)throw new bp("not loaded");if("audio"!==e&&"video"!==e)throw new TypeError('invalid kind "'.concat(e,'"'));return this._canProduceByKind[e]}},{key:"createSendTransport",value:function(e){var t=e.id,n=e.iceParameters,r=e.iceCandidates,i=e.dtlsParameters,a=e.sctpParameters,o=e.iceServers,s=e.iceTransportPolicy,c=e.additionalSettings,u=e.proprietaryConstraints,l=e.appData;return fh.debug("createSendTransport()"),this.createTransport({direction:"send",id:t,iceParameters:n,iceCandidates:r,dtlsParameters:i,sctpParameters:a,iceServers:o,iceTransportPolicy:s,additionalSettings:c,proprietaryConstraints:u,appData:l})}},{key:"createRecvTransport",value:function(e){var t=e.id,n=e.iceParameters,r=e.iceCandidates,i=e.dtlsParameters,a=e.sctpParameters,o=e.iceServers,s=e.iceTransportPolicy,c=e.additionalSettings,u=e.proprietaryConstraints,l=e.appData;return fh.debug("createRecvTransport()"),this.createTransport({direction:"recv",id:t,iceParameters:n,iceCandidates:r,dtlsParameters:i,sctpParameters:a,iceServers:o,iceTransportPolicy:s,additionalSettings:c,proprietaryConstraints:u,appData:l})}},{key:"createTransport",value:function(e){var t=e.direction,n=e.id,r=e.iceParameters,i=e.iceCandidates,a=e.dtlsParameters,o=e.sctpParameters,s=e.iceServers,c=e.iceTransportPolicy,u=e.additionalSettings,l=e.proprietaryConstraints,d=e.appData;if(!this._loaded)throw new bp("not loaded");if("string"!=typeof n)throw new TypeError("missing id");if("object"!=typeof r)throw new TypeError("missing iceParameters");if(!Array.isArray(i))throw new TypeError("missing iceCandidates");if("object"!=typeof a)throw new TypeError("missing dtlsParameters");if(o&&"object"!=typeof o)throw new TypeError("wrong sctpParameters");if(d&&"object"!=typeof d)throw new TypeError("if given, appData must be an object");
2var p=new hh({direction:t,id:n,iceParameters:r,iceCandidates:i,dtlsParameters:a,sctpParameters:o,iceServers:s,iceTransportPolicy:c,additionalSettings:u,proprietaryConstraints:l,appData:d,handlerFactory:this._handlerFactory,extendedRtpCapabilities:this._extendedRtpCapabilities,canProduceByKind:this._canProduceByKind});return this._observer.safeEmit("newtransport",p),p}}]),e}();function mh(e){var t,n=e.sdpObject,r=new Map,i=[],a=!1,o=!1,s=(0,c.Z)(n.media);try{for(s.s();!(t=s.n()).done;){var u=t.value,l=u.type;switch(l){case"audio":if(a)continue;a=!0;break;case"video":if(o)continue;o=!0;break;default:continue}var d,p=(0,c.Z)(u.rtp);try{for(p.s();!(d=p.n()).done;){var h=d.value,f={kind:l,mimeType:"".concat(l,"/").concat(h.codec),preferredPayloadType:h.payload,clockRate:h.rate,channels:h.encoding,parameters:{},rtcpFeedback:[]};r.set(f.preferredPayloadType,f)}}catch(xC){p.e(xC)}finally{p.f()}var v,m=(0,c.Z)(u.fmtp||[]);try{for(m.s();!(v=m.n()).done;){var g=v.value,y=A.rz(g.config),b=r.get(g.payload);b&&(y&&y.hasOwnProperty("profile-level-id")&&(y["profile-level-id"]=String(y["profile-level-id"])),b.parameters=y)}}catch(xC){m.e(xC)}finally{m.f()}var k,_=(0,c.Z)(u.rtcpFb||[]);try{for(_.s();!(k=_.n()).done;){var w=k.value,x={type:w.type,parameter:w.subtype};if(x.parameter||delete x.parameter,"*"!==w.payload){var S=r.get(w.payload);if(!S)continue;S.rtcpFeedback.push(x)}else{var E,T=(0,c.Z)(r.values());try{for(T.s();!(E=T.n()).done;){var P=E.value;P.kind===l&&!/.+\/rtx$/i.test(P.mimeType)&&P.rtcpFeedback.push(x)}}catch(xC){T.e(xC)}finally{T.f()}}}}catch(xC){_.e(xC)}finally{_.f()}var C,R=(0,c.Z)(u.ext||[]);try{for(R.s();!(C=R.n()).done;){var Z=C.value;if(!Z["encrypt-uri"]){var M={kind:l,uri:Z.uri,preferredId:Z.value};i.push(M)}}}catch(xC){R.e(xC)}finally{R.f()}}}catch(xC){s.e(xC)}finally{s.f()}return{codecs:Array.from(r.values()),headerExtensions:i}}function gh(e){var t=e.sdpObject,n=(t.media||[]).find((function(e){return e.iceUfrag&&0!==e.port}));if(!n)throw new Error("no active media section found");var r,i=n.fingerprint||t.fingerprint;switch(n.setup){case"active":r="client";break;case"passive":r="server";break;case"actpass":r="auto"}return{role:r,fingerprints:[{algorithm:i.type,value:i.hash}]}}function yh(e){var t=(e.offerMediaObject.ssrcs||[]).find((function(e){return"cname"===e.attribute}));return t?t.value:""}function bh(e){var t,n=e.offerRtpParameters,r=e.answerMediaObject,i=(0,c.Z)(n.codecs);try{var a=function(){var e=t.value,n=e.mimeType.toLowerCase();if("audio/opus"!==n||!(r.rtp||[]).find((function(t){return t.payload===e.payloadType})))return"continue";r.fmtp=r.fmtp||[];var i=r.fmtp.find((function(t){return t.payload===e.payloadType}));i||(i={payload:e.payloadType,config:""},r.fmtp.push(i));var a=A.rz(i.config);if("audio/opus"===n){var o=e.parameters["sprop-stereo"];void 0!==o&&(a.stereo=o?1:0)}i.config="";for(var s=0,c=Object.keys(a);s<c.length;s++){var u=c[s];i.config&&(i.config+=";"),i.config+="".concat(u,"=").concat(a[u])}};for(i.s();!(t=i.n()).done;)a()}catch(xC){i.e(xC)}finally{i.f()}}function kh(e){var t,n=e.offerMediaObject,r=new Set,i=(0,c.Z)(n.ssrcs||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value.id;r.add(a)}}catch(xC){i.e(xC)}finally{i.f()}if(0===r.size)throw new Error("no a=ssrc lines found");var o,s=new Map,u=(0,c.Z)(n.ssrcGroups||[]);try{for(u.s();!(o=u.n()).done;){var l=o.value;if("FID"===l.semantics){var p=l.ssrcs.split(/\s+/),h=(0,d.Z)(p,2),f=h[0],v=h[1];f=Number(f),v=Number(v),r.has(f)&&(r.delete(f),r.delete(v),s.set(f,v))}}}catch(xC){u.e(xC)}finally{u.f()}var m,g=(0,c.Z)(r);try{for(g.s();!(m=g.n()).done;){var y=m.value;s.set(y,null)}}catch(xC){g.e(xC)}finally{g.f()}var b,k=[],_=(0,c.Z)(s);try{for(_.s();!(b=_.n()).done;){var w=(0,d.Z)(b.value,2),x=w[0],S=w[1],E={ssrc:x};S&&(E.rtx={ssrc:S}),k.push(E)}}catch(xC){_.e(xC)}finally{_.f()}return k}function _h(e){var t=e.offerMediaObject,n=e.numStreams;if(n<=1)throw new TypeError("numStreams must be greater than 1");var r=(t.ssrcs||[]).find((function(e){return"msid"===e.attribute}));if(!r)throw new Error("a=ssrc line with msid information not found");var i,a=r.value.split(" "),o=(0,d.Z)(a,2),s=o[0],c=o[1],u=r.id;(t.ssrcGroups||[]).some((function(e){if("FID"!==e.semantics)return!1;var t=e.ssrcs.split(/\s+/);return Number(t[0])===u&&(i=Number(t[1]),!0)}));var l=t.ssrcs.find((function(e){return"cname"===e.attribute}));if(!l)throw new Error("a=ssrc line with cname information not found");for(var p=l.value,h=[],f=[],v=0;v<n;++v)h.push(u+v),i&&f.push(i+v);t.ssrcGroups=[],t.ssrcs=[],t.ssrcGroups.push({semantics:"SIM",ssrcs:h.join(" ")});for(var m=0;m<h.length;++m){var g=h[m];t.ssrcs.push({id:g,attribute:"cname",value:p}),t.ssrcs.push({id:g,attribute:"msid",value:"".concat(s," ").concat(c)})}for(var y=0;y<f.length;++y){var b=h[y],k=f[y];t.ssrcs.push({id:k,attribute:"cname",value:p}),t.ssrcs.push({id:k,attribute:"msid",value:"".concat(s," ").concat(c)}),t.ssrcGroups.push({semantics:"FID",ssrcs:"".concat(b," ").concat(k)})}}var wh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this)}return(0,y.Z)(n)}(gp),xh=function(){function e(t){var n=t.iceParameters,r=t.iceCandidates,i=t.dtlsParameters,a=t.planB,o=void 0!==a&&a;if((0,g.Z)(this,e),this._mediaObject={},this._planB=o,n&&this.setIceParameters(n),r){this._mediaObject.candidates=[];var s,u=(0,c.Z)(r);try{for(u.s();!(s=u.n()).done;){var l=s.value,d={component:1};d.foundation=l.foundation,d.ip=l.ip,d.port=l.port,d.priority=l.priority,d.transport=l.protocol,d.type=l.type,l.tcpType&&(d.tcptype=l.tcpType),this._mediaObject.candidates.push(d)}}catch(xC){u.e(xC)}finally{u.f()}this._mediaObject.endOfCandidates="end-of-candidates",this._mediaObject.iceOptions="renomination"}i&&this.setDtlsRole(i.role)}return(0,y.Z)(e,[{key:"mid",get:function(){return String(this._mediaObject.mid
2)}},{key:"closed",get:function(){return 0===this._mediaObject.port}},{key:"getObject",value:function(){return this._mediaObject}},{key:"setIceParameters",value:function(e){this._mediaObject.iceUfrag=e.usernameFragment,this._mediaObject.icePwd=e.password}},{key:"pause",value:function(){this._mediaObject.direction="inactive"}},{key:"disable",value:function(){this.pause(),delete this._mediaObject.ext,delete this._mediaObject.ssrcs,delete this._mediaObject.ssrcGroups,delete this._mediaObject.simulcast,delete this._mediaObject.simulcast_03,delete this._mediaObject.rids,delete this._mediaObject.extmapAllowMixed}},{key:"close",value:function(){this.disable(),this._mediaObject.port=0}},{key:"muxSimulcastStreams",value:function(e){if(this._mediaObject.simulcast&&this._mediaObject.simulcast.list1){var t={};e.forEach((function(e){e.rid&&(t[e.rid]=e)}));var n=this._mediaObject.simulcast.list1,r=A.fj(n);r.forEach((function(e){e.forEach((function(e){var n;e.paused=!(null!==(n=t[e.scid])&&void 0!==n&&n.active)}))})),this._mediaObject.simulcast.list1=r.map((function(e){return e.map((function(e){return"".concat(e.paused?"~":"").concat(e.scid)})).join(",")})).join(";")}}}]),e}(),Sh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.iceParameters,a=e.iceCandidates,o=e.dtlsParameters,s=e.sctpParameters,u=e.plainRtpParameters,l=e.planB,d=void 0!==l&&l,p=e.offerMediaObject,h=e.offerRtpParameters,f=e.answerRtpParameters,v=e.codecOptions,m=e.extmapAllowMixed,y=void 0!==m&&m,b=e.forceGoogConference,k=void 0!==b&&b;switch((0,g.Z)(this,n),(r=t.call(this,{iceParameters:i,iceCandidates:a,dtlsParameters:o,planB:d}))._mediaObject.mid=String(p.mid),r._mediaObject.type=p.type,r._mediaObject.protocol=p.protocol,u?(r._mediaObject.connection={ip:u.ip,version:u.ipVersion},r._mediaObject.port=u.port):(r._mediaObject.connection={ip:"127.0.0.1",version:4},r._mediaObject.port=7),p.type){case"audio":case"video":r._mediaObject.direction="recvonly",r._mediaObject.rtp=[],r._mediaObject.rtcpFb=[],r._mediaObject.fmtp=[];var _,w=(0,c.Z)(f.codecs);try{var x=function(){var e=_.value,t={payload:e.payloadType,codec:Th(e),rate:e.clockRate};e.channels>1&&(t.encoding=e.channels),r._mediaObject.rtp.push(t);var n=kp(e.parameters,{});if(v){var i=v.opusStereo,a=v.opusFec,o=v.opusDtx,s=v.opusMaxPlaybackRate,u=v.opusMaxAverageBitrate,l=v.opusPtime,d=v.videoGoogleStartBitrate,p=v.videoGoogleMaxBitrate,f=v.videoGoogleMinBitrate,m=h.codecs.find((function(t){return t.payloadType===e.payloadType}));switch(e.mimeType.toLowerCase()){case"audio/opus":void 0!==i&&(m.parameters["sprop-stereo"]=i?1:0,n.stereo=i?1:0),void 0!==a&&(m.parameters.useinbandfec=a?1:0,n.useinbandfec=a?1:0),void 0!==o&&(m.parameters.usedtx=o?1:0,n.usedtx=o?1:0),void 0!==s&&(n.maxplaybackrate=s),void 0!==u&&(n.maxaveragebitrate=u),void 0!==l&&(m.parameters.ptime=l,n.ptime=l);break;case"video/vp8":case"video/vp9":case"video/h264":case"video/h265":void 0!==d&&(n["x-google-start-bitrate"]=d),void 0!==p&&(n["x-google-max-bitrate"]=p),void 0!==f&&(n["x-google-min-bitrate"]=f)}}for(var g={payload:e.payloadType,config:""},y=0,b=Object.keys(n);y<b.length;y++){var k=b[y];g.config&&(g.config+=";"),g.config+="".concat(k,"=").concat(n[k])}g.config&&r._mediaObject.fmtp.push(g);var w,x=(0,c.Z)(e.rtcpFeedback);try{for(x.s();!(w=x.n()).done;){var S=w.value;r._mediaObject.rtcpFb.push({payload:e.payloadType,type:S.type,subtype:S.parameter})}}catch(xC){x.e(xC)}finally{x.f()}};for(w.s();!(_=w.n()).done;)x()}catch(xC){w.e(xC)}finally{w.f()}r._mediaObject.payloads=f.codecs.map((function(e){return e.payloadType})).join(" "),r._mediaObject.ext=[];var S,E=(0,c.Z)(f.headerExtensions);try{var T=function(){var e=S.value;(p.ext||[]).some((function(t){return t.uri===e.uri}))&&r._mediaObject.ext.push({uri:e.uri,value:e.id})};for(E.s();!(S=E.n()).done;)T()}catch(xC){E.e(xC)}finally{E.f()}if(y&&"extmap-allow-mixed"===p.extmapAllowMixed&&(r._mediaObject.extmapAllowMixed="extmap-allow-mixed"),p.simulcast){r._mediaObject.simulcast={dir1:"recv",list1:p.simulcast.list1},r._mediaObject.rids=[];var P,C=(0,c.Z)(p.rids||[]);try{for(C.s();!(P=C.n()).done;){var R=P.value;"send"===R.direction&&r._mediaObject.rids.push({id:R.id,direction:"recv"})}}catch(xC){C.e(xC)}finally{C.f()}}else if(p.simulcast_03){r._mediaObject.simulcast_03={value:p.simulcast_03.value.replace(/send/g,"recv")},r._mediaObject.rids=[];var Z,M=(0,c.Z)(p.rids||[]);try{for(M.s();!(Z=M.n()).done;){var A=Z.value;"send"===A.direction&&r._mediaObject.rids.push({id:A.id,direction:"recv"})}}catch(xC){M.e(xC)}finally{M.f()}}r._mediaObject.rtcpMux="rtcp-mux",r._mediaObject.rtcpRsize="rtcp-rsize",(r._planB||k)&&"video"===r._mediaObject.type&&(r._mediaObject.xGoogleFlag="conference");break;case"application":"number"==typeof p.sctpPort?(r._mediaObject.payloads="webrtc-datach
2annel",r._mediaObject.sctpPort=s.port,r._mediaObject.maxMessageSize=s.maxMessageSize):p.sctpmap&&(r._mediaObject.payloads=s.port,r._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:s.port,maxMessageSize:s.maxMessageSize})}return r}return(0,y.Z)(n,[{key:"setDtlsRole",value:function(e){switch(e){case"client":this._mediaObject.setup="active";break;case"server":this._mediaObject.setup="passive";break;case"auto":this._mediaObject.setup="actpass"}}},{key:"resume",value:function(){this._mediaObject.direction="recvonly"}},{key:"muxSimulcastStreams",value:function(e){var t;if(this._mediaObject.simulcast&&this._mediaObject.simulcast.list1){var n,r={},i=(0,c.Z)(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.rid&&(r[a.rid]=a)}}catch(xC){i.e(xC)}finally{i.f()}var o,s=this._mediaObject.simulcast.list1,u=A.fj(s),l=(0,c.Z)(u);try{for(l.s();!(o=l.n()).done;){var d,p=o.value,h=(0,c.Z)(p);try{for(h.s();!(d=h.n()).done;){var f=d.value;f.paused=!(null!==(t=r[f.scid])&&void 0!==t&&t.active)}}catch(xC){h.e(xC)}finally{h.f()}}}catch(xC){l.e(xC)}finally{l.f()}this._mediaObject.simulcast.list1=u.map((function(e){return e.map((function(e){return"".concat(e.paused?"~":"").concat(e.scid)})).join(",")})).join(";")}}}]),n}(xh),Eh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.iceParameters,a=e.iceCandidates,o=e.dtlsParameters,s=e.sctpParameters,u=e.plainRtpParameters,l=e.planB,d=void 0!==l&&l,p=e.mid,h=e.kind,f=e.offerRtpParameters,v=e.streamId,m=e.trackId,y=e.oldDataChannelSpec,b=void 0!==y&&y;switch((0,g.Z)(this,n),(r=t.call(this,{iceParameters:i,iceCandidates:a,dtlsParameters:o,planB:d}))._mediaObject.mid=String(p),r._mediaObject.type=h,u?(r._mediaObject.connection={ip:u.ip,version:u.ipVersion},r._mediaObject.protocol="RTP/AVP",r._mediaObject.port=u.port):(r._mediaObject.connection={ip:"127.0.0.1",version:4},r._mediaObject.protocol=s?"UDP/DTLS/SCTP":"UDP/TLS/RTP/SAVPF",r._mediaObject.port=7),h){case"audio":case"video":r._mediaObject.direction="sendonly",r._mediaObject.rtp=[],r._mediaObject.rtcpFb=[],r._mediaObject.fmtp=[],r._planB||(r._mediaObject.msid="".concat(v||"-"," ").concat(m));var k,_=(0,c.Z)(f.codecs);try{for(_.s();!(k=_.n()).done;){var w=k.value,x={payload:w.payloadType,codec:Th(w),rate:w.clockRate};w.channels>1&&(x.encoding=w.channels),r._mediaObject.rtp.push(x);for(var S={payload:w.payloadType,config:""},E=0,T=Object.keys(w.parameters);E<T.length;E++){var P=T[E];S.config&&(S.config+=";"),S.config+="".concat(P,"=").concat(w.parameters[P])}S.config&&r._mediaObject.fmtp.push(S);var C,R=(0,c.Z)(w.rtcpFeedback);try{for(R.s();!(C=R.n()).done;){var Z=C.value;r._mediaObject.rtcpFb.push({payload:w.payloadType,type:Z.type,subtype:Z.parameter})}}catch(xC){R.e(xC)}finally{R.f()}}}catch(xC){_.e(xC)}finally{_.f()}r._mediaObject.payloads=f.codecs.map((function(e){return e.payloadType})).join(" "),r._mediaObject.ext=[];var M,A=(0,c.Z)(f.headerExtensions);try{for(A.s();!(M=A.n()).done;){var I=M.value;r._mediaObject.ext.push({uri:I.uri,value:I.id})}}catch(xC){A.e(xC)}finally{A.f()}r._mediaObject.rtcpMux="rtcp-mux",r._mediaObject.rtcpRsize="rtcp-rsize";var O=f.encodings[0],L=O.ssrc,D=O.rtx&&O.rtx.ssrc?O.rtx.ssrc:void 0;r._mediaObject.ssrcs=[],r._mediaObject.ssrcGroups=[],f.rtcp.cname&&r._mediaObject.ssrcs.push({id:L,attribute:"cname",value:f.rtcp.cname}),r._planB&&r._mediaObject.ssrcs.push({id:L,attribute:"msid",value:"".concat(v||"-"," ").concat(m)}),D&&(f.rtcp.cname&&r._mediaObject.ssrcs.push({id:D,attribute:"cname",value:f.rtcp.cname}),r._planB&&r._mediaObject.ssrcs.push({id:D,attribute:"msid",value:"".concat(v||"-"," ").concat(m)}),r._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:"".concat(L," ").concat(D)}));break;case"application":b?(r._mediaObject.payloads=s.port,r._mediaObject.sctpmap={app:"webrtc-datachannel",sctpmapNumber:s.port,maxMessageSize:s.maxMessageSize}):(r._mediaObject.payloads="webrtc-datachannel",r._mediaObject.sctpPort=s.port,r._mediaObject.maxMessageSize=s.maxMessageSize)}return r}return(0,y.Z)(n,[{key:"setDtlsRole",value:function(e){this._mediaObject.setup="actpass"}},{key:"resume",value:function(){this._mediaObject.direction="sendonly"}},{key:"planBReceive",value:function(e){var t,n=this,r=e.offerRtpParameters,i=e.streamId,a=e.trackId,o=r.encodings[0],s=o.ssrc,u=o.rtx&&o.rtx.ssrc?o.rtx.ssrc:void 0,l=this._mediaObject.payloads.split(" "),d=(0,c.Z)(r.codecs);try{for(d.s();!(t=d.n()).done;){var p=t.value;if(!l.includes(String(p.payloadType))){var h={payload:p.payloadType,codec:Th(p),rate:p.clockRate};p.channels>1&&(h.encoding=p.channels),this._mediaObject.rtp.push(h);for(var f={payload:p.payloadType,config:""},v=0,m=Object.keys(p.parameters);v<m.length;v++){var g=m[v];f.config&&(f.config+=";"),f.config+="".concat(g,"=").concat(p.parameters[g])}f.config&&this._mediaObject.fmtp.push(f);var y,b=(0,c.Z)(p.rtcpFeedback);try{for(b.s();!(y=b.n()).done;){var k=y.value;this._mediaObject.rtcpFb.push({payload:p.payloadType,type:k.type,subtype:k.parameter})}}catch(xC){b.e(xC)}finally{b.f()}}}}catch(xC){d.e(xC)}finally{d.f()}this._mediaObject.payloads+=" ".concat(r.codecs.filter((function(e){return!n._mediaObject.payloads.includes(e.payloadType)})).map((function(e){return e.payloadType})).join(" ")),this._mediaObject.payloads=this._mediaObject.payloads.trim(),r.rtcp.cname&&this._mediaObject.ssrcs.push({id:s,attribute:"cname",value:r.rtcp.cname}),this._mediaObject.ssrcs.push({id:s,attribute:"msid",value:"".concat(i||"-"," ").concat(a)}),u&&(r.rtcp.cname&&this._mediaObject.ssrcs.push({id:u,attribute:"cname",value:r.rtcp.cname}),this._mediaObject.ssrcs.push({id:u,attribute:"msid",value:"".concat(i||"-"," ").concat(a)}),this._mediaObject.ssrcGroups.push({semantics:"FID",ssrcs:"".concat(s," ").concat(u)}))}},{key:"planBStopReceiving",value:function(e){var t=e.offerRtpParameters.encodings[0],n=t.ssrc,r=t.rtx&&t.rtx.ssrc?t.rtx.ssrc:void 0;this._mediaObject.ssrcs=this._mediaObject.ssrcs.filter((function(e){return e.id!==n&&e.id!==r})),r&&(this._mediaObject.ssrcGroups=this._mediaObject.ssrcGroups.filter((function(e){return e.ssrcs!=="".concat(n," ").concat(r)})))}}]),n}(xh);function Th(e){var t=new RegExp("^(audio|video)/(.+)","i").exec(e.mimeType);if(!t)throw new TypeError("invalid codec.mimeType");return t[2]}var Ph=new vp("RemoteSdp"),Ch=function(){function e(t){var n=t.iceParameters,r=t.iceCandidates,i=t.dtlsParameters,a=t.sctpParameters,o=t.plainRtpParameters,s=t.planB,c=void 0!==s&&s;if((0,g.Z)(this,e),this._mediaSections=[],this._midToIndex=new Map,this._iceParameters=n,this._iceCandidates=r,this._dtlsParameters=i,this._sctpParameters=a,this._plainRtpParameters=o,this._planB=c,this._sdpObject={version:0,origin:{address:"0.0.0.0",ipVer:4,netType:"IN",sessionId:1e4,sessionVersion:0,username:"mediasoup-client"},name:"-",timing:{start:0,stop:0},media:[]},n&&n.iceLite&&(this._sdpObject.icelite="ice-lite"),i){this._sdpObject.msidSemantic={semantic:"WMS",token:"*"};var u=this._dtlsParameters.fingerprints.length;this._sdpObject.fingerprint={type:i.fingerprints[u-1].algorithm,hash:i.fingerprints[u-1].value},this._sdpObject.groups=[{type:"BUNDLE",mids:""}]}o&&(this._sdpObject.origin.address=o.ip,this._sdpObject.origin.ipVer=o.ipVersion)}return(0,y.Z)(e,[{key:"updateIceParameters",value:function(e){Ph.debug("updateIceParameters() [iceParameters:%o]",e),this._iceParameters=e,this._sdpObject.icelite=e.iceLite?"ice-lite":void 0;var t,n=(0,c.Z)(this._mediaSections);try{for(n.s();!(t=n.n()).done;){t.value.setIceParameters(e)}}catch(xC){n.e(xC)}finally{n.f()}}},{key:"updateDtlsRole",value:function(e){Ph.debug("updateDtlsRole() [role:%s]",e),this._dtlsParameters.role=e;var t,n=(0,c.Z)(this._mediaSections);try{for(n.s();!(t=n.n()).done;){t.value.setDtlsRole(e)}}catch(xC){n.e(xC)}finally{n.f()}}},{key:"getNextMediaSectionIdx",value:function(){for(var e=0;e<this._mediaSections.length;++e){var t=this._mediaSections[e];if(t.closed)return{idx:e,reuseMid:t.mid}}return{idx:this._mediaSections.length}}},{key:"send",value:function(e){var t=e.offerMediaObject,n=e.reuseMid,r=e.offerRtpParameters,i=e.answerRtpParameters,a=e.codecOptions,o=e.extmapAllowMixed,s=void 0!==o&&o,c=e.forceGoogConference,u=void 0!==c&&c,l=new Sh({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,offerMediaObject:t,offerRtpParameters:r,answerRtpParameters:i,codecOptions:a,extmapAllowMixed:s,forceGoogConference:u});n?this._replaceMediaSection(l,n):this._midToIndex.has(l.mid)?this._replaceMediaSection(l):this._addMediaSection(l)}},{key:"receive",value:function(e){var t,n=e.mid,r=e.kind,i=e.offerRtpParameters,a=e.streamId,o=e.trackId,s=this._midToIndex.get(n);if(void 0!==s&&(t=this._mediaSections[s]),t)t.planBReceive({offerRtpParameters:i,streamId:a,trackId:o}),this._replaceMediaSection(t);else{t=new Eh({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,plainRtpParameters:this._plainRtpParameters,planB:this._planB,mid:n,kind:r,offerRtpParameters:i,streamId:a,trackId:o});var c=this._mediaSections.find((function(e){return e.closed}));c?this._replaceMediaSection(t,c.mid):this._addMediaSection(t)}}},{key:"pauseMediaSection",value:function(e){this._findMediaSection(e).pause()}},{key:"resumeSendingMediaSection",value:function(e){this._findMediaSection(e).resume()}},{key:"resumeReceivingMediaSection",value:function(e){this._findMediaSection(e).resume()}},{key:"disableMediaSection",value:function(e){this._findMediaSection(e).disable()}},{key:"closeMediaSection",value:function(e){var t=this._findMediaSection(e);return e===this._firstMid?(Ph.debug("closeMediaSection() | cannot close first media section, disabling it instead [mid:%s]",e),this.disableMediaSection(e),!1):(t.close(),this._regenerateBundleMids(),!0)}},{key:"muxMediaSectionSimulcast",value:function(e,t){var n=this._midToIndex.get(e);if(void 0===n)throw new Error("no media section found with mid '".concat(e,"'"));var r=this._mediaSections[n];if(void 0===r)throw new Error("no media section found with idx '".concat(n,"'"));r.muxSimulcastStreams(t),this._replaceMediaSection(r)}},{key:"planBStopReceiving",value:function(e){var t=e.mid,n=e.offerRtpParameters,r=this._findMediaSection(t);r.planBStopReceiving({offerRtpParameters:n}),this._replaceMediaSection(r)}},{key:"sendSctpAssociation",value:function(e){var t=e.offerMediaObject,n=new Sh({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,sctpParameters:this._sctpParameters,plainRtpParameters:this._plainRtpParameters,offerMediaObject:t});this._addMediaSection(n)}},{key:"receiveSctpAssociation",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).oldDataChannelSpec,t=void 0!==e&&e,n=new Eh({iceParameters:this._iceParameters,iceCandidates:this._iceCandidates,dtlsParameters:this._dtlsParameters,sctpParameters:this._sctpParameters,plainRtpParameters:this._plainRtpParameters,mid:"datachannel",kind:"application",oldDataChannelSpec:t});this._addMediaSection(n)}},{key:"getSdp",value:function(){return this._sdpObject.origin.sessionVersion++,A.cW(this._sdpObject)}},{key:"_addMediaSection",value:function(e){this._firstMid||(this._firstMid=e.mid),this._mediaSections.push(e),this._midToIndex.set(e.mid,this._mediaSections.length-1),this._sdpObject.media.push(e.getObject()),this._regenerateBundleMids()}},{key:"_replaceMediaSection",value:function(e,t){if("string"==typeof t){var n=this._midToIndex.get(t);if(void 0===n)throw new Error("no media section found for reuseMid '".concat(t,"'"));var r=this._mediaSections[n];this._mediaSections[n]=e,this._midToIndex.delete(r.mid),this._midToIndex.set(e.mid,n),this._sdpObject.media[n]=e.getObject(),this._regenerateBundleMids()}else{var i=this._midToIndex.get(e.mid);if(void 0===i)throw new Error("no media section found with mid '".concat(e.mid,"'"));this._mediaSections[i]=e,this._sdpObject.media[i]=e.getObject()}}},{key:"_findMediaSection",value:function(e){var t=this._midToIndex.get(e);if(void 0===t)throw new Error("no media section found with mid '".concat(e,"'"));return this._mediaSections[t]}},{key:"_regenerateBundleMids",value:function(){this._dtlsParameters&&(this._sdpObject.groups[0].mids=this._mediaSections.filter((function(e){return!e.closed})).map((function(e){return e.mid})).join(" "))}}]),e}(),Rh=new RegExp("^[LS]([1-9]\\d{0,1})T([1-9]\\d{0,1})");function Zh(e){var t=Rh.exec(e||"");
2return t?{spatialLayers:Number(t[1]),temporalLayers:Number(t[2])}:{spatialLayers:1,temporalLayers:1}}var Mh=new vp("Chrome70"),Ah={OS:1024,MIS:1024},Ih=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this))._mapMidTransceiver=new Map,e._sendStream=new MediaStream,e._hasDataChannelMediaSection=!1,e._nextSendSctpStreamId=0,e._transportReady=!1,e}return(0,y.Z)(n,[{key:"name",get:function(){return"Chrome70"}},{key:"close",value:function(){if(Mh.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}},{key:"getNativeRtpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Mh.debug("getNativeRtpCapabilities()"),t=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}),e.prev=2,t.addTransceiver("audio"),t.addTransceiver("video"),e.next=6,t.createOffer();case 6:n=e.sent;try{t.close()}catch(i){}return r=A.Qc(n.sdp),e.abrupt("return",mh({sdpObject:r}));case 12:e.prev=12,e.t0=e.catch(2);try{t.close()}catch(r){}throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"getNativeSctpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Mh.debug("getNativeSctpCapabilities()"),{numStreams:Ah}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"run",value:function(e){var t=this,n=e.direction,r=e.iceParameters,i=e.iceCandidates,a=e.dtlsParameters,o=e.sctpParameters,c=e.iceServers,u=e.iceTransportPolicy,l=e.additionalSettings,d=e.proprietaryConstraints,p=e.extendedRtpCapabilities;Mh.debug("run()"),this._direction=n,this._remoteSdp=new Ch({iceParameters:r,iceCandidates:i,dtlsParameters:a,sctpParameters:o}),this._sendingRtpParametersByKind={audio:Lp("audio",p),video:Lp("video",p)},this._sendingRemoteRtpParametersByKind={audio:Dp("audio",p),video:Dp("video",p)},a.role&&"auto"!==a.role&&(this._forcedLocalDtlsRole="server"===a.role?"client":"server"),this._pc=new RTCPeerConnection((0,s.Z)({iceServers:c||[],iceTransportPolicy:u||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},l),d),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(function(){t.emit("@connectionstatechange",t._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(function(){switch(Mh.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),t._pc.iceConnectionState){case"checking":t.emit("@connectionstatechange","connecting");break;case"connected":case"completed":t.emit("@connectionstatechange","connected");break;case"failed":t.emit("@connectionstatechange","failed");break;case"disconnected":t.emit("@connectionstatechange","disconnected");break;case"closed":t.emit("@connectionstatechange","closed")}}))}},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Mh.debug("updateIceServers()"),(n=this._pc.getConfiguration()).iceServers=t,this._pc.setConfiguration(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Mh.debug("restartIce()"),this._remoteSdp.updateIceParameters(t),!this._transportReady){e.next=24;break}if("send"!==this._direction){e.next=14;break}return e.next=4,this._pc.createOffer({iceRestart:!0});case 4:return n=e.sent,Mh.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",n),e.next=8,this._pc.setLocalDescription(n);case 8:return r={type:"answer",sdp:this._remoteSdp.getSdp()},Mh.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",r),e.next=12,this._pc.setRemoteDescription(r);case 12:e.next=24;break;case 14:return i={type:"offer",sdp:this._remoteSdp.getSdp()},Mh.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",i),e.next=18,this._pc.setRemoteDescription(i);case 18:return e.next=20,this._pc.createAnswer();case 20:return a=e.sent,Mh.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",a),e.next=24,this._pc.setLocalDescription(a);case 24:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S,E,T;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.track,r=t.encodings,i=t.codecOptions,a=t.codec,this.assertSendDirection(),Mh.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),(s=kp(this._sendingRtpParametersByKind[n.kind],{})).codecs=Np(s.codecs,a),(u=kp(this._sendingRemoteRtpParametersByKind[n.kind],{})).codecs=Np(u.codecs,a),l=this._remoteSdp.getNextMediaSectionIdx(),d=this._pc.addTransceiver(n,{direction:"sendonly",streams:[this._sendStream]}),e.next=9,this._pc.createOffer();case 9:if(h=e.sent,f=A.Qc(h.sdp),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:f});case 15:return r&&r.length>1&&(Mh.debug("send() | enabling legacy simulcast"),f=A.Qc(h.sdp),_h({offerMediaObject:v=f.media[l.idx],numStreams:r.length}),h={type:"offer",sdp:A.cW(f)}),m=!1,g=Zh((r||[{}
2])[0].scalabilityMode),r&&1===r.length&&g.spatialLayers>1&&"video/vp9"===s.codecs[0].mimeType.toLowerCase()&&(Mh.debug("send() | enabling legacy simulcast for VP9 SVC"),m=!0,f=A.Qc(h.sdp),_h({offerMediaObject:v=f.media[l.idx],numStreams:g.spatialLayers}),h={type:"offer",sdp:A.cW(f)}),Mh.debug("send() | calling pc.setLocalDescription() [offer:%o]",h),e.next=22,this._pc.setLocalDescription(h);case 22:if(!r){e.next=36;break}Mh.debug("send() | applying given encodings"),y=d.sender.getParameters(),b=0;case 26:if(!(b<(y.encodings||[]).length)){e.next=34;break}if(k=y.encodings[b],_=r[b]){e.next=30;break}return e.abrupt("break",34);case 30:y.encodings[b]=Object.assign(k,_);case 31:++b,e.next=26;break;case 34:return e.next=36,d.sender.setParameters(y);case 36:if(w=d.mid,s.mid=w,f=A.Qc(this._pc.localDescription.sdp),v=f.media[l.idx],s.rtcp.cname=yh({offerMediaObject:v}),s.encodings=kh({offerMediaObject:v}),r)for(x=0;x<s.encodings.length;++x)r[x]&&Object.assign(s.encodings[x],r[x]);if(m&&(s.encodings=[s.encodings[0]]),s.encodings.length>1&&("video/vp8"===s.codecs[0].mimeType.toLowerCase()||"video/h264"===s.codecs[0].mimeType.toLowerCase())){S=(0,c.Z)(s.encodings);try{for(S.s();!(E=S.n()).done;)E.value.scalabilityMode="L1T3"}catch(xC){S.e(xC)}finally{S.f()}}return this._remoteSdp.send({offerMediaObject:v,reuseMid:l.reuseMid,offerRtpParameters:s,answerRtpParameters:u,codecOptions:i}),T={type:"answer",sdp:this._remoteSdp.getSdp()},Mh.debug("send() | calling pc.setRemoteDescription() [answer:%o]",T),e.next=44,this._pc.setRemoteDescription(T);case 44:return this._mapMidTransceiver.set(w,d),e.abrupt("return",{localId:w,rtpParameters:s,rtpSender:d.sender});case 46:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Mh.debug("stopSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:if(n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),this._remoteSdp.closeMediaSection(n.mid))try{n.stop()}catch(a){}return e.next=7,this._pc.createOffer();case 7:return r=e.sent,Mh.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Mh.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:this._mapMidTransceiver.delete(t);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n?Mh.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):Mh.debug("replaceTrack() [localId:%s, no track]",t),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Mh.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){e.active=t<=n})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Mh.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Mh.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Mh.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Mh.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Mh.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.sender.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.ordered,r=t.maxPacketLifeTime,i=t.maxRetransmits,a=t.label,o=t.protocol,this.assertSendDirection(),c={negotiated:!0,id:this._nextSendSctpStreamId,ordered:n,maxPacketLifeTime:r,maxRetransmitTime:r,maxRetransmits:i,protocol:o},Mh.debug("sendDataChannel() [options:%o]",c),u=this._pc.createDataChannel(a,c),this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Ah.MIS,this._hasDataChannelMediaSection){e.next=24;break}return e.next=8,this._pc.createOffer();case 8:if(l=e.sent,d=A.Qc(l.sdp),h=d.media.find((function(e){return"application"===e.type})),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:d});case 15:return Mh.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",l),e.next=18,this._pc.setLocalDescription(l);case 18:return this._remoteSdp.sendSctpAssociation({offerMediaObject:h}),f={type:"answer",sdp:this._remoteSdp.getSdp()},Mh.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=23,this._pc.setRemoteDescription(f);case 23:this._hasDataChannelMediaSection=!0;case 24:return v={streamId:c.id,ordered:c.ordered,maxPacketLifeTime:c.maxPacketLifeTime,maxRetransmits:c.maxRetransmits},e.abrupt("return",{dataChannel:u,sctpStreamParameters:v});case 26:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receive",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),r=[],i=new Map,a=(0,c.Z)(t);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.trackId,l=s.kind,d=s.rtpParameters,h=s.streamId,Mh.debug("receive() [trackId:%s, kind:%s]",u,l),f=d.mid||String(this._mapMidTransceiver.size),i.set(u,f),this._remoteSdp.receive({mid:f,kind:l,offerRtpParameters:d,streamId:h||d.rtcp.cname,trackId:u})}catch(xC){a.e(xC)}finally{a.f()}return v={type:"offer",sdp:this._remoteSdp.getSdp()},Mh.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",v),e.next=8,this._pc.setRemoteDescription(v);case 8:return e.next=10,this._pc.createAnswer();case 10:m=e.sent,g=A.Qc(m.sdp),y=(0,c.Z)(t),e.prev=13,k=(0,p.Z)().mark((function e(){var t,n,r,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=b.value,n=t.trackId,r=t.rtpParameters,a=i.get(n),o=g.media.find((function(e){return String(e.mid)===a})),bh({offerRtpParameters:r,answerMediaObject:o});case 3:case"end":return e.stop()}}),e)})),y.s();case 16:if((b=y.n()).done){e.next=20;break}return e.delegateYield(k(),"t0",18);case 18:e.next=16;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(13),y.e(e.t1);case 25:return e.prev=25,y.f(),e.finish(25);case 28:if(m={type:"answer",sdp:A.cW(g)},e.t2=this._transportReady,e.t2){e.next=33;break}return e.next=33,this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:g});case 33:return Mh.debug("receive() | calling pc.setLocalDescription() [answer:%o]",m),e.next=36,this._pc.setLocalDescription(m);case 36:_=(0,c.Z)(t),e.prev=37,x=(0,p.Z)().mark((function e(){var t,n,a,o;return(0,p.Z)().wrap((function(e){for(;;
2)switch(e.prev=e.next){case 0:if(t=w.value,n=t.trackId,a=i.get(n),o=S._pc.getTransceivers().find((function(e){return e.mid===a})),o){e.next=4;break}throw new Error("new RTCRtpTransceiver not found");case 4:S._mapMidTransceiver.set(a,o),r.push({localId:a,track:o.receiver.track,rtpReceiver:o.receiver});case 5:case"end":return e.stop()}}),e)})),_.s();case 40:if((w=_.n()).done){e.next=44;break}return e.delegateYield(x(),"t3",42);case 42:e.next=40;break;case 44:e.next=49;break;case 46:e.prev=46,e.t4=e.catch(37),_.e(e.t4);case 49:return e.prev=49,_.f(),e.finish(49);case 52:return e.abrupt("return",r);case 53:case"end":return e.stop()}}),e,this,[[13,22,25,28],[37,46,49,52]])})));return function(t){return e.apply(this,arguments)}}()},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Mh.debug("stopReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:this._remoteSdp.closeMediaSection(a.mid);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Mh.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Mh.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:u=(0,c.Z)(t);try{for(u.s();!(l=u.n()).done;)d=l.value,this._mapMidTransceiver.delete(d)}catch(xC){u.e(xC)}finally{u.f()}case 33:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertRecvDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receiveDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.sctpStreamParameters,r=t.label,i=t.protocol,this.assertRecvDirection(),o=n.streamId,s=n.ordered,c=n.maxPacketLifeTime,u=n.maxRetransmits,l={negotiated:!0,id:o,ordered:s,maxPacketLifeTime:c,maxRetransmitTime:c,maxRetransmits:u,protocol:i},Mh.debug("receiveDataChannel() [options:%o]",l),d=this._pc.createDataChannel(r,l),this._hasDataChannelMediaSection){e.next=22;break}return this._remoteSdp.receiveSctpAssociation(),h={type:"offer",sdp:this._remoteSdp.getSdp()},Mh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",h),e.next=11,this._pc.setRemoteDescription(h);case 11:return e.next=13,this._pc.createAnswer();case 13:if(f=e.sent,this._transportReady){e.next=18;break}return v=A.Qc(f.sdp),e.next=18,this.setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"client",localSdpObject:v});case 18:return Mh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=21,this._pc.setLocalDescription(f);case 21:this._hasDataChannelMediaSection=!0;case 22:return e.abrupt("return",{dataChannel:d});case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.localDtlsRole,(r=t.localSdpObject)||(r=A.Qc(this._pc.localDescription.sdp)),(i=gh({sdpObject:r}
2)).role=n,this._remoteSdp.updateDtlsRole("client"===n?"server":"client"),e.next=7,new Promise((function(e,t){a.safeEmit("@connect",{dtlsParameters:i},e,t)}));case 7:this._transportReady=!0;case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(wh),Oh=new vp("Chrome74"),Lh={OS:1024,MIS:1024},Dh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this))._mapMidTransceiver=new Map,e._sendStream=new MediaStream,e._hasDataChannelMediaSection=!1,e._nextSendSctpStreamId=0,e._transportReady=!1,e}return(0,y.Z)(n,[{key:"name",get:function(){return"Chrome74"}},{key:"close",value:function(){if(Oh.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}},{key:"getNativeRtpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Oh.debug("getNativeRtpCapabilities()"),t=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}),e.prev=2,t.addTransceiver("audio"),t.addTransceiver("video"),e.next=6,t.createOffer();case 6:n=e.sent;try{t.close()}catch(i){}return r=A.Qc(n.sdp),e.abrupt("return",mh({sdpObject:r}));case 12:e.prev=12,e.t0=e.catch(2);try{t.close()}catch(r){}throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"getNativeSctpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Oh.debug("getNativeSctpCapabilities()"),{numStreams:Lh}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"run",value:function(e){var t=this,n=e.direction,r=e.iceParameters,i=e.iceCandidates,a=e.dtlsParameters,o=e.sctpParameters,c=e.iceServers,u=e.iceTransportPolicy,l=e.additionalSettings,d=e.proprietaryConstraints,p=e.extendedRtpCapabilities;Oh.debug("run()"),this._direction=n,this._remoteSdp=new Ch({iceParameters:r,iceCandidates:i,dtlsParameters:a,sctpParameters:o}),this._sendingRtpParametersByKind={audio:Lp("audio",p),video:Lp("video",p)},this._sendingRemoteRtpParametersByKind={audio:Dp("audio",p),video:Dp("video",p)},a.role&&"auto"!==a.role&&(this._forcedLocalDtlsRole="server"===a.role?"client":"server"),this._pc=new RTCPeerConnection((0,s.Z)({iceServers:c||[],iceTransportPolicy:u||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},l),d),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(function(){t.emit("@connectionstatechange",t._pc.connectionState)})):(Oh.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.addEventListener("iceconnectionstatechange",(function(){switch(t._pc.iceConnectionState){case"checking":t.emit("@connectionstatechange","connecting");break;case"connected":case"completed":t.emit("@connectionstatechange","connected");break;case"failed":t.emit("@connectionstatechange","failed");break;case"disconnected":t.emit("@connectionstatechange","disconnected");break;case"closed":t.emit("@connectionstatechange","closed")}})))}},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Oh.debug("updateIceServers()"),(n=this._pc.getConfiguration()).iceServers=t,this._pc.setConfiguration(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Oh.debug("restartIce()"),this._remoteSdp.updateIceParameters(t),!this._transportReady){e.next=24;break}if("send"!==this._direction){e.next=14;break}return e.next=4,this._pc.createOffer({iceRestart:!0});case 4:return n=e.sent,Oh.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",n),e.next=8,this._pc.setLocalDescription(n);case 8:return r={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",r),e.next=12,this._pc.setRemoteDescription(r);case 12:e.next=24;break;case 14:return i={type:"offer",sdp:this._remoteSdp.getSdp()},Oh.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",i),e.next=18,this._pc.setRemoteDescription(i);case 18:return e.next=20,this._pc.createAnswer();case 20:return a=e.sent,Oh.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",a),e.next=24,this._pc.setLocalDescription(a);case 24:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.track,r=t.encodings,i=t.codecOptions,a=t.codec,this.assertSendDirection(),Oh.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),r&&r.length>1&&r.forEach((function(e,t){e.rid="r".concat(t)})),(u=kp(this._sendingRtpParametersByKind[n.kind],{})).codecs=Np(u.codecs,a),(l=kp(this._sendingRemoteRtpParametersByKind[n.kind],{})).codecs=Np(l.codecs,a),d=this._remoteSdp.getNextMediaSectionIdx(),h=this._pc.addTransceiver(n,{direction:"sendonly",streams:[this._sendStream],sendEncodings:r}),e.next=9,this._pc.createOffer();case 9:if(f=e.sent,v=A.Qc(f.sdp),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:v});case 15:return g=!1,y=Zh((r||[{}
2])[0].scalabilityMode),r&&1===r.length&&y.spatialLayers>1&&"video/vp9"===u.codecs[0].mimeType.toLowerCase()&&(Oh.debug("send() | enabling legacy simulcast for VP9 SVC"),g=!0,v=A.Qc(f.sdp),_h({offerMediaObject:m=v.media[d.idx],numStreams:y.spatialLayers}),f={type:"offer",sdp:A.cW(v)}),Oh.debug("send() | calling pc.setLocalDescription() [offer:%o]",f),e.next=21,this._pc.setLocalDescription(f);case 21:if(b=h.mid,u.mid=b,v=A.Qc(this._pc.localDescription.sdp),m=v.media[d.idx],u.rtcp.cname=yh({offerMediaObject:m}),r?1===r.length?(k=kh({offerMediaObject:m}),Object.assign(k[0],r[0]),g&&(k=[k[0]]),u.encodings=k):u.encodings=r:u.encodings=kh({offerMediaObject:m}),u.encodings.length>1&&("video/vp8"===u.codecs[0].mimeType.toLowerCase()||"video/h264"===u.codecs[0].mimeType.toLowerCase())){_=(0,c.Z)(u.encodings);try{for(_.s();!(w=_.n()).done;)(x=w.value).scalabilityMode?x.scalabilityMode="L1T".concat(y.temporalLayers):x.scalabilityMode="L1T3"}catch(xC){_.e(xC)}finally{_.f()}}return this._remoteSdp.send({offerMediaObject:m,reuseMid:d.reuseMid,offerRtpParameters:u,answerRtpParameters:l,codecOptions:i,extmapAllowMixed:!0,forceGoogConference:null!==(s=null==i?void 0:i.forceGoogConference)&&void 0!==s&&s}),S={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("send() | calling pc.setRemoteDescription() [answer:%o]",S),e.next=29,this._pc.setRemoteDescription(S);case 29:return this._mapMidTransceiver.set(b,h),e.abrupt("return",{localId:b,rtpParameters:u,rtpSender:h.sender});case 31:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Oh.debug("stopSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:if(n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),this._remoteSdp.closeMediaSection(n.mid))try{n.stop()}catch(a){}return e.next=7,this._pc.createOffer();case 7:return r=e.sent,Oh.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:this._mapMidTransceiver.delete(t);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Oh.debug("pauseSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",this._remoteSdp.pauseMediaSection(t),e.next=7,this._pc.createOffer();case 7:return r=e.sent,Oh.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Oh.debug("resumeSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t),this._remoteSdp.resumeSendingMediaSection(t),n){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="sendonly",e.next=7,this._pc.createOffer();case 7:return r=e.sent,Oh.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n?Oh.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):Oh.debug("replaceTrack() [localId:%s, no track]",t),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Oh.debug("setMaxSpatialLayer() [localId:%s, spatialL
2ayer:%s]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){e.active=t<=n})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Oh.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Oh.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Oh.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.sender.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.ordered,r=t.maxPacketLifeTime,i=t.maxRetransmits,a=t.label,o=t.protocol,this.assertSendDirection(),c={negotiated:!0,id:this._nextSendSctpStreamId,ordered:n,maxPacketLifeTime:r,maxRetransmits:i,protocol:o},Oh.debug("sendDataChannel() [options:%o]",c),u=this._pc.createDataChannel(a,c),this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Lh.MIS,this._hasDataChannelMediaSection){e.next=24;break}return e.next=8,this._pc.createOffer();case 8:if(l=e.sent,d=A.Qc(l.sdp),h=d.media.find((function(e){return"application"===e.type})),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:d});case 15:return Oh.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",l),e.next=18,this._pc.setLocalDescription(l);case 18:return this._remoteSdp.sendSctpAssociation({offerMediaObject:h}),f={type:"answer",sdp:this._remoteSdp.getSdp()},Oh.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=23,this._pc.setRemoteDescription(f);case 23:this._hasDataChannelMediaSection=!0;case 24:return v={streamId:c.id,ordered:c.ordered,maxPacketLifeTime:c.maxPacketLifeTime,maxRetransmits:c.maxRetransmits},e.abrupt("return",{dataChannel:u,sctpStreamParameters:v});case 26:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receive",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),r=[],i=new Map,a=(0,c.Z)(t);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.trackId,l=s.kind,d=s.rtpParameters,h=s.streamId,Oh.debug("receive() [trackId:%s, kind:%s]",u,l),f=d.mid||String(this._mapMidTransceiver.size),i.set(u,f),this._remoteSdp.receive({mid:f,kind:l,offerRtpParameters:d,streamId:h||d.rtcp.cname,trackId:u})}catch(xC){a.e(xC)}finally{a.f()}return v={type:"offer",sdp:this._remoteSdp.getSdp()},Oh.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",v),e.next=8,this._pc.setRemoteDescription(v);case 8:return e.next=10,this._pc.createAnswer();case 10:m=e.sent,g=A.Qc(m.sdp),y=(0,c.Z)(t),e.prev=13,k=(0,p.Z)().mark((function e(){var t,n,r,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=b.value,n=t.trackId,r=t.rtpParameters,a=i.get(n),o=g.media.find((function(e){return String(e.mid)===a})),bh({offerRtpParameters:r,answerMediaObject:o});case 3:case"end":return e.stop()}}),e)})),y.s();case 16:if((b=y.n()).done){e.next=20;break}return e.delegateYield(k(),"t0",18);case 18:e.next=16;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(13),y.e(e.t1);case 25:return e.prev=25,y.f(),e.finish(25);case 28:if(m={type:"answer",sdp:A.cW(g)},e.t2=this._transportReady,e.t2){e.next=33;break}return e.next=33,this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:g});case 33:return Oh.debug("receive() | calling pc.setLocalDescription() [answer:%o]",m),e.next=36,this._pc.setLocalDescription(m);case 36:_=(0,c.Z)(t),e.prev=37,x=(0,p.Z)().mark((function e(){var t,n,a,o;return(0,p.Z)().wrap((function(e){for(;;
2)switch(e.prev=e.next){case 0:if(t=w.value,n=t.trackId,a=i.get(n),o=S._pc.getTransceivers().find((function(e){return e.mid===a})),!o){e.next=6;break}S._mapMidTransceiver.set(a,o),r.push({localId:a,track:o.receiver.track,rtpReceiver:o.receiver}),e.next=7;break;case 6:throw new Error("new RTCRtpTransceiver not found");case 7:case"end":return e.stop()}}),e)})),_.s();case 40:if((w=_.n()).done){e.next=44;break}return e.delegateYield(x(),"t3",42);case 42:e.next=40;break;case 44:e.next=49;break;case 46:e.prev=46,e.t4=e.catch(37),_.e(e.t4);case 49:return e.prev=49,_.f(),e.finish(49);case 52:return e.abrupt("return",r);case 53:case"end":return e.stop()}}),e,this,[[13,22,25,28],[37,46,49,52]])})));return function(t){return e.apply(this,arguments)}}()},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Oh.debug("stopReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:this._remoteSdp.closeMediaSection(a.mid);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Oh.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Oh.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:u=(0,c.Z)(t);try{for(u.s();!(l=u.n()).done;)d=l.value,this._mapMidTransceiver.delete(d)}catch(xC){u.e(xC)}finally{u.f()}case 33:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Oh.debug("pauseReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="inactive",this._remoteSdp.pauseMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Oh.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Oh.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Oh.debug("resumeReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Oh.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Oh.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertRecvDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receiveDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.sctpStreamParameters,r=t.label,i=t.protocol,this.assertRecvDirection(),o=n.streamId,s=n.ordered,c=n.maxPacketLifeTime,u=n.maxRetransmits,l={negotiated:!0,id:o,ordered:s,maxPacketLifeTime:c,maxRetransmits:u,protocol:i}
2,Oh.debug("receiveDataChannel() [options:%o]",l),d=this._pc.createDataChannel(r,l),this._hasDataChannelMediaSection){e.next=22;break}return this._remoteSdp.receiveSctpAssociation(),h={type:"offer",sdp:this._remoteSdp.getSdp()},Oh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",h),e.next=11,this._pc.setRemoteDescription(h);case 11:return e.next=13,this._pc.createAnswer();case 13:if(f=e.sent,this._transportReady){e.next=18;break}return v=A.Qc(f.sdp),e.next=18,this.setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"client",localSdpObject:v});case 18:return Oh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=21,this._pc.setLocalDescription(f);case 21:this._hasDataChannelMediaSection=!0;case 22:return e.abrupt("return",{dataChannel:d});case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.localDtlsRole,(r=t.localSdpObject)||(r=A.Qc(this._pc.localDescription.sdp)),(i=gh({sdpObject:r})).role=n,this._remoteSdp.updateDtlsRole("client"===n?"server":"client"),e.next=7,new Promise((function(e,t){a.safeEmit("@connect",{dtlsParameters:i},e,t)}));case 7:this._transportReady=!0;case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(wh),Nh=new vp("Chrome111"),jh={OS:1024,MIS:1024},Bh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this))._mapMidTransceiver=new Map,e._sendStream=new MediaStream,e._hasDataChannelMediaSection=!1,e._nextSendSctpStreamId=0,e._transportReady=!1,e}return(0,y.Z)(n,[{key:"name",get:function(){return"Chrome111"}},{key:"close",value:function(){if(Nh.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}},{key:"getNativeRtpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Nh.debug("getNativeRtpCapabilities()"),t=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}),e.prev=2,t.addTransceiver("audio"),t.addTransceiver("video"),e.next=6,t.createOffer();case 6:n=e.sent;try{t.close()}catch(i){}return r=A.Qc(n.sdp),e.abrupt("return",mh({sdpObject:r}));case 12:e.prev=12,e.t0=e.catch(2);try{t.close()}catch(r){}throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"getNativeSctpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Nh.debug("getNativeSctpCapabilities()"),{numStreams:jh}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"run",value:function(e){var t=this,n=e.direction,r=e.iceParameters,i=e.iceCandidates,a=e.dtlsParameters,o=e.sctpParameters,c=e.iceServers,u=e.iceTransportPolicy,l=e.additionalSettings,d=e.proprietaryConstraints,p=e.extendedRtpCapabilities;Nh.debug("run()"),this._direction=n,this._remoteSdp=new Ch({iceParameters:r,iceCandidates:i,dtlsParameters:a,sctpParameters:o}),this._sendingRtpParametersByKind={audio:Lp("audio",p),video:Lp("video",p)},this._sendingRemoteRtpParametersByKind={audio:Dp("audio",p),video:Dp("video",p)},a.role&&"auto"!==a.role&&(this._forcedLocalDtlsRole="server"===a.role?"client":"server"),this._pc=new RTCPeerConnection((0,s.Z)({iceServers:c||[],iceTransportPolicy:u||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},l),d),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(function(){t.emit("@connectionstatechange",t._pc.connectionState)})):(Nh.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),this._pc.addEventListener("iceconnectionstatechange",(function(){switch(t._pc.iceConnectionState){case"checking":t.emit("@connectionstatechange","connecting");break;case"connected":case"completed":t.emit("@connectionstatechange","connected");break;case"failed":t.emit("@connectionstatechange","failed");break;case"disconnected":t.emit("@connectionstatechange","disconnected");break;case"closed":t.emit("@connectionstatechange","closed")}}
2)))}},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Nh.debug("updateIceServers()"),(n=this._pc.getConfiguration()).iceServers=t,this._pc.setConfiguration(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Nh.debug("restartIce()"),this._remoteSdp.updateIceParameters(t),!this._transportReady){e.next=24;break}if("send"!==this._direction){e.next=14;break}return e.next=4,this._pc.createOffer({iceRestart:!0});case 4:return n=e.sent,Nh.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",n),e.next=8,this._pc.setLocalDescription(n);case 8:return r={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",r),e.next=12,this._pc.setRemoteDescription(r);case 12:e.next=24;break;case 14:return i={type:"offer",sdp:this._remoteSdp.getSdp()},Nh.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",i),e.next=18,this._pc.setRemoteDescription(i);case 18:return e.next=20,this._pc.createAnswer();case 20:return a=e.sent,Nh.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",a),e.next=24,this._pc.setLocalDescription(a);case 24:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S,E,T,P;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.track,r=t.encodings,i=t.codecOptions,a=t.codec,this.assertSendDirection(),Nh.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),r&&r.length>1){r.forEach((function(e,t){e.rid="r".concat(t)})),s=1,u=1,l=(0,c.Z)(r);try{for(l.s();!(d=l.n()).done;)h=d.value,(f=h.scalabilityMode?Zh(h.scalabilityMode).temporalLayers:3)>u&&(u=f)}catch(xC){l.e(xC)}finally{l.f()}v=(0,c.Z)(r);try{for(v.s();!(m=v.n()).done;)(g=m.value).rid="r".concat(s++),g.scalabilityMode="L1T".concat(u)}catch(xC){v.e(xC)}finally{v.f()}}return(y=kp(this._sendingRtpParametersByKind[n.kind],{})).codecs=Np(y.codecs,a),(b=kp(this._sendingRemoteRtpParametersByKind[n.kind],{})).codecs=Np(b.codecs,a),k=this._remoteSdp.getNextMediaSectionIdx(),_=this._pc.addTransceiver(n,{direction:"sendonly",streams:[this._sendStream],sendEncodings:r}),e.next=10,this._pc.createOffer();case 10:if(w=e.sent,x=A.Qc(w.sdp),e.t0=this._transportReady,e.t0){e.next=16;break}return e.next=16,this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:x});case 16:return Nh.debug("send() | calling pc.setLocalDescription() [offer:%o]",w),e.next=19,this._pc.setLocalDescription(w);case 19:return S=_.mid,y.mid=S,x=A.Qc(this._pc.localDescription.sdp),E=x.media[k.idx],y.rtcp.cname=yh({offerMediaObject:E}),r?1===r.length?(T=kh({offerMediaObject:E}),Object.assign(T[0],r[0]),y.encodings=T):y.encodings=r:y.encodings=kh({offerMediaObject:E}),this._remoteSdp.send({offerMediaObject:E,reuseMid:k.reuseMid,offerRtpParameters:y,answerRtpParameters:b,codecOptions:i,extmapAllowMixed:!0}),P={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("send() | calling pc.setRemoteDescription() [answer:%o]",P),e.next=28,this._pc.setRemoteDescription(P);case 28:return this._mapMidTransceiver.set(S,_),e.abrupt("return",{localId:S,rtpParameters:y,rtpSender:_.sender});case 30:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Nh.debug("stopSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:if(n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),this._remoteSdp.closeMediaSection(n.mid))try{n.stop()}catch(a){}return e.next=7,this._pc.createOffer();case 7:return r=e.sent,Nh.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:this._mapMidTransceiver.delete(t);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Nh.debug("pauseSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",this._remoteSdp.pauseMediaSection(t),e.next=7,this._pc.createOffer();case 7:return r=e.sent,Nh.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Nh.debug("resumeSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t),this._remoteSdp.resumeSendingMediaSection(t),n){e.
2next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="sendonly",e.next=7,this._pc.createOffer();case 7:return r=e.sent,Nh.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n?Nh.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):Nh.debug("replaceTrack() [localId:%s, no track]",t),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Nh.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){e.active=t<=n})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Nh.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Nh.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Nh.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.sender.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.ordered,r=t.maxPacketLifeTime,i=t.maxRetransmits,a=t.label,o=t.protocol,this.assertSendDirection(),c={negotiated:!0,id:this._nextSendSctpStreamId,ordered:n,maxPacketLifeTime:r,maxRetransmits:i,protocol:o},Nh.debug("sendDataChannel() [options:%o]",c),u=this._pc.createDataChannel(a,c),this._nextSendSctpStreamId=++this._nextSendSctpStreamId%jh.MIS,this._hasDataChannelMediaSection){e.next=24;break}return e.next=8,this._pc.createOffer();case 8:if(l=e.sent,d=A.Qc(l.sdp),h=d.media.find((function(e){return"application"===e.type})),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:d});case 15:return Nh.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",l),e.next=18,this._pc.setLocalDescription(l);case 18:return this._remoteSdp.sendSctpAssociation({offerMediaObject:h}),f={type:"answer",sdp:this._remoteSdp.getSdp()},Nh.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=23,this._pc.setRemoteDescription(f);case 23:this._hasDataChannelMediaSection=!0;case 24:return v={streamId:c.id,ordered:c.ordered,maxPacketLifeTime:c.maxPacketLifeTime,maxRetransmits:c.maxRetransmits},e.abrupt("return",{dataChannel:u,sctpStreamParameters:v});case 26:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receive",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),r=[],i=new Map,a=(0,c.Z)(t);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.trackId,l=s.kind,d=s.rtpParameters,h=s.streamId,Nh.debug("receive() [trackId:%s, kind:%s]",u,l),f=d.mid||String(this._mapMidTransceiver.size),i.set(u,f),this._remoteSdp.receive({mid:f,kind:l,offerRtpParameters:d,streamId:h||d.rtcp.cname,trackId:u})}catch(xC){a.e(xC)}finally{a.f()}return v={type:"offer",sdp:this._remoteSdp.getSdp()},Nh.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",v),e.next=8,this._pc.setRemoteDescription(v);case 8:return e.next=10,this._pc.createAnswer();case 10:m=e.sent,g=A.Qc(m.sdp),y=(0,c.Z)(t),e.prev=13,k=(0,p.Z)().mark((function e(){var t,n,r,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=b.value,n=t.trackId,r=t.rtpParameters,a=i.get(n),o=g.media.find((function(e){return String(e.mid)===a})),bh({offerRtpParameters:r,answerMediaObject:o});case 3:case"end":return e.stop()}}),e)})),y.s();case 16:if((b=y.n()).done){e.next=20;break}return e.delegateYield(k(),"t0",18);case 18:e.next=16;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(13),y.e(e.t1);case 25:return e.prev=25,y.f(),e.finish(25);case 28:if(m={type:"answer",sdp:A.cW(g)},e.t2=this._transportReady,e.t2){e.next=33;break}return e.next=33,this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:g});case 33:return Nh.debug("receive() | calling pc.setLocalDescription() [answer:%o]",m),e.next=36,this._pc.setLocalDescription(m);case 36:_=(0,c.Z)(t),e.prev=37,x=(0,p.Z)().mark((function e(){var t,n,a,o;return(0,p.Z)().wrap((function(e){for(;;
2)switch(e.prev=e.next){case 0:if(t=w.value,n=t.trackId,a=i.get(n),o=S._pc.getTransceivers().find((function(e){return e.mid===a})),!o){e.next=6;break}S._mapMidTransceiver.set(a,o),r.push({localId:a,track:o.receiver.track,rtpReceiver:o.receiver}),e.next=7;break;case 6:throw new Error("new RTCRtpTransceiver not found");case 7:case"end":return e.stop()}}),e)})),_.s();case 40:if((w=_.n()).done){e.next=44;break}return e.delegateYield(x(),"t3",42);case 42:e.next=40;break;case 44:e.next=49;break;case 46:e.prev=46,e.t4=e.catch(37),_.e(e.t4);case 49:return e.prev=49,_.f(),e.finish(49);case 52:return e.abrupt("return",r);case 53:case"end":return e.stop()}}),e,this,[[13,22,25,28],[37,46,49,52]])})));return function(t){return e.apply(this,arguments)}}()},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Nh.debug("stopReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:this._remoteSdp.closeMediaSection(a.mid);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Nh.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Nh.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:u=(0,c.Z)(t);try{for(u.s();!(l=u.n()).done;)d=l.value,this._mapMidTransceiver.delete(d)}catch(xC){u.e(xC)}finally{u.f()}case 33:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Nh.debug("pauseReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="inactive",this._remoteSdp.pauseMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Nh.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Nh.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Nh.debug("resumeReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Nh.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Nh.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertRecvDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receiveDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.sctpStreamParameters,r=t.label,i=t.protocol,this.assertRecvDirection(),o=n.streamId,s=n.ordered,c=n.maxPacketLifeTime,u=n.maxRetransmits,l={negotiated:!0,id:o,ordered:s,maxPacketLifeTime:c,maxRetransmits:u,protocol:i}
2,Nh.debug("receiveDataChannel() [options:%o]",l),d=this._pc.createDataChannel(r,l),this._hasDataChannelMediaSection){e.next=22;break}return this._remoteSdp.receiveSctpAssociation(),h={type:"offer",sdp:this._remoteSdp.getSdp()},Nh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",h),e.next=11,this._pc.setRemoteDescription(h);case 11:return e.next=13,this._pc.createAnswer();case 13:if(f=e.sent,this._transportReady){e.next=18;break}return v=A.Qc(f.sdp),e.next=18,this.setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"client",localSdpObject:v});case 18:return Nh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=21,this._pc.setLocalDescription(f);case 21:this._hasDataChannelMediaSection=!0;case 22:return e.abrupt("return",{dataChannel:d});case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.localDtlsRole,(r=t.localSdpObject)||(r=A.Qc(this._pc.localDescription.sdp)),(i=gh({sdpObject:r})).role=n,this._remoteSdp.updateDtlsRole("client"===n?"server":"client"),e.next=7,new Promise((function(e,t){a.safeEmit("@connect",{dtlsParameters:i},e,t)}));case 7:this._transportReady=!0;case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(wh);function Uh(){var e,t=kp(RTCRtpReceiver.getCapabilities(),{}),n=(0,c.Z)(t.codecs);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(r.channels=r.numChannels,delete r.numChannels,r.mimeType=r.mimeType||"".concat(r.kind,"/").concat(r.name),r.parameters){var i=r.parameters;i.apt&&(i.apt=Number(i.apt)),i["packetization-mode"]&&(i["packetization-mode"]=Number(i["packetization-mode"]))}var a,o=(0,c.Z)(r.rtcpFeedback||[]);try{for(o.s();!(a=o.n()).done;){var s=a.value;s.parameter||(s.parameter="")}}catch(xC){o.e(xC)}finally{o.f()}}}catch(xC){n.e(xC)}finally{n.f()}return t}function Vh(e){var t=kp(e,{});t.mid&&(t.muxId=t.mid,delete t.mid);var n,r=(0,c.Z)(t.codecs);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.channels&&(i.numChannels=i.channels,delete i.channels),i.mimeType&&!i.name&&(i.name=i.mimeType.split("/")[1]),delete i.mimeType}}catch(xC){r.e(xC)}finally{r.f()}return t}var Fh=new vp("Edge11"),zh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this))._rtpSenders=new Map,e._rtpReceivers=new Map,e._nextSendLocalId=0,e._transportReady=!1,e}return(0,y.Z)(n,[{key:"name",get:function(){return"Edge11"}},{key:"close",value:function(){Fh.debug("close()");try{this._iceGatherer.close()}catch(n){}try{this._iceTransport.stop()}catch(n){}try{this._dtlsTransport.stop()}catch(n){}var e,t=(0,c.Z)(this._rtpSenders.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;try{n.stop()}catch(o){}}}catch(xC){t.e(xC)}finally{t.f()}var r,i=(0,c.Z)(this._rtpReceivers.values());try{for(i.s();!(r=i.n()).done;){var a=r.value;try{a.stop()}catch(o){}}}catch(xC){i.e(xC)}finally{i.f()}this.emit("@close")}},{key:"getNativeRtpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Fh.debug("getNativeRtpCapabilities()"),Uh()));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"getNativeSctpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Fh.debug("getNativeSctpCapabilities()"),{numStreams:{OS:0,MIS:0}}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"run",value:function(e){e.direction;var t=e.iceParameters,n=e.iceCandidates,r=e.dtlsParameters,i=(e.sctpParameters,e.iceServers),a=e.iceTransportPolicy,o=(e.additionalSettings,e.proprietaryConstraints,e.extendedRtpCapabilities);Fh.debug("run()"),this._sendingRtpParametersByKind={audio:Lp("audio",o),video:Lp("video",o)},this._remoteIceParameters=t,this._remoteIceCandidates=n,this._remoteDtlsParameters=r,this._cname="CNAME-".concat(_p()),this.setIceGatherer({iceServers:i,iceTransportPolicy:a}),this.setIceTransport(),this.setDtlsTransport()}},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new yp("not supported");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fh.debug("restartIce()"),this._remoteIceParameters=t,this._transportReady){Fh.debug("restartIce() | calling iceTransport.start()"),this._iceTransport.start(this._iceGatherer,t,"controlling"),n=(0,c.Z)(this._remoteIceCandidates);try{for(n.s();!(r=n.n()).done;)i=r.value,this._iceTransport.addRemoteCandidate(i)}catch(xC){n.e(xC)}finally{n.f()}this._iceTransport.addRemoteCandidate({})}case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._iceTransport.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.track,r=t.encodings,t.codecOptions,i=t.codec,Fh.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),e.t0=this._transportReady,e.t0){e.next=6;break}return e.next=6,this.setupTransport({localDtlsRole:"server"});case 6:Fh.debug("send() | calling new RTCRtpSender()"),a=new RTCRtpSender(n,this._dtlsTransport),(o=kp(this._sendingRtpParametersByKind[n.kind],{})).codecs=Np(o.codecs,i),s=o.codecs.some((function(e){return/.+\/rtx$/i.test(e.mimeType)})),r||(r=[{}]),u=(0,c.Z)(r);try{for(u.s();!(l=u.n()).done;)(d=l.value).ssrc=_p(),s&&(d.rtx={ssrc:_p()})}catch(xC){u.e(xC)}finally{u.f()}return o.encodings=r,o.rtcp={cname:this._cname,reducedSize:!0,mux:!0},h=Vh(o),Fh.debug("send() | calling rtpSender.send() [params:%o]",h),e.next=18,a.send(h);case 18:return f=String(this._nextSendLocalId),e.abrupt("return",(this._nextSendLocalId++,this._rtpSe
2nders.set(f,a),{localId:f,rtpParameters:o,rtpSender:a}));case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fh.debug("stopSending() [localId:%s]",t),n=this._rtpSenders.get(t)){e.next=4;break}throw new Error("RTCRtpSender not found");case 4:this._rtpSenders.delete(t),e.prev=5,Fh.debug("stopSending() | calling rtpSender.stop()"),n.stop(),e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(5),Fh.warn("stopSending() | rtpSender.stop() failed:%o",e.t0),e.t0;case 12:case"end":return e.stop()}}),e,this,[[5,9]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n?Fh.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):Fh.debug("replaceTrack() [localId:%s, no track]",t),r=this._rtpSenders.get(t)){e.next=4;break}throw new Error("RTCRtpSender not found");case 4:r.setTrack(n);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fh.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",t,n),r=this._rtpSenders.get(t)){e.next=4;break}throw new Error("RTCRtpSender not found");
2case 4:return(i=r.getParameters()).encodings.forEach((function(e,t){e.active=t<=n})),e.next=8,r.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fh.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this._rtpSenders.get(t)){e.next=4;break}throw new Error("RTCRtpSender not found");case 4:return(i=r.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._rtpSenders.get(t)){e.next=3;break}throw new Error("RTCRtpSender not found");case 3:return e.abrupt("return",n.getStats());case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new yp("not implemented");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"receive",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],r=(0,c.Z)(t);try{for(r.s();!(i=r.n()).done;)a=i.value,o=a.trackId,s=a.kind,Fh.debug("receive() [trackId:%s, kind:%s]",o,s)}catch(xC){r.e(xC)}finally{r.f()}if(e.t0=this._transportReady,e.t0){e.next=7;break}return e.next=7,this.setupTransport({localDtlsRole:"server"});case 7:u=(0,c.Z)(t),e.prev=8,u.s();case 10:if((l=u.n()).done){e.next=24;break}return d=l.value,h=d.trackId,f=d.kind,v=d.rtpParameters,Fh.debug("receive() | calling new RTCRtpReceiver()"),(m=new RTCRtpReceiver(this._dtlsTransport,f)).addEventListener("error",(function(e){Fh.error('rtpReceiver "error" event [event:%o]',e)})),g=Vh(v),Fh.debug("receive() | calling rtpReceiver.receive() [params:%o]",g),e.next=20,m.receive(g);case 20:y=h,this._rtpReceivers.set(y,m),n.push({localId:y,track:m.track,rtpReceiver:m});case 22:e.next=10;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(8),u.e(e.t1);case 29:return e.prev=29,u.f(),e.finish(29);case 32:return e.abrupt("return",n);case 33:case"end":return e.stop()}}),e,this,[[8,26,29,32]])})));return function(t){return e.apply(this,arguments)}}()},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(0,c.Z)(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=13;break}if(i=r.value,Fh.debug("stopReceiving() [localId:%s]",i),a=this._rtpReceivers.get(i)){e.next=9;break}throw new Error("RTCRtpReceiver not found");case 9:this._rtpReceivers.delete(i);try{Fh.debug("stopReceiving() | calling rtpReceiver.stop()"),a.stop()}catch(E){Fh.warn("stopReceiving() | rtpReceiver.stop() failed:%o",E)}case 11:e.next=3;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[1,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._rtpReceivers.get(t)){e.next=3;break}throw new Error("RTCRtpReceiver not found");case 3:return e.abrupt("return",n.getStats());case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receiveDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new yp("not implemented");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"setIceGatherer",value:function(e){var t=e.iceServers,n=e.iceTransportPolicy,r=new RTCIceGatherer({iceServers:t||[],gatherPolicy:n||"all"});r.addEventListener("error",(function(e){Fh.error('iceGatherer "error" event [event:%o]',e)}));try{r.gather()}catch(E){Fh.debug("setIceGatherer() | iceGatherer.gather() failed: %s",E.toString())}this._iceGatherer=r}},{key:"setIceTransport",value:function(){var e=this,t=new RTCIceTransport(this._iceGatherer);t.addEventListener("statechange",(function(){switch(t.state){case"checking":e.emit("@connectionstatechange","connecting");break;case"connected":case"completed":e.emit("@connectionstatechange","connected");break;case"failed":e.emit("@connectionstatechange","failed");break;case"disconnected":e.emit("@connectionstatechange","disconnected");break;case"closed":e.emit("@connectionstatechange","closed")}}
2)),t.addEventListener("icestatechange",(function(){switch(t.state){case"checking":e.emit("@connectionstatechange","connecting");break;case"connected":case"completed":e.emit("@connectionstatechange","connected");break;case"failed":e.emit("@connectionstatechange","failed");break;case"disconnected":e.emit("@connectionstatechange","disconnected");break;case"closed":e.emit("@connectionstatechange","closed")}})),t.addEventListener("candidatepairchange",(function(e){Fh.debug('iceTransport "candidatepairchange" event [pair:%o]',e.pair)})),this._iceTransport=t}},{key:"setDtlsTransport",value:function(){var e=this,t=new RTCDtlsTransport(this._iceTransport);t.addEventListener("statechange",(function(){Fh.debug('dtlsTransport "statechange" event [state:%s]',t.state)})),t.addEventListener("dtlsstatechange",(function(){Fh.debug('dtlsTransport "dtlsstatechange" event [state:%s]',t.state),"closed"===t.state&&e.emit("@connectionstatechange","closed")})),t.addEventListener("error",(function(e){Fh.error('dtlsTransport "error" event [event:%o]',e)})),this._dtlsTransport=t}},{key:"setupTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.localDtlsRole,Fh.debug("setupTransport()"),(r=this._dtlsTransport.getLocalParameters()).role=n,e.next=6,new Promise((function(e,t){s.safeEmit("@connect",{dtlsParameters:r},e,t)}));case 6:this._iceTransport.start(this._iceGatherer,this._remoteIceParameters,"controlling"),i=(0,c.Z)(this._remoteIceCandidates);try{for(i.s();!(a=i.n()).done;)o=a.value,this._iceTransport.addRemoteCandidate(o)}catch(xC){i.e(xC)}finally{i.f()}this._iceTransport.addRemoteCandidate({}),this._remoteDtlsParameters.fingerprints=this._remoteDtlsParameters.fingerprints.filter((function(e){return"sha-256"===e.algorithm||"sha-384"===e.algorithm||"sha-512"===e.algorithm})),this._dtlsTransport.start(this._remoteDtlsParameters),this._transportReady=!0;case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(wh),Hh=new vp("Firefox60"),qh={OS:16,MIS:2048},Gh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this))._mapMidTransceiver=new Map,e._sendStream=new MediaStream,e._hasDataChannelMediaSection=!1,e._nextSendSctpStreamId=0,e._transportReady=!1,e}return(0,y.Z)(n,[{key:"name",get:function(){return"Firefox60"}},{key:"close",value:function(){if(Hh.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}},{key:"getNativeRtpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Hh.debug("getNativeRtpCapabilities()"),t=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"}),(n=document.createElement("canvas")).getContext("2d"),r=n.captureStream().getVideoTracks()[0],e.prev=4,t.addTransceiver("audio",{direction:"sendrecv"}),i=t.addTransceiver(r,{direction:"sendrecv"}),a=i.sender.getParameters(),o=[{rid:"r0",maxBitrate:1e5},{rid:"r1",maxBitrate:5e5}],a.encodings=o,e.next=10,i.sender.setParameters(a);case 10:return e.next=12,t.createOffer();case 12:s=e.sent;try{n.remove()}catch(u){}try{r.stop()}catch(u){}try{t.close()}catch(u){}return c=A.Qc(s.sdp),e.abrupt("return",mh({sdpObject:c}));case 20:e.prev=20,e.t0=e.catch(4);try{n.remove()}catch(a){}try{r.stop()}catch(a){}try{t.close()}catch(a){}throw e.t0;case 26:case"end":return e.stop()}}),e,null,[[4,20]])})));return function(){return e.apply(this,arguments)}}()},{key:"getNativeSctpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Hh.debug("getNativeSctpCapabilities()"),{numStreams:qh}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"run",value:function(e){var t=this,n=e.direction,r=e.iceParameters,i=e.iceCandidates,a=e.dtlsParameters,o=e.sctpParameters,c=e.iceServers,u=e.iceTransportPolicy,l=e.additionalSettings,d=e.proprietaryConstraints,p=e.extendedRtpCapabilities;Hh.debug("run()"),this._direction=n,this._remoteSdp=new Ch({iceParameters:r,iceCandidates:i,dtlsParameters:a,sctpParameters:o}),this._sendingRtpParametersByKind={audio:Lp("audio",p),video:Lp("video",p)},this._sendingRemoteRtpParametersByKind={audio:Dp("audio",p),video:Dp("video",p)},this._pc=new RTCPeerConnection((0,s.Z)({iceServers:c||[],iceTransportPolicy:u||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"},l),d),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(function(){t.emit("@connectionstatechange",t._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(function(){switch(Hh.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),t._pc.iceConnectionState){case"checking":t.emit("@connectionstatechange","connecting");break;case"connected":case"completed":t.emit("@connectionstatechange","connected");break;case"failed":t.emit("@connectionstatechange","failed");break;case"disconnected":t.emit("@connectionstatechange","disconnected");break;case"closed":t.emit("@connectionstatechange","closed")}}
2))}},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new yp("not supported");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Hh.debug("restartIce()"),this._remoteSdp.updateIceParameters(t),!this._transportReady){e.next=24;break}if("send"!==this._direction){e.next=14;break}return e.next=4,this._pc.createOffer({iceRestart:!0});case 4:return n=e.sent,Hh.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",n),e.next=8,this._pc.setLocalDescription(n);case 8:return r={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",r),e.next=12,this._pc.setRemoteDescription(r);case 12:e.next=24;break;case 14:return i={type:"offer",sdp:this._remoteSdp.getSdp()},Hh.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",i),e.next=18,this._pc.setRemoteDescription(i);case 18:return e.next=20,this._pc.createAnswer();case 20:return a=e.sent,Hh.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",a),e.next=24,this._pc.setLocalDescription(a);case 24:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.track,r=t.encodings,i=t.codecOptions,a=t.codec,this.assertSendDirection(),Hh.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),r&&((r=kp(r,[])).length>1&&(r.forEach((function(e,t){e.rid="r".concat(t)})),r.reverse())),(o=kp(this._sendingRtpParametersByKind[n.kind],{})).codecs=Np(o.codecs,a),(s=kp(this._sendingRemoteRtpParametersByKind[n.kind],{})).codecs=Np(s.codecs,a),u=this._pc.addTransceiver(n,{direction:"sendonly",streams:[this._sendStream]}),!r){e.next=12;break}return(l=u.sender.getParameters()).encodings=r,e.next=12,u.sender.setParameters(l);case 12:return e.next=14,this._pc.createOffer();case 14:if(d=e.sent,h=A.Qc(d.sdp),e.t0=this._transportReady,e.t0){e.next=20;break}return e.next=20,this.setupTransport({localDtlsRole:"client",localSdpObject:h});case 20:return f=Zh((r||[{}])[0].scalabilityMode),Hh.debug("send() | calling pc.setLocalDescription() [offer:%o]",d),e.next=24,this._pc.setLocalDescription(d);case 24:if(v=u.mid,o.mid=v,h=A.Qc(this._pc.localDescription.sdp),m=h.media[h.media.length-1],o.rtcp.cname=yh({offerMediaObject:m}),r?1===r.length?(g=kh({offerMediaObject:m}),Object.assign(g[0],r[0]),o.encodings=g):o.encodings=r.reverse():o.encodings=kh({offerMediaObject:m}),o.encodings.length>1&&("video/vp8"===o.codecs[0].mimeType.toLowerCase()||"video/h264"===o.codecs[0].mimeType.toLowerCase())){y=(0,c.Z)(o.encodings);try{for(y.s();!(b=y.n()).done;)(k=b.value).scalabilityMode?k.scalabilityMode="L1T".concat(f.temporalLayers):k.scalabilityMode="L1T3"}catch(xC){y.e(xC)}finally{y.f()}}return this._remoteSdp.send({offerMediaObject:m,offerRtpParameters:o,answerRtpParameters:s,codecOptions:i,extmapAllowMixed:!0}),_={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("send() | calling pc.setRemoteDescription() [answer:%o]",_),e.next=34,this._pc.setRemoteDescription(_);case 34:return this._mapMidTransceiver.set(v,u),e.abrupt("return",{localId:v,rtpParameters:o,rtpSender:u.sender});case 36:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Hh.debug("stopSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated transceiver not found");case 4:return n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),this._remoteSdp.disableMediaSection(n.mid),e.next=7,this._pc.createOffer();case 7:return r=e.sent,Hh.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:this._mapMidTransceiver.delete(t);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Hh.debug("pauseSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",this._remoteSdp.pauseMediaSection(t),e.next=7,this._pc.createOffer();case 7:return r=e.sent,Hh.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Hh.debug("resumeSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(t),e.next=7,this._pc.createOffer();case 7:return r=e.sent,Hh.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n?Hh.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):Hh.debug("replaceTrack() [localId:%s, no track]",t),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Hh.debug("setMaxSpatialLayer() [localId:%s, spatialL
2ayer:%s]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated transceiver not found");case 4:return i=r.sender.getParameters(),n=i.encodings.length-1-n,i.encodings.forEach((function(e,t){e.active=t>=n})),e.next=9,r.sender.setParameters(i);case 9:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=12,this._pc.createOffer();case 12:return a=e.sent,Hh.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",a),e.next=16,this._pc.setLocalDescription(a);case 16:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=20,this._pc.setRemoteDescription(o);case 20:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Hh.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Hh.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.sender.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.ordered,r=t.maxPacketLifeTime,i=t.maxRetransmits,a=t.label,o=t.protocol,this.assertSendDirection(),s={negotiated:!0,id:this._nextSendSctpStreamId,ordered:n,maxPacketLifeTime:r,maxRetransmits:i,protocol:o},Hh.debug("sendDataChannel() [options:%o]",s),c=this._pc.createDataChannel(a,s),this._nextSendSctpStreamId=++this._nextSendSctpStreamId%qh.MIS,this._hasDataChannelMediaSection){e.next=24;break}return e.next=8,this._pc.createOffer();case 8:if(u=e.sent,l=A.Qc(u.sdp),d=l.media.find((function(e){return"application"===e.type})),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:"client",localSdpObject:l});case 15:return Hh.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",u),e.next=18,this._pc.setLocalDescription(u);case 18:return this._remoteSdp.sendSctpAssociation({offerMediaObject:d}),h={type:"answer",sdp:this._remoteSdp.getSdp()},Hh.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",h),e.next=23,this._pc.setRemoteDescription(h);case 23:this._hasDataChannelMediaSection=!0;case 24:return f={streamId:s.id,ordered:s.ordered,maxPacketLifeTime:s.maxPacketLifeTime,maxRetransmits:s.maxRetransmits},e.abrupt("return",{dataChannel:c,sctpStreamParameters:f});case 26:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receive",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=[],r=new Map,i=(0,c.Z)(t);try{for(i.s();!(a=i.n()).done;)o=a.value,s=o.trackId,u=o.kind,l=o.rtpParameters,d=o.streamId,Hh.debug("receive() [trackId:%s, kind:%s]",s,u),h=l.mid||String(this._mapMidTransceiver.size),r.set(s,h),this._remoteSdp.receive({mid:h,kind:u,offerRtpParameters:l,streamId:d||l.rtcp.cname,trackId:s})}catch(xC){i.e(xC)}finally{i.f()}return f={type:"offer",sdp:this._remoteSdp.getSdp()},Hh.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",f),e.next=8,this._pc.setRemoteDescription(f);case 8:return e.next=10,this._pc.createAnswer();case 10:v=e.sent,m=A.Qc(v.sdp),g=(0,c.Z)(t),e.prev=13,b=(0,p.Z)().mark((function e(){var t,n,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=y.value,n=t.trackId,i=t.rtpParameters,a=r.get(n),o=m.media.find((function(e){return String(e.mid)===a})),bh({offerRtpParameters:i,answerMediaObject:o}),v={type:"answer",sdp:A.cW(m)};case 3:case"end":return e.stop()}}),e)})),g.s();case 16:if((y=g.n()).done){e.next=20;break}return e.delegateYield(b(),"t0",18);case 18:e.next=16;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(13),g.e(e.t1);case 25:return e.prev=25,g.f(),e.finish(25);case 28:if(e.t2=this._transportReady,e.t2){e.next=32;break}return e.next=32,this.setupTransport({localDtlsRole:"client",localSdpObject:m});case 32:return Hh.debug("receive() | calling pc.setLocalDescription() [answer:%o]",v),e.next=35,this._pc.setLocalDescription(v);case 35:k=(0,c.Z)(t),e.prev=36,w=(0,p.Z)().mark((function e(){var t,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=_.value,i=t.trackId,a=r.get(i),o=x._pc.getTransceivers().find((function(e){return e.mid===a})),o){e.next=4;break}throw new Error("new RTCRtpTransceiver not found");case 4:x._mapMidTransceiver.set(a,o),n.push({localId:a,track:o.receiver.track,rtpReceiver:o.receiver});case 5:case"end":return e.stop()}}),e)})),k.s();case 39:if((_=k.n()).done){e.next=43;break}return e.delegateYield(w(),"t3",41);case 41:e.next=39;break;case 43:e.next=48;break;case 45:e.prev=45,e.t4=e.catch(36),k.e(e.t4);case 48:return e.prev=48,k.f(),e.finish(48);case 51:return e.abrupt("return",n);case 52:case"end":return e.stop()}}),e,this,[[13,22,25,28],[36,45,48,51]])})));return function(t){return e.apply(this,arguments)}}()},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Hh.debug("stopReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:this._remoteSdp.closeMediaSection(a.mid);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Hh.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Hh.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:u=(0,c.Z)(t);try{for(u.s();!(l=u.n()).done;)d=l.value,this._mapMidTransceiver.delete(d)}catch(xC){u.e(xC)}finally{u.f()}case 33:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Hh.debug("pauseReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="inactive",this._remoteSdp.pauseMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Hh.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Hh.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Hh.debug("resumeReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Hh.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Hh.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertRecvDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receiveDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.sctpStreamParameters,r=t.label,i=t.protocol,this.assertRecvDirection(),a=n.streamId,o=n.ordered,s=n.maxPacketLifeTime,c=n.maxRetransmits,u={negotiated:!0,id:a,ordered:o,maxPacketLifeTime:s,maxRetransmits:c,protocol:i}
2,Hh.debug("receiveDataChannel() [options:%o]",u),l=this._pc.createDataChannel(r,u),this._hasDataChannelMediaSection){e.next=22;break}return this._remoteSdp.receiveSctpAssociation(),d={type:"offer",sdp:this._remoteSdp.getSdp()},Hh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",d),e.next=11,this._pc.setRemoteDescription(d);case 11:return e.next=13,this._pc.createAnswer();case 13:if(h=e.sent,this._transportReady){e.next=18;break}return f=A.Qc(h.sdp),e.next=18,this.setupTransport({localDtlsRole:"client",localSdpObject:f});case 18:return Hh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",h),e.next=21,this._pc.setLocalDescription(h);case 21:this._hasDataChannelMediaSection=!0;case 22:return e.abrupt("return",{dataChannel:l});case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.localDtlsRole,(r=t.localSdpObject)||(r=A.Qc(this._pc.localDescription.sdp)),(i=gh({sdpObject:r})).role=n,this._remoteSdp.updateDtlsRole("client"===n?"server":"client"),e.next=7,new Promise((function(e,t){a.safeEmit("@connect",{dtlsParameters:i},e,t)}));case 7:this._transportReady=!0;case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(wh),Wh=new vp("Safari12"),Jh={OS:1024,MIS:1024},$h=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this))._mapMidTransceiver=new Map,e._sendStream=new MediaStream,e._hasDataChannelMediaSection=!1,e._nextSendSctpStreamId=0,e._transportReady=!1,e}return(0,y.Z)(n,[{key:"name",get:function(){return"Safari12"}},{key:"close",value:function(){if(Wh.debug("close()"),this._pc)try{this._pc.close()}catch(e){}this.emit("@close")}},{key:"getNativeRtpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Wh.debug("getNativeRtpCapabilities()"),t=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"}),e.prev=2,t.addTransceiver("audio"),t.addTransceiver("video"),e.next=6,t.createOffer();case 6:n=e.sent;try{t.close()}catch(i){}return r=A.Qc(n.sdp),e.abrupt("return",mh({sdpObject:r}));case 12:e.prev=12,e.t0=e.catch(2);try{t.close()}catch(r){}throw e.t0;case 16:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"getNativeSctpCapabilities",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Wh.debug("getNativeSctpCapabilities()"),{numStreams:Jh}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"run",value:function(e){var t=this,n=e.direction,r=e.iceParameters,i=e.iceCandidates,a=e.dtlsParameters,o=e.sctpParameters,c=e.iceServers,u=e.iceTransportPolicy,l=e.additionalSettings,d=e.proprietaryConstraints,p=e.extendedRtpCapabilities;Wh.debug("run()"),this._direction=n,this._remoteSdp=new Ch({iceParameters:r,iceCandidates:i,dtlsParameters:a,sctpParameters:o}),this._sendingRtpParametersByKind={audio:Lp("audio",p),video:Lp("video",p)},this._sendingRemoteRtpParametersByKind={audio:Dp("audio",p),video:Dp("video",p)},a.role&&"auto"!==a.role&&(this._forcedLocalDtlsRole="server"===a.role?"client":"server"),this._pc=new RTCPeerConnection((0,s.Z)({iceServers:c||[],iceTransportPolicy:u||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"},l),d),this._pc.connectionState?this._pc.addEventListener("connectionstatechange",(function(){t.emit("@connectionstatechange",t._pc.connectionState)})):this._pc.addEventListener("iceconnectionstatechange",(function(){switch(Wh.warn("run() | pc.connectionState not supported, using pc.iceConnectionState"),t._pc.iceConnectionState){case"checking":t.emit("@connectionstatechange","connecting");break;case"connected":case"completed":t.emit("@connectionstatechange","connected");break;case"failed":t.emit("@connectionstatechange","failed");break;case"disconnected":t.emit("@connectionstatechange","disconnected");break;case"closed":t.emit("@connectionstatechange","closed")}}
2))}},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Wh.debug("updateIceServers()"),(n=this._pc.getConfiguration()).iceServers=t,this._pc.setConfiguration(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Wh.debug("restartIce()"),this._remoteSdp.updateIceParameters(t),!this._transportReady){e.next=24;break}if("send"!==this._direction){e.next=14;break}return e.next=4,this._pc.createOffer({iceRestart:!0});case 4:return n=e.sent,Wh.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",n),e.next=8,this._pc.setLocalDescription(n);case 8:return r={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("restartIce() | calling pc.setRemoteDescription() [answer:%o]",r),e.next=12,this._pc.setRemoteDescription(r);case 12:e.next=24;break;case 14:return i={type:"offer",sdp:this._remoteSdp.getSdp()},Wh.debug("restartIce() | calling pc.setRemoteDescription() [offer:%o]",i),e.next=18,this._pc.setRemoteDescription(i);case 18:return e.next=20,this._pc.createAnswer();case 20:return a=e.sent,Wh.debug("restartIce() | calling pc.setLocalDescription() [answer:%o]",a),e.next=24,this._pc.setLocalDescription(a);case 24:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.track,r=t.encodings,i=t.codecOptions,a=t.codec,this.assertSendDirection(),Wh.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),(s=kp(this._sendingRtpParametersByKind[n.kind],{})).codecs=Np(s.codecs,a),(u=kp(this._sendingRemoteRtpParametersByKind[n.kind],{})).codecs=Np(u.codecs,a),l=this._remoteSdp.getNextMediaSectionIdx(),d=this._pc.addTransceiver(n,{direction:"sendonly",streams:[this._sendStream]}),e.next=9,this._pc.createOffer();case 9:if(h=e.sent,f=A.Qc(h.sdp),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:null!==(o=this._forcedLocalDtlsRole)&&void 0!==o?o:"client",localSdpObject:f});case 15:return m=Zh((r||[{}])[0].scalabilityMode),r&&r.length>1&&(Wh.debug("send() | enabling legacy simulcast"),f=A.Qc(h.sdp),_h({offerMediaObject:v=f.media[l.idx],numStreams:r.length}),h={type:"offer",sdp:A.cW(f)}),Wh.debug("send() | calling pc.setLocalDescription() [offer:%o]",h),e.next=20,this._pc.setLocalDescription(h);case 20:if(g=d.mid,s.mid=g,f=A.Qc(this._pc.localDescription.sdp),v=f.media[l.idx],s.rtcp.cname=yh({offerMediaObject:v}),s.encodings=kh({offerMediaObject:v}),r)for(y=0;y<s.encodings.length;++y)r[y]&&Object.assign(s.encodings[y],r[y]);if(s.encodings.length>1&&("video/vp8"===s.codecs[0].mimeType.toLowerCase()||"video/h264"===s.codecs[0].mimeType.toLowerCase())){b=(0,c.Z)(s.encodings);try{for(b.s();!(k=b.n()).done;)(_=k.value).scalabilityMode?_.scalabilityMode="L1T".concat(m.temporalLayers):_.scalabilityMode="L1T3"}catch(xC){b.e(xC)}finally{b.f()}}return this._remoteSdp.send({offerMediaObject:v,reuseMid:l.reuseMid,offerRtpParameters:s,answerRtpParameters:u,codecOptions:i}),w={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("send() | calling pc.setRemoteDescription() [answer:%o]",w),e.next=28,this._pc.setRemoteDescription(w);case 28:return this._mapMidTransceiver.set(g,d),e.abrupt("return",{localId:g,rtpParameters:s,rtpSender:d.sender});case 30:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Wh.debug("stopSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:if(n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),this._remoteSdp.closeMediaSection(n.mid))try{n.stop()}catch(a){}return e.next=7,this._pc.createOffer();case 7:return r=e.sent,Wh.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:this._mapMidTransceiver.delete(t);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Wh.debug("pauseSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",this._remoteSdp.pauseMediaSection(t),e.next=7,this._pc.createOffer();case 7:return r=e.sent,Wh.debug("pauseSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("pauseSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Wh.debug("resumeSending() [localId:%s]",t),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="sendonly",this._remoteSdp.resumeSendingMediaSection(t),e.next=7,this._pc.createOffer();case 7:return r=e.sent,Wh.debug("resumeSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return i={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("resumeSending() | calling pc.setRemoteDescription() [answer:%o]",i),e.next=15,this._pc.setRemoteDescription(i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n?Wh.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):Wh.debug("replaceTrack() [localId:%s, no track]",t),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Wh.debug("setMaxSpatialLayer() [localId:%s, spatialL
2ayer:%s]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){e.active=t<=n})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Wh.debug("setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),Wh.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:return this._remoteSdp.muxMediaSectionSimulcast(t,i.encodings),e.next=11,this._pc.createOffer();case 11:return a=e.sent,Wh.debug("setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]",a),e.next=15,this._pc.setLocalDescription(a);case 15:return o={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]",o),e.next=19,this._pc.setRemoteDescription(o);case 19:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertSendDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.sender.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.ordered,r=t.maxPacketLifeTime,i=t.maxRetransmits,a=t.label,o=t.protocol,this.assertSendDirection(),c={negotiated:!0,id:this._nextSendSctpStreamId,ordered:n,maxPacketLifeTime:r,maxRetransmits:i,protocol:o},Wh.debug("sendDataChannel() [options:%o]",c),u=this._pc.createDataChannel(a,c),this._nextSendSctpStreamId=++this._nextSendSctpStreamId%Jh.MIS,this._hasDataChannelMediaSection){e.next=24;break}return e.next=8,this._pc.createOffer();case 8:if(l=e.sent,d=A.Qc(l.sdp),h=d.media.find((function(e){return"application"===e.type})),e.t0=this._transportReady,e.t0){e.next=15;break}return e.next=15,this.setupTransport({localDtlsRole:null!==(s=this._forcedLocalDtlsRole)&&void 0!==s?s:"client",localSdpObject:d});case 15:return Wh.debug("sendDataChannel() | calling pc.setLocalDescription() [offer:%o]",l),e.next=18,this._pc.setLocalDescription(l);case 18:return this._remoteSdp.sendSctpAssociation({offerMediaObject:h}),f={type:"answer",sdp:this._remoteSdp.getSdp()},Wh.debug("sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=23,this._pc.setRemoteDescription(f);case 23:this._hasDataChannelMediaSection=!0;case 24:return v={streamId:c.id,ordered:c.ordered,maxPacketLifeTime:c.maxPacketLifeTime,maxRetransmits:c.maxRetransmits},e.abrupt("return",{dataChannel:u,sctpStreamParameters:v});case 26:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receive",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),r=[],i=new Map,a=(0,c.Z)(t);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.trackId,l=s.kind,d=s.rtpParameters,h=s.streamId,Wh.debug("receive() [trackId:%s, kind:%s]",u,l),f=d.mid||String(this._mapMidTransceiver.size),i.set(u,f),this._remoteSdp.receive({mid:f,kind:l,offerRtpParameters:d,streamId:h||d.rtcp.cname,trackId:u})}catch(xC){a.e(xC)}finally{a.f()}return v={type:"offer",sdp:this._remoteSdp.getSdp()},Wh.debug("receive() | calling pc.setRemoteDescription() [offer:%o]",v),e.next=8,this._pc.setRemoteDescription(v);case 8:return e.next=10,this._pc.createAnswer();case 10:m=e.sent,g=A.Qc(m.sdp),y=(0,c.Z)(t),e.prev=13,k=(0,p.Z)().mark((function e(){var t,n,r,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=b.value,n=t.trackId,r=t.rtpParameters,a=i.get(n),o=g.media.find((function(e){return String(e.mid)===a})),bh({offerRtpParameters:r,answerMediaObject:o});case 3:case"end":return e.stop()}}),e)})),y.s();case 16:if((b=y.n()).done){e.next=20;break}return e.delegateYield(k(),"t0",18);case 18:e.next=16;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(13),y.e(e.t1);case 25:return e.prev=25,y.f(),e.finish(25);case 28:if(m={type:"answer",sdp:A.cW(g)},e.t2=this._transportReady,e.t2){e.next=33;break}return e.next=33,this.setupTransport({localDtlsRole:null!==(n=this._forcedLocalDtlsRole)&&void 0!==n?n:"client",localSdpObject:g});case 33:return Wh.debug("receive() | calling pc.setLocalDescription() [answer:%o]",m),e.next=36,this._pc.setLocalDescription(m);case 36:_=(0,c.Z)(t),e.prev=37,x=(0,p.Z)().mark((function e(){var t,n,a,o;return(0,p.Z)().wrap((function(e){for(;;
2)switch(e.prev=e.next){case 0:if(t=w.value,n=t.trackId,a=i.get(n),o=S._pc.getTransceivers().find((function(e){return e.mid===a})),o){e.next=4;break}throw new Error("new RTCRtpTransceiver not found");case 4:S._mapMidTransceiver.set(a,o),r.push({localId:a,track:o.receiver.track,rtpReceiver:o.receiver});case 5:case"end":return e.stop()}}),e)})),_.s();case 40:if((w=_.n()).done){e.next=44;break}return e.delegateYield(x(),"t3",42);case 42:e.next=40;break;case 44:e.next=49;break;case 46:e.prev=46,e.t4=e.catch(37),_.e(e.t4);case 49:return e.prev=49,_.f(),e.finish(49);case 52:return e.abrupt("return",r);case 53:case"end":return e.stop()}}),e,this,[[13,22,25,28],[37,46,49,52]])})));return function(t){return e.apply(this,arguments)}}()},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Wh.debug("stopReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:this._remoteSdp.closeMediaSection(a.mid);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Wh.debug("stopReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Wh.debug("stopReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:u=(0,c.Z)(t);try{for(u.s();!(l=u.n()).done;)d=l.value,this._mapMidTransceiver.delete(d)}catch(xC){u.e(xC)}finally{u.f()}case 33:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Wh.debug("pauseReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="inactive",this._remoteSdp.pauseMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Wh.debug("pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Wh.debug("pauseReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.assertRecvDirection(),n=(0,c.Z)(t),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=13;break}if(i=r.value,Wh.debug("resumeReceiving() [localId:%s]",i),a=this._mapMidTransceiver.get(i)){e.next=10;break}throw new Error("associated RTCRtpTransceiver not found");case 10:a.direction="recvonly",this._remoteSdp.resumeReceivingMediaSection(i);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),n.e(e.t0);case 18:return e.prev=18,n.f(),e.finish(18);case 21:return o={type:"offer",sdp:this._remoteSdp.getSdp()},Wh.debug("resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]",o),e.next=25,this._pc.setRemoteDescription(o);case 25:return e.next=27,this._pc.createAnswer();case 27:return s=e.sent,Wh.debug("resumeReceiving() | calling pc.setLocalDescription() [answer:%o]",s),e.next=31,this._pc.setLocalDescription(s);case 31:case"end":return e.stop()}}),e,this,[[2,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.assertRecvDirection(),n=this._mapMidTransceiver.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"receiveDataChannel",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.sctpStreamParameters,r=t.label,i=t.protocol,this.assertRecvDirection(),o=n.streamId,s=n.ordered,c=n.maxPacketLifeTime,u=n.maxRetransmits,l={negotiated:!0,id:o,ordered:s,maxPacketLifeTime:c,maxRetransmits:u,protocol:i}
2,Wh.debug("receiveDataChannel() [options:%o]",l),d=this._pc.createDataChannel(r,l),this._hasDataChannelMediaSection){e.next=22;break}return this._remoteSdp.receiveSctpAssociation(),h={type:"offer",sdp:this._remoteSdp.getSdp()},Wh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]",h),e.next=11,this._pc.setRemoteDescription(h);case 11:return e.next=13,this._pc.createAnswer();case 13:if(f=e.sent,this._transportReady){e.next=18;break}return v=A.Qc(f.sdp),e.next=18,this.setupTransport({localDtlsRole:null!==(a=this._forcedLocalDtlsRole)&&void 0!==a?a:"client",localSdpObject:v});case 18:return Wh.debug("receiveDataChannel() | calling pc.setRemoteDescription() [answer:%o]",f),e.next=21,this._pc.setLocalDescription(f);case 21:this._hasDataChannelMediaSection=!0;case 22:return e.abrupt("return",{dataChannel:d});case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.localDtlsRole,(r=t.localSdpObject)||(r=A.Qc(this._pc.localDescription.sdp)),(i=gh({sdpObject:r})).role=n,this._remoteSdp.updateDtlsRole("client"===n?"server":"client"),e.next=7,new Promise((function(e,t){a.safeEmit("@connect",{dtlsParameters:i},e,t)}));case 7:this._transportReady=!0;case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(wh),Kh=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.handlerName,i=e.handlerFactory,a=e.Handler;return(0,g.Z)(this,n),t.call(this,{handlerName:r,handlerFactory:i,Handler:a})}return(0,y.Z)(n,[{key:"switchDevice",value:function(e){switch(e){case"Chrome111":this._handlerFactory=Bh.createFactory();break;case"Chrome74":this._handlerFactory=Dh.createFactory();break;case"Chrome70":this._handlerFactory=Ih.createFactory();break;case"Firefox60":this._handlerFactory=Gh.createFactory();break;case"Safari12":this._handlerFactory=$h.createFactory();break;case"Edge11":this._handlerFactory=zh.createFactory();break;default:throw new TypeError('unknown handlerName "'.concat(e,'"'))}}}]),n}(vh),Qh="chrome",Yh="opera",Xh="firefox",ef="iexplorer",tf="safari",nf="nwjs",rf="electron",af="react-native",of="unknown",sf={Chrome:Qh,Chromium:Qh,Opera:Yh,Firefox:Xh,"Internet Explorer":ef,Safari:tf};function cf(){var e=navigator.userAgent;if(e.match(/Electron/)){var t=e.match(/Electron\/([\d.]+)/)[1];return{name:rf,version:t}}return null}function uf(){var e=navigator.userAgent;if(e.match(/JitsiMeetNW/)){var t=e.match(/JitsiMeetNW\/([\d.]+)/)[1];return{name:nf,version:t}}}function lf(){var e,t=navigator.userAgent.match(/\b(react[ \t_-]*native)(?:\/(\S+))?/i);if(t||"ReactNative"===navigator.product)return t&&t.length>
22&&(t[1],e=t[2]),e||(e="unknown"),{name:af,version:e}}function df(e){for(var t,n=[lf,cf,uf],r=0;r<n.length;r+=1)if(t=n[r]())return t;var i=e.getBrowserName();return i in sf?{name:sf[i],version:e.getBrowserVersion()}:(t=function(){var e=navigator.userAgent,t={name:of,version:void 0};if(e.match(/Chrome/)&&!e.match(/Edge/))if(e.match(/Edg(A?)/)){var n=e.match(/Chrome\/([\d.]+)/)[1];Number.parseInt(n,10)>72&&(t.name=Qh,t.version=n)}else t.name=Qh,t.version=e.match(/Chrome\/([\d.]+)/)[1];return t}(),t||{name:of,version:void 0})}var pf=function(){function e(){var t=this;(0,g.Z)(this,e),Cs(this,"_bowser"),Cs(this,"_name"),Cs(this,"_version"),Cs(this,"getDeviceInfo",(function(){return{isMobile:t.isMobile(),browserName:t._bowser.getBrowserName(),osName:t._bowser.getOSName(),browserVersion:t._bowser.getBrowserVersion(),osVersionName:t._bowser.getOSVersion(),engineName:t._bowser.getEngineName()}}))}return(0,y.Z)(e,[{key:"init",value:function(e){var t,n;if(this._bowser=M().getParser(navigator.userAgent),"undefined"==typeof e){var r=df(this._bowser);t=r.name,n=r.version}else e.name in sf?(t=sf[e.name],n=e.version):(t=of,n=void 0);this._name=t,this._version=n}},{key:"getName",value:function(){return this._name}},{key:"isChrome",value:function(){return this._name===Qh}},{key:"isOpera",value:function(){return this._name===Yh}},{key:"isFirefox",value:function(){return this._name===Xh}},{key:"isIExplorer",value:function(){return this._name===ef}},{key:"isSafari",value:function(){return this._name===tf}},{key:"isNWJS",value:function(){return this._name===nf}},{key:"isElectron",value:function(){return this._name===rf}},{key:"isReactNative",value:function(){return this._name===af||!0===navigator.isReactNative}},{key:"getVersion",value:function(){return this._version}},{key:"isMobile",value:function(){return"mobile"===this._bowser.getPlatformType()}},{key:"_checkCondition",value:function(e){if(this._version)return this._bowser.satisfies(e)}},{key:"isVersionGreaterThan",value:function(e){return this._checkCondition((0,i.Z)({},this._name,">".concat(e)))}},{key:"isVersionLessThan",value:function(e){return this._checkCondition((0,i.Z)({},this._name,"<".concat(e)))}},{key:"isVersionEqualTo",value:function(e){return this._checkCondition((0,i.Z)({},this._name,"~".concat(e)))}}]),e}(),hf=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"doesVideoMuteByStreamRemove",value:function(){return this.isChromiumBased()||this.isWebKitBased()}},{key:"supportsP2P",value:function(){return!this.usesUnifiedPlan()}},{key:"isChromiumBased",value:function(){return this.isChrome()||this.isElectron()||this.isNWJS()||this.isOpera()}},{key:"isWebKitBased",value:function(){return this._bowser.isEngine("webkit")&&"undefined"!=typeof navigator.mediaDevices&&"undefined"!=typeof navigator.mediaDevices.getUserMedia&&"undefined"!=typeof window.RTCRtpTransceiver&&Object.keys(RTCRtpTransceiver.prototype).indexOf("currentDirection")>-1}},{key:"isSupported",value:function(){return this.isChromiumBased()&&this._getChromiumBasedVersion()>=72||this.isFirefox()||this.isReactNative()||this.isWebKitBased()}},{key:"isUserInteractionRequiredForUnmute",value:function(){return this.isFirefox()&&this.isVersionLessThan("68")}},{key:"supportsVideoMuteOnConnInterrupted",value:function(){return this.isChromiumBased()||this.isReactNative()||this.isWebKitBased()}},{key:"supportsBandwidthStatistics",value:function(){return!this.isFirefox()&&!this.isWebKitBased()}},{key:"supportsCodecPreferences",value:function(){return this.usesUnifiedPlan()&&"undefined"!=typeof window.RTCRtpTransceiver&&Object.keys(window.RTCRtpTransceiver.prototype).indexOf("setCodecPreferences")>-1&&Object.keys(RTCRtpSender.prototype).indexOf("getCapabilities")>-1&&!this.isWebKitBased()}},{key:"supportsDeviceChangeEvent",value:function(){return navigator.mediaDevices&&"undefined"!=typeof navigator.mediaDevices.ondevicechange&&"undefined"!=typeof navigator.mediaDevices.addEventListener}},{key:"supportsLocalCandidateRttStatistics",value:function(){return this.isChromiumBased()||this.isReactNative()||this.isWebKitBased()}},{key:"supportsPerformanceObserver",value:function(){return"undefined"!=typeof window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes.indexOf("longtask")>-1}},{key:"supportsReceiverStats",value:function(){return"undefined"!=typeof window.RTCRtpReceiver&&Object.keys(RTCRtpReceiver.prototype).indexOf("getSynchronizationSources")>-1}},{key:"supportsRTTStatistics",value:function(){return!this.isFirefox()}},{key:"usesPlanB",value:function(){return!this.usesUnifiedPlan()}},{key:"usesSdpMungingForSimulcast",value:function(){return this.isChromiumBased()||this.isReactNative()||this.isWebKitBased()}},{key:"usesUnifiedPlan",value:function(){return!(!this.isFirefox()&&!this.isWebKitBased())}},{key:"usesNewGumFlow",value:function(){return!!(this.isChromiumBased()||this.isFirefox()||this.isWebKitBased())}},{key:"usesAdapter",value:function(){return this.usesNewGumFlow()}},{key:"usesRidsForSimulcast",value:function(){return!1}},{key:"supportsGetDisplayMedia",value:function(){return"undefined"!=typeof navigator.getDisplayMedia||"undefined"!=typeof navigator.mediaDevices&&"undefined"!=typeof navigator.mediaDevices.getDisplayMedia}},{key:"supportsInsertableStreams",value:function(){if("undefined"==typeof window.RTCRtpSender||!window.RTCRtpSender.prototype.createEncodedStreams&&!window.RTCRtpSender.prototype.createEncodedVideoStreams)return!1;var e=new ReadableStream;try{return window.postMessage(e,"*",[e]),!0}catch(t){return!1}}},{key:"supportsAudioRed",value:function(){return Boolean(window.RTCRtpSender&&window.RTCRtpSender.getCapabilities&&window.RTCRtpSender.getCapabilities("audio").codecs.some((function(e){return"audio/red"===e.mimeType}))&&window.RTCRtpReceiver&&window.RTCRtpReceiver.getCapabilities&&window.RTCRtpReceiver.getCapabilities("audio").codecs.some((function(e){return"audio/red"===e.mimeType})))}},{key:"supportsSdpSemantics",value:function(){return this.isChromiumBased()}},{key:"_getChromiumBasedVersion",value:function(){if(this.isChromiumBased()){if(this.isNWJS())return Number.parseInt(process.versions.chromium,10);var e=navigator.userAgent;if(e.match(/Chrome/))return Number.parseInt(e.match(/Chrome\/([\d.]+)/)[1],10)}return-1}},{key:"isIOSMobile",value:function(){return this.isMobile&&"iOS"===this._bowser.getOSName()}}]),n}(pf),ff=new hf,vf={qvga:{width:{ideal:320},height:{ideal:240}},vga:{width:{ideal:640},height:{ideal:480}},hd:{width:{ideal:1280},height:{ideal:720}},hd_cropped:{width:{ideal:900},height:{ideal:720}}},mf={},gf=[{rid:"r0",scalabilityMode:"L1T2"},{rid:"r1",scalabilityMode:"L1T2"}],yf=[{active:!1,adaptivePtime:!1,networkPriority:"low",priority:"low"},{active:!1,adaptivePtime:!1,networkPriority:"low",priority:"low"},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:25e5}],bf=[{active:!1,priority:"low"},{active:!1,priority:"low"},{active:!0,priority:"low"}],kf={320:[{rid:"q",maxBitrate:25e4,maxFramerate:30,scalabilityMode:"L1T3"}],640:[{rid:"q",scaleResolutionDownBy:2,maxBitrate:25e4,maxFramerate:30,scalabilityMode:"L1T3"},{rid:"h",maxBitrate:75e4,maxFramerate:30,scalabilityMode:"L1T3"}],1280:[{rid:"q",scaleResolutionDownBy:4,maxBitrate:25e4,maxFramerate:30,scalabilityMode:"L1T3"},{rid:"h",scaleResolutionDownBy:2,maxBitrate:75e4,maxFramerate:30,scalabilityMode:"L1T3"},{rid:"f",maxBitrate:15e5,maxFramerate:30,scalabilityMode:"L1T3"}]},_f=[{scalabilityMode:"L3T3_KEY"}],wf=function(e){return e.WEBCAM="webcam",e.MIC="mic",e.SCREENSHARE_VIDEO="screenshare_video",e.SCREENSHARE_AUDIO="screenshare_audio",e}(wf||{});function xf(e){if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map((function(e){return xf(e)}));var t={};return Object.keys(e).forEach((function(n){var r=_(n)?n:function(e){return e.replace(/([-_]\w)/g,(function(e){return e[1].toUpperCase()}))}(n);t[r]=xf(e[n])})),t}function Sf(e){if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map((function(e){return Sf(e)}));var t={};return Object.keys(e).forEach((function(n){var r=_(n)?n:function(e){return e.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))}(n);t[r]=e[n]})),t}function Ef(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==e?{}:(Object.getOwnPropertyNames(e).forEach((function(n){if("function"!=typeof e[n]){if("object"==typeof e[n])return void Ef(e[n],t[n]={});t[n]=e[n]}})),t)}var Tf=function(e){return e.PARTICIPANT="PARTICIPANT",e.PEER="PEER",e.CLIENT="CLIENT",e}(Tf||{}
2),Pf="internal_call_stats",Cf="chat_socket_server",Rf="poll_socket_server",Zf="plugin_socket_server",Mf="nr_otel_web",Af="connected_meetings",If="ice_restart_on_failed_state",Of="ice_restart_on_disconnected_state",Lf="enable_ice_state_logging",Df="web_core_remove_operational_mic",Nf="skip_otel_traces",jf="new_local_media_handler",Bf="callstats_ingestion_layer",Uf="custom_ping_pong",Vf="enable_hive_simulcast",Ff="enable_hive_transport_reconnection_on_ice_failed",zf="bypass_log_exclusion_list",Hf="log_level",qf="v1_plugins",Gf="screenshare_maxdimensions",Wf="screenshare_simulcast",Jf="disable_webcam_layers_on_screenshare",$f="screenshare_force_goog_conference",Kf="feat_livestream",Qf="device_remove_exp",Yf="webcore_disable_webcam_simulcast",Xf="override_webcam_simulcast",ev="socket_polling",tv="feat_paginated_chat",nv="val_min_framerate",rv="extension_hack",iv="val_max_framerate_ext",av="val_min_framerate_ext",ov="screenshare_err_hack",sv="feat_troubleshooting",cv="video_constraints",uv="screenshare_constraints",lv={roomName:void 0,authToken:void 0,peerId:void 0,apiBase:void 0,defaults:{audio:!0,video:!0},modules:void 0,organizationId:void 0,overrides:{}};function dv(e){var t;null!=lv.roomName||(lv.roomName=null==e?void 0:e.roomName),null!=lv.authToken||(lv.authToken=null==e?void 0:e.authToken),null!=lv.peerId||(lv.peerId=null==e?void 0:e.peerId),null!=lv.apiBase||(lv.apiBase=null==e?void 0:e.apiBase),null!=lv.modules||(lv.modules=null==e?void 0:e.modules),null!=lv.organizationId||(lv.organizationId=null==e?void 0:e.organizationId),lv.defaults=(0,s.Z)((0,s.Z)({},lv.defaults),null!=(t=null==e?void 0:e.defaults)?t:{})}var pv,hv="1.12.4",fv=xf(Jd(ap).config.media),vv=(0,y.Z)((function e(t){var n=this;(0,g.Z)(this,e),Ms(this,pv,void 0),Cs(this,"getScreenShareConstraints",(function(){var e,t,n=(null!=(e=lv.defaults.screenShare)?e:{}).displaySurface,r={width:{max:1920},height:{max:1080},frameRate:{ideal:parseInt(null!=(t=jc.getValue(nv))?t:"5",10),max:5}};if(jc.hasFeature(uv)){var i=jc.getValue(uv);r=JSON.parse(i)}return void 0!==n&&["monitor","browser","window"].includes(n)&&(r=(0,s.Z)((0,s.Z)({},r),{},{displaySurface:n})),{audio:!0,video:r}})),Cs(this,"getAudioConstraints",(function(e){var t={};return ff.isFirefox()||ff.isWebKitBased()?(t.audio={deviceId:e,autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0},t):(t.audio={},t.audio.optional=[e?{sourceId:e}:{sourceId:"default"},{echoCancellation:!0},{googEchoCancellation:!0},{googAutoGainControl:!0},{googNoiseSuppression:!0},{googHighpassFilter:!0}],t)})),Cs(this,"getVideoConstraints",(function(e){var t={},r=Zs(n,pv).video.quality,i=vf[r];if(i.frameRate={ideal:24},ff.isChromiumBased()&&(i.frameRate.max=30),jc.hasFeature(cv)){var a=jc.getValue(cv);i=JSON.parse(a)}return t.video=i,e?t.video.deviceId={exact:e}:t.video.facingMode="user",t})),As(this,pv,null!=t?t:fv)}));pv=new WeakMap;var mv=/\s/;var gv=/^\s+/;function yv(e){return e&&e.slice(0,function(e){for(var t=e.length;t--&&mv.test(e.charAt(t)););return t}(e)+1).replace(gv,"")}var bv=NaN,kv=/^[-+]0x[0-9a-f]+$/i,_v=/^0b[01]+$/i,wv=/^0o[0-7]+$/i,xv=parseInt;function Sv(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||Bu(e)&&ou(e)==$d}(e))return bv;if(su(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=su(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=yv(e);var n=_v.test(e);return n||wv.test(e)?xv(e.slice(2),n?2:8):kv.test(e)?bv:+e}var Ev=function(){return Kc.Date.now()},Tv=Math.max,Pv=Math.min;function Cv(e,t,n){var r,i,a,o,s,c,u=0,l=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function f(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-u>=a}function v(){var e=Ev();if(f(e))return m(e);s=setTimeout(v,function(e){var n=t-(e-c);return d?Pv(n,a-(e-u)):n}(e))}function m(e){return s=void 0,p&&r?h(e):(r=i=void 0,o)}function g(){var e=Ev(),n=f(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(v,t),l?h(e):o}(c);if(d)return clearTimeout(s),s=setTimeout(v,t),h(c)}return void 0===s&&(s=setTimeout(v,t)),o}return t=Sv(t)||0,su(n)&&(l=!!n.leading,a=(d="maxWait"in n)?Tv(Sv(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=c=i=s=void 0},g.flush=function(){return void 0===s?o:m(Ev())},g}var Rv=Object.prototype.hasOwnProperty;function Zv(e){var t={};return"number"==typeof(null==e?void 0:e.code)&&(t.code=e.code),"string"==typeof(null==e?void 0:e.code)&&(t.code=e.code.substring(0,100)),"string"==typeof(null==e?void 0:e.name)&&(t.name=e.name.substring(0,500)),"string"==typeof(null==e?void 0:e.message)&&(t.message=e.message.substring(0,500)),"string"==typeof(null==e?void 0:e.reason)&&(t.reason=e.reason.substring(0,500)),"string"==typeof(null==e?void 0:e.stack)&&(t.stack=e.stack.substring(0,500)),t}function Mv(){var e,t,n,r,i="undefined"!=typeof navigator&&!navigator.isReactNative&&(null==(e=window.location.host)?void 0:e.includes("staging"))&&(null==(t=window.location.host)?void 0:t.includes("dyte.io")),a=!(null==(r=null==(n=lv.modules)?void 0:n.devTools)||!r.logs);return i||a}function Av(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.getOwnPropertyNames(e).forEach((function(r){var i;if(!([null,void 0,NaN].includes(e[r])||t&&((null==(i=t.match(/\./g))?void 0:i.length)||0)>=10)){var a=t?"".concat(t,".").concat(r):r;"object"==typeof e[r]?Av(e[r],a,n):["number","string","boolean"].includes(typeof e[r])&&(n[a]=e[r])}})),n}function Iv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r={};try{var i=JSON.stringify(t),a=Av(JSON.parse(i),n),o=JSON.stringify(a);if(o.length>5e3){var s='Log named: "'.concat(e,'" is trying to log an flattened object of size ').concat(o.length," chars that is beyond permitted limit of 5000 chars. Please optimize.");throw Mv()&&console.error(s,{log:t,flattened:o}),new Error(s)}return JSON.parse(o)}catch(i){var c=Zv(i);r["".concat(n,".error.message")]=c.message||"",r["".concat(n,".error.stack")]=c.stack||"",r["".concat(n,".error.reason")]=c.reason||"",r["".concat(n,".error.source")]="safelyFlattenObjForOpenTelemetry"}return r}var Ov=function(){function e(){(0,g.Z)(this,e)}return(0,y.Z)(e,null,[{key:"logsEndpoint",get:function(){return Mv()?"https://api-silos-staging.dyte.io/otel/logs":"https://api-silos.dyte.io/otel/logs"}},{key:"init",value:function(t,n){if(!navigator.isReactNative){var r=new _i({url:"https://otel.dyte.io/v1/traces",headers:{"a
2pi-key":""}}),i=Mv()?"staging":"production",a=new wr({resource:new aa((0,s.Z)({"service.name":"web-core",sdk_version:hv,env:i},Iv("OTELResource",ff.getDeviceInfo(),"device"))),idGenerator:{generateTraceId:function(){return"".concat(t).replace(/-/g,"")},generateSpanId:function(){return P().replace(/-/g,"").substring(0,16)}}});e.tracingEnabled=n,e.tracer=a.getTracer(t),e.meetingMetadata.peerId=t,e.meetingMetadata.sdkVersion=hv,e.meetingMetadata.deviceInfo=ff.getDeviceInfo(),e.meetingMetadata.visitedUrl=!navigator.isReactNative&&"undefined"!=typeof window&&window.location.href,a.addSpanProcessor(new vr(r)),"zone"in window?a.register({contextManager:new xi}):a.register({contextManager:new kr}),e.contextPropagator=et,document.addEventListener("visibilitychange",e.processCachedLogs),e.logsProcessorTimer=setInterval(e.processCachedLogs,e.logsProcessingInterval),n&&(e.rootSpan=e.tracer.startSpan("peer_".concat(t),{},te),e.rootSpan.end(),e.initialized=!0)}}},{key:"trace",value:function(t){return function(n,r,i){var a=i.value;return i.value=function(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];if(!e.initialized||navigator.isReactNative||!e.tracingEnabled||jc.hasFeature(Nf))return a.apply(this,i);var s=e.getCurrentSpan(),c=qi.trace.setSpan(te,s);return jc.hasFeature(Mf)||e.addLogInCurrentSpan("info",t),e.tracer.startActiveSpan(t,{},c,(function(e){var t=a.apply(n,i);return Promise.resolve(t).then((function(){e.end()})).catch((function(){e.end()})),t}))},i}}},{key:"getCurrentSpan",value:function(){if(navigator.isReactNative)return null;var t=qi.trace.getSpan(qi.context.active());return null!=t||(t=e.rootSpan),t}},{key:"getCurrentContext",value:function(){return qi.trace.setSpan(te,e.getCurrentSpan())}},{key:"getCurrentSpanName",value:function(){var e;return null==(e=this.getCurrentSpan())?void 0:e.name}},{key:"injectContext",value:function(t){e.getCurrentSpan()&&e.contextPropagator.inject(e.getCurrentContext(),t)}},{key:"addLogInCurrentSpan",value:function(){var t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"info",i=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(null!=a&&a.error&&Object.assign(a,{error:Zv(a.error)}),Mv()&&(function(e){if(null==e)return!0;if(bl(e)&&(Gu(e)||"string"==typeof e||"function"==typeof e.splice||Ku(e)||ll(e)||qu(e)))return!e.length;var t=td(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(fl(e))return!yl(e).length;for(var n in e)if(Rv.call(e,n))return!1;return!0}(a)?console[r]("DyteInternalLogs:: ",r,i):console[r]("DyteInternalLogs:: ",r,i,a)),function(e){if(jc.hasFeature(Hf)){var t=jc.getValue(Hf)||"all";if("off"===(t=t.toLowerCase().trim()))return!1;if("all"!==t){var n=["debug","log","info","warn","error"];if(n.indexOf(e)<n.indexOf(t))return!1}}return!0}(r))try{var c=Iv(i,a,"metadata"),u=e.getCurrentSpan(),l=new Date,d=(0,s.Z)((0,s.Z)({message:i,level:r},c),{},{"trace.id":null==(t=null==u?void 0:u.spanContext())?void 0:t.traceId,"span.id":null==(n=null==u?void 0:u.spanContext())?void 0:n.spanId,loggedAt:l.toISOString(),loggedAtTzOffset:l.getTimezoneOffset()});o?e.sendOtelLogsToNewRelic([d]):e.logsCache.push(d)}catch(c){e.addLogInCurrentSpan("error","opentelemetry::addLogInCurrentSpan_failed",{error:Zv(c)})}}},{key:"sendOtelLogsToNewRelic",value:function(t){R().post(e.logsEndpoint,{meetingMetadata:Iv("sendOtelLogsToNewRelic",e.meetingMetadata,"meetingMetadata"),serviceName:"web-core",logs:t}).catch((function(n){var r;e.addLogInCurrentSpan("error","opentelemetry::sendOtelLogToNewRelic_failed",{error:Zv(n)}),(r=e.logsCache).push.apply(r,(0,o.Z)(t))}))}},{key:"processCachedLogs",value:function(){var t=e.logsCache.splice(0,25);null!=t&&t.length&&e.sendOtelLogsToNewRelic(t)}},{key:"destruct",value:function(){clearInterval(e.logsProcessorTimer),e.processCachedLogs(),!navigator.isReactNative&&document.removeEventListener("visibilitychange",e.processCachedLogs)}}]),e}(),Lv=Ov;Cs(Lv,"tracer"),Cs(Lv,"contextPropagator"),Cs(Lv,"rootSpan"),Cs(Lv,"logsCache",[]),Cs(Lv,"logsProcessorTimer"),Cs(Lv,"tracingEnabled",!0),Cs(Lv,"initialized",!1),Cs(Lv,"logsProcessingInterval",7e3),Cs(Lv,"logExclusionList",["message","websocket/message","roomMessage","websocket/room-message","websocket/room-legacy-mode","chatMessage","websocket/new-chat-message","websocket/no-active-speaker","websocket/selected-peers","websocket/active-speaker","ping","websocket/new-consumer","websocket/producer-score","websocket/consumer-score","websocket/plugin-event","websocket/plugin-data","websocket/plugin-internal-data"]),Cs(Lv,"meetingMetadata",{});var Dv=function(){function e(){(0,g.Z)(this,e)}return(0,y.Z)(e,null,[{key:"info",value:function(e,t,n){Lv.addLogInCurrentSpan("info",e,t,n)}},{key:"error",value:function(e,t,n){Lv.addLogInCurrentSpan("error",e,t,n)}},{key:"debug",value:function(e,t,n){Lv.addLogInCurrentSpan("debug",e,t,n)}},{key:"log",value:function(e,t,n){Lv.addLogInCurrentSpan("log",e,t,n)}},{key:"warn",value:function(e,t,n){Lv.addLogInCurrentSpan("warn",e,t,n)}}]),e}(),Nv={"00":"DyteClient","01":"Controller","02":"RoomNodeClient","03":"HiveNodeClient","04":"SocketService","05":"Chat","06":"Plugin","07":"Polls","08":"Meta","09":"Preset",10:"Recording",11:"Self",12:"Participant",13:"Spotlight",14:"Remote Request",15:"Webinar",16:"LocalMediaHandler"},jv={"0000":"Internal exception.","0001":"Failed to initialize.","0002":"Failed to join room.","0003":"Failed to leave room.","0100":"Internal exception","0200":"Internal exception.","0300":"Internal exception","0400":"Internal exception","0500":"Internal exception","0501":"Permission denied.","0502":"Invalid message body.","0600":"Internal exception","0700":"Internal exception","0800":"Internal exception","0900":"Internal exception",1e3:"Internal exception",1100:"Internal exception",1200:"Internal exception",1300:"Internal exception",1400:"Internal exception",1500:"Internal exception",1600:"Internal exception",1601:"Failed to get audio track",1602:"Failed to get video track",1603:"Incorrect device",1604:"Failed to change device"};Object.keys(jv).forEach((function(e){jv[e]="{".concat(Nv[e.slice(0,2)],"} ").concat(jv[e])}));var Bv=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,g.Z)(this,n),i=t.call(this,e),Cs((0,f.Z)(i),"code"),i.code=r,i.name="DyteError",i.message="[ERR".concat(i.code,"]: ").concat(jv[i.code],"\n").concat(i.message);try{var o=a;r&&r.endsWith("00")&&(o=!0),o&&Dv.error("DyteError",{error:{message:i.message,name:i.name,code:r}})}catch(o){}return i}return(0,y.Z)(n)}((0,a.Z)(Error));function Uv(e,t,n,r){if(!("function"==typeof n&&r instanceof t))throw r;n.call(null,r,e)}function Vv(e,t,n){if(!e.value){var r=e.get,i=e.set;return r&&(e.get=function(){try{return r.apply(this)}catch(e){Uv(this,t,n,e)}}),i&&(e.set=function(e){try{return i.apply(this,[e])}catch(r){Uv(this,t,n,r)}}),e}var a=e.value;return e.value=function(){var e=this;try{for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var c=a.apply(this,o);return c&&c instanceof Promise?c.catch((function(r){Uv(e,t,n,r)})):c}catch(i){Uv(this,t,n,i)}},e}var Fv,zv=function(e){return function(e,t){return function(n,r,i){if(i)return Vv(i,e,t);var a,o=(0,c.Z)(Reflect.ownKeys(n.prototype).filter((function(e){return"constructor"!==e})));try{for(o.s();!(a=o.n()).done;){var s=a.value,u=Object.getOwnPropertyDescriptor(n.prototype,s);(u.value instanceof Function||u.get instanceof Function||u.set instanceof Function)&&Object.defineProperty(n.prototype,s,Vv(u,e,t))}}catch(xC){o.e(xC)}finally{o.f()}}}(Error,e)},Hv=function(e){return e.allowed="ALLOWED",e.notAllowed="NOT_ALLOWED",e.canRequest="CAN_REQUEST",e}(Hv||{}),qv=xf({view_type:Kd.GroupCall,accept_waiting_requests:!1,request_produce:!1,can_allow_participant_audio:!0,can_allow_participant_screensharing:!1,can_allow_participant_video:!0,request_kick_participant:!1,kick_participant:!0,pin_participant:!0,can_record:!1,waiting_room_type:"SKIP",plugins:{can_close:!0,can_start:!0,can_edit_acl:!1,config:{}},polls:{can_create:!0,can_vote:!0,can_view:!0}
2,produce:{video:{allow:!0,quality:fv.video.quality,frame_rate:fv.video.frameRate},audio:!0,screenshare:{allow:!0,quality:fv.screenshare.quality,frame_rate:fv.screenshare.frameRate}},chat:{public:{can_send:!0,text:!0,files:!0},private:{can_send:!1,can_receive:!1,text:!1,files:!1}},reactions:!1,hidden_participant:!1,show_participant_list:!0,can_change_participant_role:!0,can_change_theme:!1,can_present:!1,accept_present_requests:!1,can_edit_display_name:!1,max_screenshare_count:1,is_recorder:!1,can_spotlight:!1}),Gv=function(){function e(t){if((0,g.Z)(this,e),Ms(this,Fv,void 0),!t)throw Dv.error("DytePermissionsPresetV1::load_preset_permissions_failed"),new Bv("Could not load preset permissions.");As(this,Fv,t)}return(0,y.Z)(e,[{key:"viewType",get:function(){return Zs(this,Fv).viewType}},{key:"acceptWaitingRequests",get:function(){return Zs(this,Fv).acceptWaitingRequests}},{key:"requestProduce",get:function(){return Zs(this,Fv).requestProduce}},{key:"requestProduceAudio",get:function(){return this.requestProduce}},{key:"requestProduceScreenshare",get:function(){return this.requestProduce}},{key:"canAllowParticipantAudio",get:function(){return Zs(this,Fv).canAllowParticipantAudio}},{key:"canAllowParticipantScreensharing",get:function(){return Zs(this,Fv).canAllowParticipantScreensharing}},{key:"canAllowParticipantVideo",get:function(){return Zs(this,Fv).canAllowParticipantVideo}},{key:"canDisableParticipantAudio",get:function(){return this.canAllowParticipantAudio}},{key:"canDisableParticipantVideo",get:function(){return this.canAllowParticipantVideo}},{key:"kickParticipant",get:function(){return Zs(this,Fv).kickParticipant}},{key:"pinParticipant",get:function(){return Zs(this,Fv).pinParticipant}},{key:"canRecord",get:function(){return Zs(this,Fv).canRecord}},{key:"waitingRoomType",get:function(){return Zs(this,Fv).waitingRoomType}},{key:"waitingRoomBehaviour",get:function(){return"SKIP"===Zs(this,Fv).waitingRoomType?"SKIP":"SKIP_ON_PRIVILEGED_USER_ENTRY"===Zs(this,Fv).waitingRoomType?"ON_PRIVILEGED_USER_ENTRY":"ON_ACCEPT"===Zs(this,Fv).waitingRoomType?"SKIP_ON_ACCEPT":"SKIP"}},{key:"plugins",get:function(){return Zs(this,Fv).plugins}},{key:"polls",get:function(){return(0,s.Z)((0,s.Z)({},Zs(this,Fv).polls),{},{canViewResults:Zs(this,Fv).polls.canView})}},{key:"produceVideo",get:function(){return(0,s.Z)((0,s.Z)({},Zs(this,Fv).produce.video),{},{allow:Zs(this,Fv).produce.video.allow?"ALLOWED":"NOT_ALLOWED"})}},{key:"canProduceVideo",get:function(){var e=Zs(this,Fv).produce.video.allow;return this.requestProduce?"CAN_REQUEST":e?"ALLOWED":"NOT_ALLOWED"}},{key:"produceScreenshare",get:function(){return(0,s.Z)((0,s.Z)({},Zs(this,Fv).produce.screenshare),{},{allow:Zs(this,Fv).produce.screenshare.allow?"ALLOWED":"NOT_ALLOWED"})}},{key:"canProduceScreenshare",get:function(){var e=Zs(this,Fv).produce.screenshare.allow;return this.requestProduce?"CAN_REQUEST":e?"ALLOWED":"NOT_ALLOWED"}},{key:"produceAudio",get:function(){return Zs(this,Fv).produce.audio?"ALLOWED":"NOT_ALLOWED"}},{key:"canProduceAudio",get:function(){var e=Zs(this,Fv).produce.audio;return this.requestProduce?"CAN_REQUEST":e?"ALLOWED":"NOT_ALLOWED"}},{key:"chatPublic",get:function(){return Zs(this,Fv).chat.public}},{key:"chatPrivate",get:function(){return Zs(this,Fv).chat.private}},{key:"connectedMeetings",get:function(){return{canAlterConnectedMeetings:!1,canSwitchConnectedMeetings:!1,canSwitchToParentMeeting:!1}}},{key:"reactions",get:function(){return Zs(this,Fv).reactions}},{key:"hiddenParticipant",get:function(){return Zs(this,Fv).hiddenParticipant}},{key:"showParticipantList",get:function(){return Zs(this,Fv).showParticipantList}},{key:"canChangeParticipantRole",get:function(){return Zs(this,Fv).canChangeParticipantRole}},{key:"canChangeTheme",get:function(){return Zs(this,Fv).canChangeTheme}},{key:"canPresent",get:function(){return Zs(this,Fv).canPresent}},{key:"acceptPresentRequests",get:function(){return Zs(this,Fv).acceptPresentRequests}},{key:"canEditDisplayName",get:function(){return Zs(this,Fv).canEditDisplayName}},{key:"maxScreenShareCount",get:function(){return Zs(this,Fv).maxScreenshareCount}},{key:"isRecorder",get:function(){return Zs(this,Fv).isRecorder}},{key:"canLivestream",get:function(){return!1}},{key:"canSpotlight",get:function(){return Zs(this,Fv).canSpotlight}},{key:"isV2",get:function(){return!1}}],[{key:"fromResponse",value:function(t){return new e(t)}},{key:"default",value:function(){return new e(qv)}}]),e}();Fv=new WeakMap;var Wv={isV2AuthToken:!1,meetingId:null,overrides:{},roomNodeOptions:void 0},Jv={baseURL:"http://localhost:5000",createdAt:"2021-08-05T10:49:56.602Z",description:"Develop plugins locally",id:"09259e3b-7be8-46f6-9801-106bf1866e1c",name:"Localhost Dev",organizationId:"4ad15a19-80e2-4105-bf43-48039fd2963e",picture:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/dyte.png",private:!1,published:!0,staggered:!1,tags:["#localhost","#dev"],type:"self_hosted",updatedAt:"2021-08-05T10:50:07.681Z"};function $v(e,t){if(t)Wv.isV2AuthToken=!1;else try{var n=JSON.parse(atob(e.split(".")[1])).meetingId;if(!n)throw Error("Received V1 auth token ".concat(e));Wv.isV2AuthToken=!0,Wv.meetingId=n}catch(n){throw Dv.error("constants::setIsV2AuthToken",{error:n,debuggingHint:"Unable to decode auth token: ".concat(e)},!0),new Bv("Invalid auth token")}}function Kv(e,t){if(Wv.isV2AuthToken&&jc.hasFeature(Af))return!0;var n=jc.getValue(Cf)||"socket-service",r=jc.getValue(Zf)||"socket-service",i=jc.getValue(Rf)||"socket-service";return Wv.isV2AuthToken&&e===Kd.Livestream||[n,r,i].includes("socket-service")||t.includes("HIVE")}function Qv(e){Wv.overrides=e}function Yv(e){return!(!Wv.overrides||!Wv.overrides[e])&&Wv.overrides[e]}function Xv(e){Wv.roomNodeOptions=e}var em,tm,nm=function(e){return e.REQUESTED_BY_PARTICIPANT="REQUESTED_BY_PARTICIPANT",e.REQUESTED_BY_MODERATOR="REQUESTED_BY_MODERATOR",e}(nm||{}),rm=function(e){return e.PRESENT="REQUEST_TO_PRESENT",e}(rm||{}),im=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.call(this),Ms((0,f.Z)(e),em,void 0),Ms((0,f.Z)(e),tm,void 0),Cs((0,f.Z)(e),"asyncPromiseTimeout"),As((0,f.Z)(e),em,new Map),As((0,f.Z)(e),tm,new Map),e.asyncPromiseTimeout=8e3,e}return(0,y.Z)(n,[{key:"emitAsync",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var r,i,a,o,s,c=this,d=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(Zs(this,em).set(t,[]),i=Zs(this,tm).get(t).map((function(){return new Promise((function(e){Zs(c,em).get(t).push(e)}))})),a=d.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=d[s];return(r=l((0,u.Z)(n.prototype),"emit",this)).call.apply(r,[this,t].concat(o)),e.next=6,Promise.race([Promise.all(i),new Promise((function(e,t){return setTimeout((function(){return t(new Error("emitAsync failed to resolve."))}),c.asyncPromiseTimeout)}))]);case 6:Zs(this,em).delete(t);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onAsync",value:function(e,t){var r=Zs(this,em),i=function(){var n=(0,h.Z)((0,p.Z)().mark((function n(){var i,a,o=arguments;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,t.apply(void 0,o);case 3:n.next=8;break;case 5:n.prev=5,n.t0=n.catch(0),Dv.error("[onAsync]",{error:n.t0});case 8:null==(a=null==(i=r.get(e))?void 0:i.shift())||a();case 10:case"end":return n.stop()}}),n,null,[[0,5]])})));return function(){return n.apply(this,arguments)}}();return Zs(this,tm).get(e)||Zs(this,tm).set(e,[]),Zs(this,tm).get(e).push(i),l((0,u.Z)(n.prototype),"on",this).call(this,e,i)}},{key:"reset",value:function(){As(this,em,new Map),As(this,tm,new Map),l((0,u.Z)(n.prototype),"removeAllListeners",this).call(this)}}]),n}(Ns.EventEmitter);em=new WeakMap,tm=new WeakMap;var am,om,sm=new im,cm=function(e){return e.NEW_PRODUCER="NEW_PRODUCER",e.ROOM_NODE_CONNECTED="ROOM_NODE_CONNECTED",e.ROOM_NODE_DISCONNECTED="ROOM_NODE_DISCONNECTED",e.ROOM_NODE_CONNECTION_ERROR="ROOM_NODE_CONNECTION_ERROR",e.SOCKET_SERVICE_CONNECTED="SOCKET_SERVICE_CONNECTED",e.SOCKET_SERVICE_DISCONNECTED="SOCKET_SERVICE_DISCONNECTED",e.SOCKET_SERVICE_RECONNECTING="SOCKET_SERVICE_RECONNECTING",e.SO
2CKET_SERVICE_RECONNECTION_ATTEMPT="SOCKET_SERVICE_RECONNECTION_ATTEMPT",e.SOCKET_SERVICE_RECONNECT_FAILURE="SOCKET_SERVICE_RECONNECT_FAILURE",e.SOCKET_SERVICE_RECONNECTED="SOCKET_SERVICE_RECONNECTED",e.SOCKET_SERVICE_FAILED="SOCKET_SERVICE_FAILED",e.ROOM_JOINED="ROOM_JOINED",e.SOCKET_SERVICE_ROOM_JOINED="SOCKET_SERVICE_ROOM_JOINED",e.SELF_ROOM_JOINED="SELF_ROOM_JOINED",e.PRODUCER_SCORE_UPDATE="PRODUCER_SCORE_UPDATE",e.CONSUMER_SCORE_UPDATE="CONSUMER_SCORE_UPDATE",e.PRODUCER_STATUS_UPDATE="PRODUCER_STATUS_UPDATE",e.CONSUMER_STATUS_UPDATE="CONSUMER_STATUS_UPDATE",e.LOW_PRODUCER_SCORE="LOW_PRODUCER_SCORE",e.LOW_CONSUMER_SCORE="LOW_CONSUMER_SCORE",e.MEDIA_PERMISSION_ERROR="MEDIA_PERMISSION_ERROR",e.MEDIA_PERMISSION_UPDATE="MEDIA_PERMISSION_UPDATE",e.WAITLISTED="WAIT_LISTED",e.WAITLIST_ACCEPTED="websocket/waitlist-accepted",e.WAITLIST_REJECTED="websocket/waitlist-rejected",e.WAITLIST_PEER_ADDED="websocket/waitlist-peer-added",e.WAITLIST_PEER_REMOVED="websocket/waitlist-peer-closed",e.MESSAGE="websocket/message",e.ROOM_MESSAGE="websocket/room-message",e.DISABLE_AUDIO="websocket/disable-audio",e.DISABLE_VIDEO="websocket/disable-video",e.PEER_JOINED="websocket/peer-joined",e.PEER_CLOSED="websocket/peer-closed",e.PEER_MUTED="websocket/peer-muted",e.PEER_UNMUTED="websocket/peer-unmuted",e.PEER_PINNED="websocket/pin-peer",e.PEER_UNPINNED="websocker/unpin-peer",e.MUTE_ALL="websocket/mute-all",e.MUTE_ALL_VIDEO="websocket/mute-all-video",e.CONSUMER_CLOSED="websocket/consumer-closed",e.CONSUMER_PAUSED="websocket/consumer-paused",e.CONSUMER_RESUMED="websocket/consumer-resumed",e.PRODUCER_CLOSED="websocket/producer-closed",e.NEW_CONSUMER="websocket/new-consumer",e.CONNECTED_MEETING_STATE="websocket/connectedMeetingState",e.MOVE_TO_CONNECTED_MEETING="websocket/transferMeeting",e.GET_CHAT_MESSAGES="websocket/get-chat-messages",e.NEW_CHAT_MESSAGE="websocket/new-chat-message",e.PIN_CHAT_MESSAGE="websocket/pin-chat-message",e.UNPIN_CHAT_MESSAGE="websocket/unpin-chat-message",e.GET_POLLS="websocket/get-polls",e.UPDATE_POLL="websocket/update-poll",e.SELECTED_PEERS="websocket/selected-peers",e.GET_PAGE="websocket/get-page",e.ACTIVE_SPEAKER="websocket/active-speaker",e.NO_ACTIVE_SPEAKER="websocket/no-active-speaker",e.PRODUCER_SCORE="websocket/producer-score",e.CONSUMER_SCORE="websocket/consumer-score",e.ENABLE_PLUGIN="websocket/enable-plugin",e.DISABLE_PLUGIN="websocket/disable-plugin",e.PLUGIN_EVENT="websocket/plugin-event",e.PLUGIN_DATA="websocket/plugin-data",e.PLUGIN_INTERNAL_DATA="websocket/plugin-internal-data",e.KICKED="websocket/kicked",e.RECORDING_STARTED="websocket/recording-started",e.RECORDING_STOPPED="websocket/recording-stopped",e.ICE_CONNECTED="ICE_CONNECTED",e.ICE_DISCONNECTED="ICE_DISCONNECTED",e.ICE_FAILED="ICE_FAILED",e.ICE_RECONNECTING="ICE_RECONNECTING",e.PRODUCER_TOGGLE="hive/producer-toggle",e.CONSUMER_TOGGLE="hive/consumer-toggle",e.SELECTED_PEERS_DIFF="hive/selected-peers-diff",e.REFRESH_GRID="hive/refresh-grid",e.RESET_PRODUCER_STATE="hive/reset-producer-state",e.HIVE_RECORDING_STARTED="hive/recording-started",e.HIVE_RECORDING_STOPPED="hive/recording-stopped",e.HIVE_TRANSPORT_STATE_CHANGED="hive/transport-state-changed",e.ROOM_STATE="sockethub/room-state",e.PEER_DISPLAY_NAME_CHANGED="hive/display-name-changed",e.ASSERT_SPOTLIGHTER="websocket/assert-spotlighter",e.PEER_REQUESTED_TO_JOIN_STAGE="websocket/request-to-join-stage-peer-added",e.PEER_WITHDRAWN_REQUEST_TO_JOIN_STAGE="websocket/request-to-join-stage-peer-withdrawn",e.PEER_REJECTED_TO_JOIN_STAGE="websocket/peer-rejected-to-join-stage",e.PEER_ADDED_TO_STAGE="websocket/peer-added-to-stage",e.PEER_REMOVED_FROM_STAGE="websocket/peer-removed-from-stage",e.PEER_STARTED_PRESENTING="websocket/peer-started-presenting",e.PEER_STOPPED_PRESENTING="websocket/peer-stopped-presenting",e.REQUEST_TO_JOIN_STAGE_ACCEPTED="websocket/request-to-join-stage-accepted",e.REQUEST_TO_JOIN_STAGE_REJECTED="websocket/request-to-join-stage-rejected",e.STARTED_PRESENTING="websocket/started-presenting",e.STOPPED_PRESENTING="websocket/stopped-presenting",e.REMOVED_FROM_STAGE="websocket/removed-from-stage",e.JOIN_MEDIA_ROOM="JOIN_MEDIA_ROOM",e.LEAVE_MEDIA_ROOM="LEAVE_MEDIA_ROOM",e}(cm||{});!function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER"}(am||(am={})),function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO"}(om||(om={})),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.Pair",[{no:1,name:"key",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);
2function n(){return(0,g.Z)(this,n),t.call(this,"media.Codec",[])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.Fingerprint",[{no:1,name:"algorithm",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa));var um=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.SessionDescription",[{no:1,name:"target",kind:"enum",T:function(){return["media.Target",am]}},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"sdp",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),lm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.CreateTransportRequest",[{no:1,name:"consuming",kind:"scalar",T:8},{no:2,name:"force_tcp",kind:"scalar",opt:!0,T:8},{no:3,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa)),dm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.CreateTransportResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa)),pm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.RenegotiateRequest",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.RenegotiateResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa));var hm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.NestedScore",[{no:1,name:"encoding_idx",kind:"scalar",T:5},{no:2,name:"rid",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5},{no:4,name:"ssrc",kind:"scalar",T:3,L:0}])}return(0,y.Z)(n)}(Xa)),fm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.ProducerTrack",[{no:1,name:"track_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9},{no:3,name:"stream_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.ProducerEntry",[{no:1,name:"producing_transport_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.ConsumerEntry",[{no:1,name:"consuming_transport_id",kind:"scalar",T:9},{no:2,name:"consumer_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa));var vm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.ProducerState",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"kind",kind:"enum",T:function(){return["media.ProducerKind",om]}},{no:3,name:"pause",kind:"scalar",T:8},{no:4,name:"screen_share",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),mm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.ConsumerState",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:function(){return vm}},{no:3,name:"producer_track",kind:"message",T:function(){return fm}}])}return(0,y.Z)(n)}(Xa)),gm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.ProducerIdToConsumerMap",[{no:1,name:"map",kind:"map",K:9,V:{kind:"message",T:function(){return mm}}}])}return(0,y.Z)(n)}(Xa)),ym=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerJoinRequest",[{no:1,name:"display_name",kind:"scalar",opt:!0,T:9},{no:2,name:"prejoined",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:5,name:"preset",kind:"scalar",opt:!0,T:12},{no:6,name:"user_id",kind:"scalar",opt:!0,T:9},{no:7,name:"organization_id",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}
2(Xa)),bm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerJoinCompleteRequest",[])}return(0,y.Z)(n)}(Xa)),km=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerLeaveRequest",[{no:1,name:"close_room",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumeMultipleProducerRequest",[{no:1,name:"producer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8}])}return(0,y.Z)(n)}(Xa));var _m=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumePeerRequest",[{no:1,name:"producing_peer_id",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8},{no:3,name:"producer_id",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),wm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ProducerCreateRequest",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"description",kind:"message",T:function(){return um}},{no:5,name:"msid",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.SelectedPeersRequest",[])}return(0,y.Z)(n)}(Xa));var xm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.GlobalPeerPinningRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Sm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ProducerToggleRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),Em=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumerToggleRequest",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),Tm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ProducerCloseRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa)),Pm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumerCloseRequest",[{no:1,name:"consumer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa)),Cm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.KickPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Rm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.KickAllPeersRequest",[])}return(0,y.Z)(n)}(Xa)),Zm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerDisplayNameEditRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Mm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.HostMediaControlForPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"audio",kind:"scalar",T:8},{no:3,name:"video",kind:"scalar",T:8},{no:4,name:"scree_share",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),Am=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.HostMediaControlForAllPeerRequest",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),Im=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.GetRoomStateResponse",[{no:1,name:"display_title",kind:"scalar",T:9},{no:2,name:"locked_mode",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"room_name",kind:"scalar",T:9},{no:5,name:"current_peer_id",kind:"scalar",T:9},{no:6,name:"is_recording",kind:"scalar",opt:!0,T:8},{no:7,name:"recorder_participant_id",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ErrorResponse",[{no:1,name:"error_message",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:5}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.EmptyResponse",[])}return(0,y.Z)(n)}(Xa));var Om=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.RoomParticipants",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"producer_states",kind:"message",repeat:1,T:function(){return vm}},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"user_id",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),Lm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.SelectedPeersResponse",[{no:1,name:"audio_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"compulsory_peers",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),Dm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.SelectedPeersDiffEntry",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"priority",kind:"scalar",T:5}])}return(0,y.Z)(n)}(Xa)),Nm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.SelectedPeersDiffResponse",[{no:1,name:"entries",kind:"message",repeat:1,T:function(){return Dm}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerJoinResponse",[])}return(0,y.Z)(n)}(Xa));var jm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerJoinCompleteResponse",[{no:1,name:"room_state",kind:"message",T:function(){return Im}},{no:2,name:"participants",kind:"message",repeat:1,T:function(){return Om}},{no:3,name:"selected_peers",kind:"message",T:function(){return Lm}},{no:4,name:"max_preferred_streams",kind:"scalar",T:5}])}return(0,y.Z)(n)}(Xa)),Bm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerLeaveResponse",[{no:1,name:"closed",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumeMultipleProducerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:function(){return gm}},{no:3,name:"transport_details",kind:"message",T:function(){return dm}}])}return(0,y.Z)(n)}(Xa));var Um=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumePeerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:function(){return gm}},{no:3,name:"transport_details",kind:"message",T:function(){return dm}}])}return(0,y.Z)(n)}(Xa)),Vm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ProducerCreateResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"producer_id",kind:"scalar",T:9},{no:3,name:"transport_details",kind:"message",T:function(){return dm}},{no:4,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ProducerScoreResponse",[{no:1,name:"responseid",kind:"scalar",T:9},{no:2,name:"score",kind:"message",T:function(){return hm}}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ActiveSpeakerResponse",[{no:1,name:"responsepeer_id",kind:"scalar",T:9},{no:2,name:"volume",kind:"scalar",T:5}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.NoActiveSpeakerResponse",[])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ProducerToggleResponse",[])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumerToggleResponse",[])}return(0,y.Z)(n)}(Xa));var Fm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ProducerClosingResponse",[{no:1,name:"description",kind:"message",T:function(){return um}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.ConsumerClosingResponse",[])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.GlobalPeerPinningResponse",[])}return(0,y.Z)(n)}(Xa));
2var zm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.KickPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Hm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.KickAllPeersResponse",[{no:1,name:"status",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),qm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.HostMediaControlForPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Gm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.HostMediaControlForAllPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Wm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerDisplayNameEditResponse",[{no:1,name:"status",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Jm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerJoinBroadcastResponse",[{no:1,name:"participant",kind:"message",T:function(){return Om}}])}return(0,y.Z)(n)}(Xa)),$m=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerProducerCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:function(){return vm}}])}return(0,y.Z)(n)}(Xa)),Km=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerProducerToggleBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:function(){return vm}}])}return(0,y.Z)(n)}(Xa)),Qm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerProducerCloseBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:function(){return vm}}])}return(0,y.Z)(n)}(Xa)),Ym=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerLeaveBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Xm=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.GlobalPeerPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),eg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.RecordingStartedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),tg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.RecordingStoppedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),ng=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"media.edge.PeerDisplayNameEditBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.api.BaseSocketHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.api.ErrorMessage",[{no:1,name:"code",kind:"scalar",opt:!0,T:5},{no:2,name:"message",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset",[{no:1,name:"success",kind:"scalar",T:8},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"message",T:function(){return vg}}])}return(0,y.Z)(n)}(Xa));var rg,ig,ag=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Plugins",[{no:1,name:"can_close",kind:"scalar",T:8},{no:2,name:"can_start",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),og=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Polls",[{no:1,name:"can_create",kind:"scalar",T:8},{no:2,name:"can_vote",kind:"scalar",T:8},{no:3,name:"can_view",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),sg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Video",[{no:1,name:"allow",kind:"scalar",T:8},{no:2,name:"quality",kind:"scalar",T:9},{no:3,name:"frame_rate",kind:"scalar",T:13}])}return(0,y.Z)(n)}
2(Xa)),cg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Screenshare",[{no:1,name:"allow",kind:"scalar",T:8},{no:2,name:"quality",kind:"scalar",T:9},{no:3,name:"frame_rate",kind:"scalar",T:13}])}return(0,y.Z)(n)}(Xa)),ug=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Produce",[{no:1,name:"video",kind:"message",T:function(){return sg}},{no:2,name:"audio",kind:"scalar",T:8},{no:3,name:"screenshare",kind:"message",T:function(){return cg}}])}return(0,y.Z)(n)}(Xa)),lg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Public",[{no:1,name:"can_send",kind:"scalar",T:8},{no:2,name:"text",kind:"scalar",T:8},{no:3,name:"files",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),dg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Private",[{no:1,name:"can_send",kind:"scalar",T:8},{no:2,name:"can_receive",kind:"scalar",T:8},{no:3,name:"text",kind:"scalar",T:8},{no:4,name:"files",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),pg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Chat",[{no:1,name:"public",kind:"message",T:function(){return lg}},{no:2,name:"private",kind:"message",T:function(){return dg}}])}return(0,y.Z)(n)}(Xa)),hg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Permissions",[{no:1,name:"view_type",kind:"scalar",T:9},{no:2,name:"accept_waiting_requests",kind:"scalar",T:8},{no:3,name:"request_produce",kind:"scalar",T:8},{no:4,name:"can_allow_participant_audio",kind:"scalar",T:8},{no:5,name:"can_allow_participant_screensharing",kind:"scalar",T:8},{no:6,name:"can_allow_participant_video",kind:"scalar",T:8},{no:7,name:"request_kick_participant",kind:"scalar",T:8},{no:8,name:"kick_participant",kind:"scalar",T:8},{no:9,name:"pin_participant",kind:"scalar",T:8},{no:10,name:"can_record",kind:"scalar",T:8},{no:11,name:"waiting_room_type",kind:"scalar",T:9},{no:12,name:"plugins",kind:"message",T:function(){return ag}},{no:13,name:"polls",kind:"message",T:function(){return og}},{no:14,name:"produce",kind:"message",T:function(){return ug}},{no:15,name:"chat",kind:"message",T:function(){return pg}},{no:16,name:"reactions",kind:"scalar",T:8},{no:17,name:"hidden_participant",kind:"scalar",T:8},{no:18,name:"show_participant_list",kind:"scalar",T:8},{no:19,name:"can_change_participant_role",kind:"scalar",T:8},{no:20,name:"can_change_theme",kind:"scalar",T:8},{no:21,name:"can_present",kind:"scalar",T:8},{no:22,name:"is_recorder",kind:"scalar",opt:!0,T:8}])}return(0,y.Z)(n)}(Xa)),fg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Preset",[{no:1,name:"permissions",kind:"message",T:function(){return hg}},{no:3,name:"version",kind:"scalar",T:9},{no:4,name:"preset_name",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),vg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.PeerPreset.Data",[{no:1,name:"preset",kind:"message",T:function(){return fg}}])}return(0,y.Z)(n)}(Xa)),mg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.ChatMessage",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"user_id",kind:"scalar",T:9},{no:4,name:"display_name",kind:"scalar",T:9},{no:5,name:"pinned",kind:"scalar",T:8},{no:6,name:"is_edited",kind:"scalar",T:8},{no:7,name:"payload_type",kind:"scalar",T:5},{no:8,name:"payload",kind:"scalar",T:9},{no:10,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:11,name:"created_at",kind:"scalar",T:4,L:2},{no:12,name:"created_at_ms",kind:"scalar",opt:!0,T:4,L:2}])}return(0,y.Z)(n)}(Xa)),gg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.GetPaginatedChatMessageRoomRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),yg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.GetPaginatedChatMessageRoomResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:function(){return mg}},{no:2,name:"next",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),bg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.GetChatMessagesResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:function(){return mg}}])}return(0,y.Z)(n)}(Xa)),kg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.SendChatMessageToRoomRequest",[{no:1,name:"payload_type",kind:"scalar",T:5},{no:2,name:"payload",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),_g=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.SendChatMessageToRoomResponse",[{no:1,name:"message",kind:"message",T:function(){return mg}}])}return(0,y.Z)(n)}(Xa)),wg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.SendChatMessageToPeersRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),xg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.SendChatMessageToPeersResponse",[{no:1,name:"message",kind:"message",T:function(){return mg}}])}return(0,y.Z)(n)}(Xa)),Sg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.EditChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",opt:!0,T:5},{no:3,name:"payload",kind:"scalar",opt:!0,T:9},{no:4,name:"pinned",kind:"scalar",opt:!0,T:8}])}return(0,y.Z)(n)}(Xa)),Eg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.EditChatMessageResponse",[{no:1,name:"message",kind:"message",T:function(){return mg}}])}return(0,y.Z)(n)}(Xa)),Tg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.DeleteChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Pg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.chat.DeleteChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa));!function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ON_STAGE=1]="ON_STAGE",e[e.APPROVED_STAGE=2]="APPROVED_STAGE",e[e.REQUESTED_STAGE=3]="REQUESTED_STAGE",e[e.OFF_STAGE=4]="OFF_STAGE"}(rg||(rg={})),function(e){e[e.HIVE=0]="HIVE",e[e.CHAT=1]="CHAT",e[e.PING=2]="PING"}(ig||(ig={}));var Cg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.Peer",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"stage_type",kind:"enum",opt:!0,T:function(){return["socket.room.StageType",rg,"STAGE_TYPE_"]}},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:7,name:"display_picture_url",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),Rg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.PeerInfoResponse",[{no:1,name:"peer",kind:"message",T:function(){return Cg}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.RoomPeersInfoResponse",[{no:1,name:"peers",kind:"message",repeat:1,T:function(){return Cg}}])}return(0,y.Z)(n)}(Xa));var Zg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.RoomPeerCountResponse",[{no:1,name:"count",kind:"scalar",T:4,L:2}])}return(0,y.Z)(n)}(Xa)),Mg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.Room",[{no:1,name:"room_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:4,name:"created_at",kind:"scalar",T:4,L:2}])}return(0,y.Z)(n)}(Xa)),Ag=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.RoomInfoResponse",[{no:1,name:"room",kind:"message",T:function(){return Mg}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.GetPeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.UpdatePeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa));var Ig=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.JoinRoomRequest",[{no:1,name:"peer",kind:"message",T:function(){return Cg}},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:5,name:"use_hive",kind:"scalar",opt:!0,T:8},{no:6,name:"preset",kind:"scalar",opt:!0,T:12},{no:7,name:"capabilities",kind:"enum",repeat:1,T:function(){return["socket.room.Capabilities",ig,"CAPABILITIES_"]}}])}return(0,y.Z)(n)}(Xa)),Og=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.LeaveRoomRequest",[{no:1,name:"peer",kind:"message",T:function(){return Cg}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.UpdateRoomInfoRequest",[{no:1,name:"room",kind:"message",T:function(){return Mg}}])}return(0,y.Z)(n)}(Xa)),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.GetConnectedRoomsDumpRequest",[])}return(0,y.Z)(n)}(Xa));var Lg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.ServiceError",[{no:1,name:"message",kind:"scalar",opt:!0,T:9},{no:2,name:"code",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),Dg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.ConnectedMeetingPeer",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:5,name:"display_picture_url",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),Ng=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.ConnectedMeetingDump",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:function(){return Dg}}])}return(0,y.Z)(n)}(Xa)),jg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.GetConnectedRoomsDumpResponse",[{no:1,name:"parent_meeting",kind:"message",T:function(){return Ng}},{no:2,name:"meetings",kind:"message",repeat:1,T:function(){return Ng}}])}return(0,y.Z)(n)}(Xa)),Bg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.CreateRoomRequestPayload",[{no:1,name:"title",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),Ug=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.CreateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:function(){return Bg}}])}return(0,y.Z)(n)}(Xa)),Vg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.CreateRoomResponsePayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:function(){return Lg}}])}return(0,y.Z)(n)}(Xa)),Fg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.CreateConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:function(){return Vg}}])}return(0,y.Z)(n)}(Xa)),zg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.UpdateRoomRequestPayload",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.UpdateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:function(){return zg}}])}return(0,y.Z)(n)}(Xa));var Hg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.DisableRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),qg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.DisableConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:function(){return Hg}}])}return(0,y.Z)(n)}(Xa)),Gg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.DisableConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:function(){return Wg}}])}return(0,y.Z)(n)}(Xa)),Wg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.DisableConnectedRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"status",kind:"scalar",opt:!0,T:9},{no:3,name:"title",kind:"scalar",opt:!0,T:9},{no:4,name:"error",kind:"message",T:function(){return Lg}}])}return(0,y.Z)(n)}(Xa)),Jg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.MovePeerPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),$g=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.MovePeersBetweenRoomsRequest",[{no:1,name:"source_meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"destination_meeting_id",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:function(){return Jg}}])}return(0,y.Z)(n)}(Xa)),Kg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.MovedPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:function(){return Lg}}])}return(0,y.Z)(n)}(Xa));new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.MovePeersBetweenRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:function(){return Kg}}])}return(0,y.Z)(n)}(Xa));var Qg,Yg,Xg=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.room.TransferPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"auth_token",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),ey=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.AddPluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),ty=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.RemovePluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}return(0,y.Z)(n)}(Xa)),ny=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.EnablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),ry=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.DisablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),iy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.pl
2ugin.EnablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),ay=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.DisablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),oy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginEventToRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}return(0,y.Z)(n)}(Xa)),sy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginEventToPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"plugin_data",kind:"scalar",T:12}])}return(0,y.Z)(n)}(Xa)),cy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.StoreKeys",[{no:1,name:"store_key",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",opt:!0,T:12}])}return(0,y.Z)(n)}(Xa)),uy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginStoreInsertKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"insert_keys",kind:"message",repeat:1,T:function(){return cy}}])}return(0,y.Z)(n)}(Xa)),ly=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginStoreGetKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"get_keys",kind:"message",repeat:1,T:function(){return cy}}])}return(0,y.Z)(n)}(Xa)),dy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginStoreDeleteKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"delete_keys",kind:"message",repeat:1,T:function(){return cy}}])}return(0,y.Z)(n)}(Xa)),py=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginStoreDeleteRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),hy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.EnablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"enabled_by",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),fy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.EnablePluginsResponse",[{no:1,name:"plugins",kind:"message",repeat:1,T:function(){return hy}}])}return(0,y.Z)(n)}(Xa)),vy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.DisablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"disabled_by",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),my=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginStoreItem",[{no:1,name:"timestamp",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"store_key",kind:"scalar",T:9},{no:4,name:"payload",kind:"scalar",T:12}])}return(0,y.Z)(n)}(Xa)),gy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginStoreResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"store_items",kind:"message",repeat:1,T:function(){return my}}])}return(0,y.Z)(n)}(Xa)),yy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.plugin.PluginEventResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}return(0,y.Z)(n)}(Xa)),by=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.livestreaming.LiveStreamingEvent",[{no:1,name:"livestream_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",T:9},{no:5,name:"playback_url",kind:"scalar",T:9},{no:6,name:"org_id",kind:"scalar",T:9},{no:7,name:"room_name",kind:"scalar",T:9},{no:8,name:"room_uuid",kind:"scalar",T:9},{no:9,name:"status",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),ky=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.livestreaming.GetStagePeersResponse",[{no:1,name:"stage_peers",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),_y=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.livestreaming.StageRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),wy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.livestreaming.GetStageRequestsResponse",[{no:1,name:"stage_requests",kind:"message",repeat:1,T:function(){return _y}}])}return(0,y.Z)(n)}(Xa)),xy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.livestreaming.GrantStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),Sy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.livestreaming.DenyStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),Ey=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.livestreaming.LeaveStageRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),Ty=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.polls.Poll",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"created_by",kind:"scalar",T:9},{no:3,name:"created_by_user_id",kind:"scalar",T:9},{no:4,name:"question",kind:"scalar",T:9},{no:5,name:"options",kind:"message",repeat:1,T:function(){return Py}},{no:6,name:"hide_votes",kind:"scalar",T:8},{no:7,name:"anonymous",kind:"scalar",T:8},{no:8,name:"votes",kind:"scalar",repeat:2,T:9}])}return(0,y.Z)(n)}(Xa)),Py=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.polls.PollOption",[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"count",kind:"scalar",opt:!0,T:4,L:2},{no:3,name:"votes",kind:"message",repeat:1,T:function(){return Cy}}])}return(0,y.Z)(n)}(Xa)),Cy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.polls.PollVote",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Ry=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.polls.NewPollRequest",[{no:1,name:"question",kind:"scalar",T:9},{no:2,name:"options",kind:"scalar",repeat:2,T:9},{no:3,name:"anonymous",kind:"scalar",T:8},{no:4,name:"hide_votes",kind:"scalar",T:8},{no:5,name:"created_by",kind:"scalar",opt:!0,T:9},{no:6,name:"created_by_user_id",kind:"scalar",opt:!0,T:9}])}return(0,y.Z)(n)}(Xa)),Zy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.polls.VotePollRequest",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"index",kind:"scalar",T:4,L:2}])}return(0,y.Z)(n)}(Xa)),My=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.polls.UpdatePollResponse",[{no:1,name:"poll",kind:"message",T:function(){return Ty}}])}return(0,y.Z)(n)}(Xa)),Ay=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"socket.polls.GetPollsResponse",[{no:1,name:"polls",kind:"message",repeat:1,T:function(){return Ty}}])}return(0,y.Z)(n)}(Xa));!function(e){e[e.ACTION=0]="ACTION",e[e.RESPONSE=1]="RESPONSE",e[e.EVENT=2]="EVENT"}(Qg||(Qg={})),function(e){e[e.SERVICE_NOT_FOUND=0]="SERVICE_NOT_FOUND",e[e.PARAMETER_VALIDATION_ERROR=1]="PARAMETER_VALIDATION_ERROR",e[e.TIMEOUT_ERROR=2]="TIMEOUT_ERROR",e[e.APPLICATION_ERROR=3]="APPLICATION_ERROR"}(Yg||(Yg={})),new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"bridge.BridgeMessage",[{no:1,name:"type",kind:"enum",T:function(){return["bridge.BridgeMessageType",Qg]}},{no:2,name:"action",kind:"message",oneof:"data",T:function(){return Iy}},{no:3,name:"response",kind:"message",oneof:"data",T:function(){return Oy}},{no:4,name:"event",kind:"message",oneof:"data",T:function(){return Dy}}])}return(0,y.Z)(n)}(Xa));var Iy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"bridge.BridgeAction",[{no:1,name:"action",kind:"scalar",T:9},{no:2,name:"params",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Oy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"bridge.BridgeResponse",[{no:1,name:"success",kind:"scalar",T:8},{no:2,name:"response",kind:"scalar",T:9},{no:3,name:"error",kind:"message",T:function(){return Ly}}])}return(0,y.Z)(n)}(Xa)),Ly=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"bridge.BridgeError",[{no:1,name:"type",kind:"enum",T:function(){return["bridge.ErrorType",Yg]}},{no:2,name:"message",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Dy=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"bridge.BridgeEvent",[{no:1,name:"event",kind:"scalar",T:9},{no:2,name:"params",kind:"scalar",T:9}])}return(0,y.Z)(n)}(Xa)),Ny=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}return(0,y.Z)(n,[{key:"now",value:function(){var e=this.create(),t=D
2ate.now();return e.seconds=Pa.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}},{key:"toDate",value:function(e){return new Date(1e3*Pa.from(e.seconds).toNumber()+Math.ceil(e.nanos/1e6))}},{key:"fromDate",value:function(e){var t=this.create(),n=e.getTime();return t.seconds=Pa.from(Math.floor(n/1e3)).toBigInt(),t.nanos=n%1e3*1e6,t}},{key:"internalJsonWrite",value:function(e,t){var n=1e3*Pa.from(e.seconds).toNumber();if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");var r="Z";if(e.nanos>0){var i=(e.nanos+1e9).toString().substring(1);r="000000"===i.substring(3)?"."+i.substring(0,3)+"Z":"000"===i.substring(6)?"."+i.substring(0,6)+"Z":"."+i+"Z"}return new Date(n).toISOString().replace(".000Z",r)}},{key:"internalJsonRead",value:function(e,t,n){if("string"!=typeof e)throw new Error("Unable to parse Timestamp from JSON "+ua(e)+".");var r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");var i=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(i))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return n||(n=this.create()),n.seconds=Pa.from(i/1e3).toBigInt(),n.nanos=0,r[7]&&(n.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),n}}]),n}(Xa);new Ny;var jy=function(){function e(t){var n=this;(0,g.Z)(this,e),Cs(this,"ipInfo"),Cs(this,"axios"),Cs(this,"requests"),Cs(this,"roomName"),Cs(this,"roomUUID"),Cs(this,"peerId"),Cs(this,"authToken"),Cs(this,"organizationId");var r=t||{},i=r.timeout,a=void 0===i?8e3:i,o=r.retry,s=void 0===o?3:o,c=r.retryDelay,u=void 0===c?30:c,l=r.baseURL,d=void 0===l?"https://api.cluster.dyte.in":l,f=r.authToken;this.requests=R().create({baseURL:d,responseType:"json",timeout:a,retry:s,retryDelay:u}),this.axios=R(),this.setAuthToken(f,{bearer:!0}),this.requests.interceptors.request.use((function(e){return Lv.injectContext(n.requests.defaults.headers.common),e}),function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Dv.error("xhr::axios",{debuggingHint:"otelRequestInterceptor failed.",error:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.requests.interceptors.response.use((function(e){return e.config.url!==Lv.logsEndpoint&&Dv.debug("xhr::axios",{networkCall:{status:e.status,statusText:e.statusText,baseURL:e.config.baseURL,url:e.config.url,method:e.config.method}}),e}),function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",Promise.reject(new Error("Unknown error occurred")));case 2:return t&&t.config&&(null==(r=t.config)?void 0:r.url)!==Lv.logsEndpoint&&Dv.error("xhr::axios",{error:t,networkCall:{status:t.status,statusText:t.statusText,baseURL:t.config.baseURL,url:t.config.url,retries:t.config.retry,method:t.config.method,isOnline:navigator.onLine?"online":"offline"}}),i=t.config,a=t.message,e.abrupt("return",i&&a&&void 0!==i.retry&&i.retry>0&&(a.includes("timeout")||a.includes("Network Error"))?(i.retry-=1,"https://api.cluster.dyte.in"===i.baseURL?i.baseURL="https://network2.dyte.io":"https://network2.dyte.io"===i.baseURL&&(i.baseURL="https://api.cluster.dyte.in"),n.requests(i)):Promise.reject(t));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}return(0,y.Z)(e,[{key:"setAuthToken",value:function(e,t){var n=(t||{}).bearer;this.authToken=e,this.requests.defaults.headers.common.Authorization=n?"Bearer ".concat(e):e}},{key:"setHeader",value:function(e,t){this.requests.defaults.headers.common[e]=t}},{key:"setRoomName",value:function(e){this.roomName=e}},{key:"setRoomUUID",value:function(e){this.roomUUID=e}},{key:"setPeerId",value:function(e){this.peerId=e}},{key:"setOrganizationId",value:function(e){this.organizationId=e}}]),e}(),By=Object.defineProperty,Uy=Object.getOwnPropertyDescriptor,Vy=function(e,t,n,r){for(var i,a=r>1?void 0:r?Uy(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&By(t,n,a),a},Fy=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,e)).setHeader("x-dyte-web-core-version",hv),r}return(0,y.Z)(n,[{key:"getIPDetails",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.peerId,e.prev=1,e.next=4,this.requests.get("https://media-location.dyte.io");case 4:if(i=e.sent.data,!((null==(r=i.loc)?void 0:r.length)>5)){e.next=7;break}return e.abrupt("return",i);case 7:throw Error("Insufficient data");case 10:e.prev=10,e.t0=e.catch(1),Dv.error("getIPDetails::failed");case 13:return e.prev=13,e.next=16,hc.getIPDetails({peerId:n});case 16:return a=e.sent,e.abrupt("return",(Dv.info("gotIPDetails",{networkCall:{ip:a.ip,timezone:a.timezone}}),a));case 20:return e.prev=20,e.t1=e.catch(13),Dv.warn("ApiClient.getRoomNodeLinkAndTitleV1 Failed to get ip details",{error:{name:e.t1.name,message:e.t1.message}}),e.abrupt("return");case 24:case"end":return e.stop()}}),e,this,[[1,10],[13,20]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getICEServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.get("/iceservers");case 2:if(t=e.sent.data,n=t.success,r=t.iceServers,!n){e.next=7;break}return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getPlugins",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,c,u,l,d,h,f,v=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.get("/v2/plugins/user");case 2:return d=e.sent.data.data.plugins,h=(null==(r=null==(n=jc.getValue(qf))?void 0:n.toString())?void 0:r.split(","))||[],f=d.reduce((function(e,t){return e[h.includes(t.id)?"v1":"v2"].push(t),e}),{v1:[],v2:[]}),e.abrupt("return",(d="socket-service"===t?f.v2:f.v1,null!=(c=null==(a=null==(i=lv.modules)?void 0:i.devTools)?void 0:a.plugins)&&c.length&&(null==(l=null==(u=lv.modules)?void 0:u.devTools)||l.plugins.forEach((function(e){var t,n,r,i=(0,s.Z)((0,s.Z)({},Jv),{},{tags:(0,o.Z)(Jv.tags)});i.baseURL="http://localhost:".concat(e.port),i.name=e.name,i.picture=null!=(t=e.picture)?t:Jv.picture,i.description=null!=(n=e.description)?n:Jv.description,i.staggered=null!=(r=e.staggered)?r:Jv.staggered,i.createdAt=(new Date).toISOString(),i.updatedAt=(new Date).toISOString(),i.id=e.id,i.organizationId=v.organizationId,d.push(i)}))),d));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}
2,{key:"getPluginDetails",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.get("/v2/plugins/view/".concat(t));case 2:return n=e.sent.data.data.plugin,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPluginConfig",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.axios.get("".concat(t,"/dyte-config.json"));case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"authorizePlugin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={peerId:this.peerId},Wv.isV2AuthToken||(n.roomName=this.roomName),e.next=4,this.requests.post("/v2/plugins/authorize/".concat(t),n);case 4:return r=e.sent.data.data.token,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPresignedUrls",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.post("/v1/meetings/genPreSignedUploadUrl",{roomUUID:this.roomUUID,filename:t});case 2:return n=e.sent.data.data,r=n.getLocation,i=n.putLocation,e.abrupt("return",{getLocation:r,putLocation:i});case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"uploadFile",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.axios.put(n,t,{headers:{"Content-Type":t.type}});case 2:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(jy);Vy([Lv.trace("APIClient.getIPDetails")],Fy.prototype,"getIPDetails",1),Vy([Lv.trace("APIClient.getICEServers")],Fy.prototype,"getICEServers",1);var zy=Object.defineProperty,Hy=Object.getOwnPropertyDescriptor,qy=function(e,t,n,r){for(var i,a=r>1?void 0:r?Hy(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&zy(t,n,a),a},Gy=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"startLivestreaming",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.post("/v2/meetings/".concat(Wv.meetingId,"/livestreams"));case 2:if(e.t0=t=e.sent.data,null!=e.t0){e.next=7;break}e.t1=void 0,e.next=8;break;case 7:e.t1=t.data;case 8:if(e.t2=n=e.t1,null!=e.t2){e.next=13;break}e.t3=void 0,e.next=14;break;case 13:e.t3=n.playback_url;case 14:return e.abrupt("return",e.t3);case 15:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"stopLivestreaming",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.requests.post("/v2/meetings/".concat(Wv.meetingId,"/active-livestream/stop")));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getActiveLivestream",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=xf,e.next=3,this.requests.get("/v2/meetings/".concat(Wv.meetingId,"/active-livestream"));case 3:return e.t1=e.sent.data.data,t=(0,e.t0)(e.t1),n=t.playbackUrl,r=t.status,e.abrupt("return",{status:r,playbackUrl:n});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getUserDetails",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.get("v2/internals/participant-details");case 2:return t=e.sent.data.data,e.abrupt("return",xf(t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getUserPreset",value:function(e){throw new Error("getUserPreset does not exist for v2")}},{key:"startRecording",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.post("/v2/recordings",(0,s.Z)((0,s.Z)({},Sf(t)),{},{meeting_id:Wv.meetingId}));case 2:return e.abrupt("return",e.sent.data.id);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopRecording",value:function(e){return this.requests.put("v2/recordings/".concat(e),{action:"stop"})}},{key:"getActiveRecording",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.get("v2/recordings/active-recording/".concat(Wv.meetingId));case 2:return t=e.sent.data.data,n=t.status,r=t.id,e.abrupt("return",{status:n,id:r});case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRoomNodeData",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.peerId,e.next=3,this.getIPDetails({peerId:n});case 3:return r=e.sent,this.ipInfo=r,e.t0=xf,e.next=8,this.requests.post("v2/internals/rooms",{ip_information:r});case 8:return e.t1=e.sent.data.data,i=(0,e.t0)(e.t1),a=i.roomNodeLink,o=i.title,s=i.useHiveMedia,e.abrupt("return",{roomNodeUrl:a,meetingTitle:o,useHiveMedia:null!=s&&s});case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Fy);qy([Lv.trace("APIClient.getUserDetails")],Gy.prototype,"getUserDetails",1),qy([Lv.trace("APIClient.getUserPreset")],Gy.prototype,"getUserPreset",1),qy([Lv.trace("APIClient.startRecording")],Gy.prototype,"startRecording",1),qy([Lv.trace("APIClient.stopRecording")],Gy.prototype,"stopRecording",1),qy([Lv.trace("APIClient.getActiveRecording")],Gy.prototype,"getActiveRecording",1),qy([Lv.trace("APIClient.getRoomNodeData")],Gy.prototype,"getRoomNodeData",1);var Wy,Jy=Object.defineProperty,$y=Object.getOwnPropertyDescriptor,Ky=function(e,t,n,r){for(var i,a=r>1?void 0:r?$y(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Jy(t,n,a),a},Qy=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"startLivestreaming",value:function(){throw new Error("Method not implemented.")}},{key:"stopLivestreaming",value:function(){throw new Error("Method not implemented.")}},{key:"getActiveLivestream",value:function(){throw new Error("Method not implemented.")}},{key:"getUserDetails",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.get("/auth/basicUserDetails");case 2:return t=e.sent.data.user,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getUserPreset",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.post("/v1/userpreset",{roomName:t,authToken:this.authToken,clientType:"CLIENT_APP",version:"0.5.0"});case 2:return n=e.sent.data.data.preset,e.abrupt("return",xf(n));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"startRecording",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.post("/v1/organizations/".concat(this.organizationId,"/rooms/").concat(this.roomName,"/recording"),t);case 2:if(201===(n=e.sent).status){e.next=5;break}throw new Error("Recording failed to start");case 5:return e.abrupt("return",n.data.data.recording.id);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopRecording",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.requests.put("/v1/organizations/".concat(this.organizationId,"/rooms/").concat(this.roomName,"/recordings/").concat(t),{recordingAction:"stop"});case 2:if(e.t0=e.sent.status,201===e.t0){e.next=5;break}throw new Error("Recording failed to stop");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getActiveRecording",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.organizationId){e.next=6;break}return e.next=3,this.requests.get("/v1/organizations/".concat(this.organizationId,"/rooms/").concat(this.roomName,"/active-recording?limit=50"));case 3:e.t0=e.sent.data.data.recording,e.next=7;break;case 6:e.t0={};case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRoomNodeData",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.roomName,r=t.peerId,i="\n        query Session($roomName: String!, $password: String, $ipInformation: String) {\n            session(roomName: $roomName, password: $password) {\n              title,\n              roomNodeLink(ipInformation: $ipInformation),\n              useHiveMedia,\n              roomName,\n              password\n            }\n          }\n        ",e.next=4,this.getIPDetails({peerId:r});case 4:return a=e.sent,this.ipInfo=a,e.next=8,this.requests.post("/graphql",{query:i,variables:{roomName:n,ipInformation:JSON.stringify(a)}});case 8:return o=e.sent.data.data.session,s=o.roomNodeLink,c=o.title,u=o.useHiveMedia,e.abrupt("return",{roomNodeUrl:s,meetingTitle:c,useHiveMedia:null!=u&&u});case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Fy);function Yy(e){return Wy=Wv.isV2AuthToken?new Gy(e):new Qy(e)}function Xy(){return Wy}Ky([Lv.trace("APIClientV1.getUserDetails")],Qy.prototype,"getUserDetails",1),Ky([Lv.trace("APIClientV1.getUserPreset")],Qy.prototype,"getUserPreset",1),Ky([Lv.trace("APIClientV1.startRecording")],Qy.prototype,"startRecording",1),Ky([Lv.trace("APIClientV1.stopRecording")],Qy.prototype,"stopRecording",1),Ky([Lv.trace("APIClientV1.getActiveRecording")],Qy.prototype,"getActiveRecording",1),Ky([Lv.trace("APIClientV1.getRoomNodeData")],Qy.prototype,"getRoomNodeData",1);function eb(e,t){return Object.keys(t).reduce((function(n,r){return n[r]=(e<<16)+t[r],n}),{})}var tb,nb=eb(0,{getPeerInfo:0,updatePeerInfo:1,getRoomPeersInfo:2,joinRoom:3,leaveRoom:4,getRoomInfo:5,updateRoomInfo:6,closeRoom:7,startedLivestream:8,stoppedLivestream:9,erroredLivestream:10,getStagePeers:11,getStageRequests:12,requestStageAccess:13,cancelStageRequest:14,grantStageAccess:1
25,denyStageAccess:16,roomPeerCount:17,joinStage:18,leaveStage:19,getConnectedRoomsDump:20,createConnectedRooms:21,deleteConnectedRooms:22,movePeers:23,transferPeer:24,movedPeer:25,connectedRoomsUpdated:26,connectedRoomsDeleted:27}),rb=eb(1,{getMessages:0,sendMessageToRoom:1,sendMessageToPeers:2,editMessage:3,deleteMessage:4,getPaginatedMessages:5}),ib=eb(2,{getPlugins:0,addPlugin:1,enablePluginForRoom:2,disablePluginForPeers:3,enablePluginForPeers:4,disablePluginForRoom:5,removePlugin:6,customPluginEventToRoom:7,customPluginEventToPeers:8,storeInsertKeys:9,storeGetKeys:10,storeDeleteKeys:11,storeDelete:12}),ab=eb(3,{createPoll:0,getPolls:1,votePoll:2,updatePoll:3}),ob=function(e){return Object.keys(e).reduce((function(t,n){return t[n]=16777216|e[n],t}),{})}({unknown:0,createWebRTCTransport:1,produce:2,consume:3,toggleProducer:4,toggleConsumer:5,closeProducer:6,closeConsumer:7,joinRoom:16,leaveRoom:17,selectedPeer:18,globalPinPeer:19,selfJoinComplete:20,peerJoinedBroadcast:25,peerLeaveBroadcast:26,peerProducerCreateBroadcast:27,peerProducerToggleBroadcast:28,peerProducerCloseBroadcast:29,globalPeerPinBroadcast:30,recordingStartedBroadcast:31,recordingStoppedBroadcast:32,peerDisplayNameEditBroadcast:33,selectedPeerDiff:40,renegotiateSessionDescription:50,kickPeer:90,kickAll:91,changeDisplayName:92,hostControlPeer:93,hostControlAllPeers:94}),sb=function(){function e(){(0,g.Z)(this,e),Cs(this,"meetingTitle"),Cs(this,"roomName"),Cs(this,"roomUUID"),Cs(this,"isDisconnected"),Cs(this,"roomJoined"),Ms(this,tb,void 0),Cs(this,"peerId"),Cs(this,"authToken"),Cs(this,"maxPreferredStreams")}return(0,y.Z)(e,[{key:"sfuHandler",get:function(){return Zs(this,tb)}},{key:"reconnect",value:function(){throw new Bv("Method not implemented.")}},{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i){var a=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw a.length>4&&void 0!==a[4]?a[4]:{},new Bv("Method not implemented.");case 2:case"end":return e.stop()}}),e)})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"leaveRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"handleSocketCallbacks",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"handleSockets",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"shareMic",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"shareWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"shareScreen",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"unmuteSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"muteSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"pauseWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"disableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"acceptWaitingRequest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"rejectWaitingRequest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"muteAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"muteAllVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"disableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"kickAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"kick",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"pinPeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getChatMessages",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"requestRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"acceptRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"terminateRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendEventRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"getPolls",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"newPoll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"votePoll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getConsumers",value:function(){throw new Bv("Method not implemented.")}},{key:"sendMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRoomState",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addRoomPlugin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeRoomPlugin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"unpinChatMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"pinChatMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendChatMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"broadcastMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"acceptAllRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopPresenting",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"startPresenting",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"requestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"rejectRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"withdrawRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"removePeerFromStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Bv("Method not implemented.");case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"stopAllProducers",value:function(){throw new Bv("Method not implemented.")}}]),e}();tb=new WeakMap;var cb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n)}(Ns.EventEmitter),ub=function(){function e(t){(0,g.Z)(this,e),Cs(this,"_name"),this._name=t}return(0,y.Z)(e,[{key:"info",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=e.format.apply(e,[t].concat(r));this._name&&(a="".concat(this._name,"::").concat(a)),Dv.info(a)}},{key:"debug",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=e.format.apply(e,[t].concat(r));this._name&&(a="".concat(this._name,"::").concat(a)),Dv.info(a)}},{key:"warn",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=e.format.apply(e,[t].concat(r));this._name&&(a="".concat(this._name,"::").concat(a)),Dv.info(a)}},{key:"error",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=e.format.apply(e,[t].concat(r));this._name&&(a="".concat(this._name,"::").concat(a)),Dv.error(a)}}],[{key:"getLogger",value:function(t){return new e(t)}},{key:"format",value:function(e){for(var t,n,r=e.split("%"),i=e,a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];r.length&&(t=r,n=(0,d.Z)(t,1),i=n[0]),o.reverse();for(var c=1;c<r.length&&o.length;c+=1){var u=o.pop(),l=r[c];switch(l.at(0)){case"s":l=l.replace("s",u);break;case"d":l=l.replace("d",u.toString());break;case"o":l=l.replace("o",JSON.stringify(u,null,2))}
2i="".concat(i).concat(l)}return o.length&&o.reverse().forEach((function(e){i="".concat(i," ").concat(e instanceof Object?JSON.stringify(e,null,2):e)})),i}}]),e}(),lb=ub.getLogger("EnhancedEventEmitter"),db=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),(e=t.call(this)).setMaxListeners(1/0),e}return(0,y.Z)(n,[{key:"safeEmit",value:function(e){var t=this.listenerCount(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];return this.emit.apply(this,[e].concat(r))}catch(E){return lb.error("safeEmit() | event listener threw an error [event:%s]:%o",e,E),Boolean(t)}}},{key:"safeEmitAsPromise",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n={}.EVENT_PROMISE_TIMEOUT?parseInt({}.EVENT_PROMISE_TIMEOUT,10):1e4,r=o.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=o[a];return e.abrupt("return",this.safeEmitAsPromiseWithTimeout.apply(this,[t,n].concat(i)));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"safeEmitAsPromiseWithTimeout",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o=this,s=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=s.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=s[a];return e.abrupt("return",new Promise((function(e,r){setTimeout(r,n,"event request timeout");try{o.emit.apply(o,[t].concat(i,[e,r]))}catch(a){lb.error("safeEmitAsPromise() | event listener threw an error [event:%s]:%o",t,a),r(a)}})));case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(Ns.EventEmitter),pb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.call(this),Cs((0,f.Z)(e),"_mapMidTransceiver",new Map),e._mapMidTransceiver=new Map,e}return(0,y.Z)(n,[{key:"midTransceiverMap",get:function(){return this._mapMidTransceiver}}]),n}(db),hb=ub.getLogger("Chrome74"),fb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.call(this),Cs((0,f.Z)(e),"_direction"),Cs((0,f.Z)(e),"_pc"),Cs((0,f.Z)(e),"_sendWebStream",new MediaStream),Cs((0,f.Z)(e),"_sendScreenShareStream",new MediaStream),Cs((0,f.Z)(e),"_transportReady",!1),e}return(0,y.Z)(n,[{key:"name",get:function(){return"Chrome74"}},{key:"pc",get:function(){return this._pc}},{key:"close",value:function(){if(hb.debug("close()"),this._pc)try{this._pc.close()}catch(e){hb.error("pc.close()",e)}}},{key:"init",value:function(e){var t=e.direction,n=e.iceServers,r=e.iceTransportPolicy,i=e.additionalSettings,a=e.proprietaryConstraints,o=e.onTrackHandler;hb.debug("init()",i),this._direction=t,this._pc=new RTCPeerConnection((0,s.Z)({iceServers:n||[],iceTransportPolicy:r||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},i),a),o&&this._pc.addEventListener("track",(function(e){o(e)})),this._addEventListeners()}},{key:"connect",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._pc.createDataChannel("dyte"),e.next=3,this._pc.createOffer();case 3:return n=e.sent,hb.info("connect offer",n),e.next=7,this._pc.setLocalDescription(n);case 7:return e.abrupt("return",{offerSdp:n,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return hb.debug("connect() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,r._pc.setRemoteDescription(n);case 3:t.close();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:hb.debug("updateIceServers()"),(n=this._pc.getConfiguration()).iceServers=t,this._pc.setConfiguration(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return hb.debug("restartIce()"),e.next=3,this.pc.createOffer({iceRestart:!0});case 3:return t=e.sent,e.abrupt("return",(hb.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",t),{offerSdp:t,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return hb.info("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,n._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,s,c,u,l,d,f,v,m,g=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.track,r=t.encodings,i=t.codecOption,a=t.screenShare,this._assertSendDirection(),hb.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),hb.debug("creating new transceiver"),c=this._pc.addTransceiver(n,{direction:"sendonly",streams:[a?this._sendScreenShareStream:this._sendWebStream],sendEncodings:r}),u=RTCRtpSender.getCapabilities(n.kind),hb.info("senders available params:",u),l=[],i&&(d=u.codecs.find((function(e){return e.mimeType.includes(i.name)})),i.parameters&&(hb.info("codecOption.parameters:",i.parameters),(f=(null==(s=d.sdpFmtpLine)?void 0:s.split(";"))||[]).push.apply(f,(0,o.Z)(i.parameters)),v=(0,o.Z)(new Set(f).values()),d.sdpFmtpLine
2=v.join(";")),l.push(d)),hb.info("selected codecs:",l),c.setCodecPreferences(l),e.next=9,this._pc.createOffer();case 9:if(m=e.sent,this._transportReady){e.next=12;break}throw new Error("webrtc transport not connected");case 12:return e.next=14,this._pc.setLocalDescription(m);case 14:return i&&"opus"===i.name&&(m.sdp=m.sdp.replace("minptime=10;useinbandfec=1","minptime=10;useinbandfec=1;usedtx=1"),m.sdp+="a=rtcp-fb:111 nack\r\n"),e.abrupt("return",{offerSdp:m,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return hb.debug("send() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,g._pc.setRemoteDescription(t);case 3:return g.midTransceiverMap.set(c.mid,c),e.abrupt("return",c.mid);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),hb.debug("stopSending() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),n.direction="inactive",e.next=7,this._pc.createOffer();case 7:return r=e.sent,hb.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return e.abrupt("return",{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return hb.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,i._pc.setRemoteDescription(n);case 3:i.midTransceiverMap.delete(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),n?hb.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):hb.debug("replaceTrack() [localId:%s, no track]",t),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),hb.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",t,n),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){e.active=t<=n})),e.next=8,r.sender.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),hb.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(e){this._assertSendDirection();var t=this.midTransceiverMap.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw this._assertRecvDirection(),hb.debug("stopReceiving() [localId:%s]",t),Error("method not implemented");case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw this._assertRecvDirection(),hb.debug("pauseReceiving() [localId:%s]",t),Error("method not implemented");case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw this._assertRecvDirection(),hb.debug("resumeReceiving() [localId:%s]",t),Error("method not implemented");case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"_assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}},{key:"_generateOffer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._pc.createOffer();case 2:return t=e.sent,e.next=5,this._pc.setLocalDescription(t);case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_setAnswer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return hb.debug("_setAnswer() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,this._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_addEventListeners",value:function(){var e=this;this._pc.addEventListener("iceconnectionstatechange",(function(){switch(e._pc.iceConnectionState){case"checking":e.emit("@connectionstatechange","connecting");break;case"connected":case"completed":e.emit("@connectionstatechange","connected"),e._transportReady=!0;break;case"failed":e.emit("@connectionstatechange","failed");break;case"disconnected":e.emit("@connectionstatechange","disconnected");break;case"closed":e.emit("@connectionstatechange","closed");break;default:hb.warn("unknown state")}})),this._pc.addEventListener("icecandidate",(function(t){t.candidate&&e.emit("@icecandidate",{candidate:t.candidate})})),this._pc.addEventListener("negotiationneeded",(function(){e.emit("@negotiationneeded",{}),hb.debug("negotiationneeded")})),this._pc.addEventListener("icegatheringstatechange",(function(){switch(e._pc.iceGatheringState){case"gathering":hb.debug("icegatheringstatechange | gathering"),e.emit("@icegatheringstatechange","gathering");break;case"complete":hb.debug("icegatheringstatechange | complete"),e.emit("@icegatheringstatechange","complete");break;default:hb.warn("unknown state")}})),this._pc.addEventListener("icecandidateerror",(function(e){hb.info("icecandidateerror",e)})),this._pc.addEventListener("datachannel",(function(t){hb.info("data channel created: ",t.channel.label);var n=t.channel;n.onopen=function(){hb.info("data channel open: ",t.channel.label)}
2,n.onclose=function(){hb.warn("data channel closed: ",t.channel.label)},n.onerror=function(e){hb.error("data channel error: ",t.channel.label,e)},n.onmessage=function(n){hb.info("data channel message: ",t.channel.label,n),e.safeEmit("datachannel",t.channel,String.fromCharCode.apply(null,new Uint8Array(n.data)))}}))}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(pb),vb=ub.getLogger("Firefox60"),mb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.call(this),Cs((0,f.Z)(e),"_direction"),Cs((0,f.Z)(e),"_pc"),Cs((0,f.Z)(e),"_sendWebStream",new MediaStream),Cs((0,f.Z)(e),"_sendScreenShareStream",new MediaStream),Cs((0,f.Z)(e),"_transportReady",!1),e}return(0,y.Z)(n,[{key:"name",get:function(){return"Firefox60"}},{key:"pc",get:function(){return this._pc}},{key:"close",value:function(){if(vb.debug("close()"),this._pc)try{this._pc.close()}catch(e){vb.error("pc.close()",e)}}},{key:"init",value:function(e){var t=e.direction,n=e.iceServers,r=e.iceTransportPolicy,i=e.additionalSettings,a=e.proprietaryConstraints,o=e.onTrackHandler;vb.debug("init()"),this._direction=t,this._pc=new RTCPeerConnection((0,s.Z)({iceServers:n||[],iceTransportPolicy:r||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"},i),a),o&&this._pc.addEventListener("track",(function(e){o(e)})),this._addEventListeners()}},{key:"connect",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._pc.createDataChannel("dyte"),e.next=3,this._pc.createOffer();case 3:return n=e.sent,vb.info("connect offer",n),e.next=7,this._pc.setLocalDescription(n);case 7:return e.abrupt("return",{offerSdp:n,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("connect() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,r._pc.setRemoteDescription(n);case 3:t.close();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw vb.debug("updateIceServers()"),new Error("not supported");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("restartIce()"),e.next=3,this.pc.createOffer({iceRestart:!0});case 3:return t=e.sent,e.abrupt("return",(vb.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",t),{offerSdp:t,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.info("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,n._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.track,r=t.encodings,i=t.screenShare,this._assertSendDirection(),vb.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),vb.debug("creating new transceiver"),a=this._pc.addTransceiver(n,{direction:"sendonly",streams:[i?this._sendScreenShareStream:this._sendWebStream]}),!r){e.next=9;break}return r.reverse(),(o=a.sender.getParameters()).encodings=r,e.next=9,a.sender.setParameters(o);case 9:return e.next=11,this._pc.createOffer();case 11:if(s=e.sent,this._transportReady){e.next=14;break}throw new Error("webrtc transport not connected");case 14:return e.next=16,this._pc.setLocalDescription(s);case 16:return s.sdp=s.sdp.replace("minptime=10;useinbandfec=1","minptime=10;useinbandfec=1;usedtx=1;maxaveragebitrate=16000"),e.abrupt("return",{offerSdp:s,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("send() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,c._pc.setRemoteDescription(t);case 3:return c.midTransceiverMap.set(a.mid,a),e.abrupt("return",a.mid);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),vb.debug("stopSending() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated transceiver not found");case 4:return n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),n.direction="inactive",e.next=7,this._pc.createOffer();case 7:return r=e.sent,vb.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return e.abrupt("return",{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,i._pc.setRemoteDescription(n);case 3:i.midTransceiverMap.delete(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),n?vb.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):vb.debug("replaceTrack() [localId:%s, no track]",t),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),vb.debug("setMaxSpatialLayer() [localId:%s, spatialL
2ayer:%s]",t,n),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return i=r.sender.getParameters(),a=i.encodings.length-1-n,i.encodings.forEach((function(e,t){e.active=t>=a})),e.next=8,r.sender.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),vb.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(e){this._assertSendDirection();var t=this.midTransceiverMap.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),vb.debug("stopReceiving() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",vb.info("active transcievers: %o",this._pc.getTransceivers()),e.next=7,this._pc.createOffer();case 7:return r=e.sent,vb.debug("stopRecieving() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return e.abrupt("return",{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("stopRecieving() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,i._pc.setRemoteDescription(n);case 3:i.midTransceiverMap.delete(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),vb.debug("pauseReceiving() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",e.next=7,this._pc.createOffer();case 7:return r=e.sent,vb.debug("pauseReceiving() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return e.abrupt("return",{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("pauseReceiving() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,i._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),vb.debug("resumeReceiving() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="recvonly",e.next=7,this._generateOffer();case 7:return r=e.sent,e.abrupt("return",(vb.debug("resumeReceiving() | calling pc.setLocalDescription() [offer:%o]",r),{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("resumeReceiving() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,i._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"_assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}},{key:"_generateOffer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._pc.createOffer();case 2:return t=e.sent,e.next=5,this._pc.setLocalDescription(t);case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_setAnswer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return vb.debug("_setAnswer() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,this._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_addEventListeners",value:function(){var e=this;this._pc.addEventListener("datachannel",(function(t){vb.info("data channel created: ",t.channel.label);var n=t.channel;n.onopen=function(){vb.info("data channel open: ",t.channel.label)}
2,n.onclose=function(){vb.warn("data channel closed: ",t.channel.label)},n.onerror=function(e){vb.error("data channel error: ",t.channel.label,e)},n.onmessage=function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r){var i;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return vb.debug("data channel message: ",t.channel.label,r),n.next=3,r.data.arrayBuffer();case 3:i=n.sent,e.safeEmit("datachannel",t.channel,String.fromCharCode.apply(null,new Uint8Array(i)));case 5:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()})),this._pc.addEventListener("iceconnectionstatechange",(function(){switch(e._pc.iceConnectionState){case"checking":e.emit("@connectionstatechange","connecting");break;case"connected":case"completed":e.emit("@connectionstatechange","connected"),e._transportReady=!0;break;case"failed":e.emit("@connectionstatechange","failed");break;case"disconnected":e.emit("@connectionstatechange","disconnected");break;case"closed":e.emit("@connectionstatechange","closed");break;
2default:vb.warn("unknown state")}})),this._pc.addEventListener("icecandidate",(function(t){t.candidate&&e.emit("@icecandidate",{candidate:t.candidate})})),this._pc.addEventListener("negotiationneeded",(function(){e.emit("@negotiationneeded",{}),vb.debug("negotiationneeded")})),this._pc.addEventListener("icegatheringstatechange",(function(){switch(e._pc.iceGatheringState){case"gathering":vb.debug("icegatheringstatechange | gathering"),e.emit("@icegatheringstatechange","gathering");break;case"complete":vb.debug("icegatheringstatechange | complete"),e.emit("@icegatheringstatechange","complete");break;default:vb.warn("unknown state")}})),this._pc.addEventListener("icecandidateerror",(function(e){vb.info("chrome74::icecandidateerror",e)}))}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(pb),gb=ub.getLogger("Safari12"),yb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.call(this),Cs((0,f.Z)(e),"_direction"),Cs((0,f.Z)(e),"_pc"),Cs((0,f.Z)(e),"_sendWebStream",new MediaStream),Cs((0,f.Z)(e),"_sendScreenShareStream",new MediaStream),Cs((0,f.Z)(e),"_transportReady",!1),e}return(0,y.Z)(n,[{key:"name",get:function(){return"Chrome74"}},{key:"pc",get:function(){return this._pc}},{key:"close",value:function(){if(gb.debug("close()"),this._pc)try{this._pc.close()}catch(e){gb.error("pc.close()",e)}}},{key:"init",value:function(e){var t=e.direction,n=e.iceServers,r=e.iceTransportPolicy,i=e.additionalSettings,a=e.proprietaryConstraints,o=e.onTrackHandler;gb.debug("init()"),this._direction=t,this._pc=new RTCPeerConnection((0,s.Z)({iceServers:n||[],iceTransportPolicy:r||"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require"},i),a),o&&this._pc.addEventListener("track",(function(e){o(e)})),this._addEventListeners()}},{key:"connect",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._pc.createDataChannel("dyte"),e.next=3,this._pc.createOffer();case 3:return n=e.sent,gb.info("connect offer",n),e.next=7,this._pc.setLocalDescription(n);case 7:return e.abrupt("return",{offerSdp:n,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("connect() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,r._pc.setRemoteDescription(n);case 3:t.close();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:gb.debug("updateIceServers()"),(n=this._pc.getConfiguration()).iceServers=t,this._pc.setConfiguration(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("restartIce()"),e.next=3,this.pc.createOffer({iceRestart:!0});case 3:return t=e.sent,e.abrupt("return",(gb.debug("restartIce() | calling pc.setLocalDescription() [offer:%o]",t),{offerSdp:t,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.info("restartIce() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,n._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getTransportStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._pc.getStats());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,s,c,u,l,d,f,v,m,g=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.track,r=t.encodings,i=t.codecOption,a=t.screenShare,this._assertSendDirection(),gb.debug("send() [kind:%s, track.id:%s]",n.kind,n.id),gb.debug("creating new transceiver"),c=this._pc.addTransceiver(n,{direction:"sendonly",streams:[a?this._sendScreenShareStream:this._sendWebStream],sendEncodings:r}),u=RTCRtpSender.getCapabilities(n.kind),gb.info("senders available params:",u),l=[],i&&(d=u.codecs.find((function(e){return e.mimeType.includes(i.name)})),i.parameters&&(gb.info("codecOption.parameters:",i.parameters),(f=(null==(s=d.sdpFmtpLine)?void 0:s.split(";"))||[]).push.apply(f,(0,o.Z)(i.parameters)),v=(0,o.Z)(new Set(f).values()),d.sdpFmtpLine
2=v.join(";")),l.push(d)),gb.info("selected codecs:",l),c.setCodecPreferences(l),e.next=9,this._pc.createOffer();case 9:if(m=e.sent,this._transportReady){e.next=12;break}throw new Error("webrtc transport not connected");case 12:return e.next=14,this._pc.setLocalDescription(m);case 14:return m.sdp=m.sdp.replace("minptime=10;useinbandfec=1","minptime=10;useinbandfec=1;usedtx=1;maxaveragebitrate=16000"),e.abrupt("return",{offerSdp:m,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("send() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,g._pc.setRemoteDescription(t);case 3:return g.midTransceiverMap.set(c.mid,c),e.abrupt("return",c.mid);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopSending",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),gb.debug("stopSending() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.sender.replaceTrack(null),this._pc.removeTrack(n.sender),n.direction="inactive",e.next=7,this._pc.createOffer();case 7:return r=e.sent,gb.debug("stopSending() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return e.abrupt("return",{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("stopSending() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,i._pc.setRemoteDescription(n);case 3:i.midTransceiverMap.delete(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),n?gb.debug("replaceTrack() [localId:%s, track.id:%s]",t,n.id):gb.debug("replaceTrack() [localId:%s, no track]",t),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.next=6,r.sender.replaceTrack(n);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),gb.debug("setMaxSpatialLayer() [localId:%s, spatialLayer:%s]",t,n),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");
2case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){e.active=t<=n})),e.next=8,r.sender.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertSendDirection(),gb.debug("setRtpEncodingParameters() [localId:%s, params:%o]",t,n),r=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return(i=r.sender.getParameters()).encodings.forEach((function(e,t){i.encodings[t]=(0,s.Z)((0,s.Z)({},e),n)})),e.next=8,r.sender.setParameters(i);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getSenderStats",value:function(e){this._assertSendDirection();var t=this.midTransceiverMap.get(e);if(!t)throw new Error("associated RTCRtpTransceiver not found");return t.sender.getStats()}},{key:"receive",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._assertRecvDirection(),gb.debug("recieve() | calling pc.setLocalDescription() [answer:%o]",t),n=this._pc.getTransceivers().at(-1),e.abrupt("return",(gb.info("Transceiver is now receiving",n,this._pc.getTransceivers()),this.midTransceiverMap.set(n.mid,n),{track:n.receiver.track,localId:n.mid}));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),gb.debug("stopReceiving() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",gb.info("active transcievers: %o",this._pc.getTransceivers()),e.next=7,this._pc.createOffer();case 7:return r=e.sent,gb.debug("stopRecieving() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return e.abrupt("return",{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("stopRecieving() | calling pc.setRemoteDescription() [answer:%o]",n),e.next=3,i._pc.setRemoteDescription(n);case 3:i.midTransceiverMap.delete(t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),gb.debug("pauseReceiving() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="inactive",e.next=7,this._pc.createOffer();case 7:return r=e.sent,gb.debug("pauseReceiving() | calling pc.setLocalDescription() [offer:%o]",r),e.next=11,this._pc.setLocalDescription(r);case 11:return e.abrupt("return",{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("pauseReceiving() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,i._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeReceiving",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),gb.debug("resumeReceiving() [localId:%s]",t),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return n.direction="recvonly",e.next=7,this._generateOffer();case 7:return r=e.sent,e.abrupt("return",(gb.debug("resumeReceiving() | calling pc.setLocalDescription() [offer:%o]",r),{offerSdp:r,callback:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("resumeReceiving() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,i._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getReceiverStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._assertRecvDirection(),n=this.midTransceiverMap.get(t)){e.next=4;break}throw new Error("associated RTCRtpTransceiver not found");case 4:return e.abrupt("return",n.receiver.getStats());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_assertSendDirection",value:function(){if("send"!==this._direction)throw new Error('method can just be called for handlers with "send" direction')}},{key:"_assertRecvDirection",value:function(){if("recv"!==this._direction)throw new Error('method can just be called for handlers with "recv" direction')}},{key:"_generateOffer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._pc.createOffer();case 2:return t=e.sent,e.next=5,this._pc.setLocalDescription(t);case 5:return e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_setAnswer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return gb.debug("_setAnswer() | calling pc.setRemoteDescription() [answer:%o]",t),e.next=3,this._pc.setRemoteDescription(t);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_addEventListeners",value:function(){var e=this;this._pc.addEventListener("iceconnectionstatechange",(function(){switch(e._pc.iceConnectionState){case"checking":e.emit("@connectionstatechange","connecting");break;case"connected":case"completed":e.emit("@connectionstatechange","connected"),e._transportReady=!0;break;case"failed":e.emit("@connectionstatechange","failed");break;case"disconnected":e.emit("@connectionstatechange","disconnected");break;case"closed":e.emit("@connectionstatechange","closed");break;default:gb.warn("unknown state")}})),this._pc.addEventListener("icecandidate",(function(t){t.candidate&&e.emit("@icecandidate",{candidate:t.candidate})})),this._pc.addEventListener("negotiationneeded",(function(){e.emit("@negotiationneeded",{}),gb.debug("negotiationneeded")})),this._pc.addEventListener("icegatheringstatechange",(function(){switch(e._pc.iceGatheringState){case"gathering":gb.debug("icegatheringstatechange | gathering"),e.emit("@icegatheringstatechange","gathering");break;case"complete":gb.debug("icegatheringstatechange | complete"),e.emit("@icegatheringstatechange","complete");break;default:gb.warn("unknown state")}})),this._pc.addEventListener("icecandidateerror",(function(e){gb.info("chrome74::icecandidateerror",e)})),this._pc.ondatachannel=function(t){gb.info("data channel created: ",t.channel.label);var n=t.channel;n.onopen=function(){gb.info("data channel open: ",t.channel.label)}
2,n.onclose=function(){gb.warn("data channel closed: ",t.channel.label)},n.onerror=function(e){gb.error("data channel error: ",t.channel.label,e)},n.onmessage=function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r){var i;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:gb.debug("data channel message: ",t.channel.label,r),i=String.fromCharCode.apply(null,new Uint8Array(r.data)),e.safeEmit("datachannel",t.channel,i);case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}}}],[{key:"createFactory",value:function(){return function(){return new n}}}]),n}(pb);var bb="transport closed",kb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,e)).name="UnsupportedError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace((0,f.Z)(r),n):r.stack=new Error(e).stack,r}return(0,y.Z)(n)}((0,a.Z)(Error)),_b=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),(r=t.call(this,e)).name="InvalidStateError",Error.hasOwnProperty("captureStackTrace")?Error.captureStackTrace((0,f.Z)(r),n):r.stack=new Error(e).stack,r}return(0,y.Z)(n)}((0,a.Z)(Error)),wb=ub.getLogger("Producer"),xb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.id,a=e.localId,o=e.track,s=e.stopTracks,c=e.disableTrackOnPause,u=e.zeroRtpOnPause,l=e.handler,d=e.appData;return(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"_id"),Cs((0,f.Z)(r),"_localId"),Cs((0,f.Z)(r),"_closed",!1),Cs((0,f.Z)(r),"_handler"),Cs((0,f.Z)(r),"_track"),Cs((0,f.Z)(r),"_kind"),Cs((0,f.Z)(r),"_paused"),Cs((0,f.Z)(r),"_maxSpatialLayer"),Cs((0,f.Z)(r),"_stopTracks"),Cs((0,f.Z)(r),"_disableTrackOnPause"),Cs((0,f.Z)(r),"_zeroRtpOnPause"),Cs((0,f.Z)(r),"_appData"),Cs((0,f.Z)(r),"observer"),r._id=i,r._localId=a,r._track=o,r._kind=o.kind,r._paused=!!c&&!o.enabled,r._maxSpatialLayer=void 0,r._stopTracks=s,r._disableTrackOnPause=c,r._zeroRtpOnPause=u,r._appData=d||{},r._onTrackEnded=r._onTrackEnded.bind((0,f.Z)(r)),r._handler=l,r.observer=new db,r._handleTrack(),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"localId",get:function(){return this._localId}},{key:"closed",get:function(){return this._closed}},{key:"kind",get:function(){return this._kind}},{key:"track",get:function(){return this._track}},{key:"paused",get:function(){return this._paused}},{key:"maxSpatialLayer",get:function(){return this._maxSpatialLayer}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"close",value:function(e){var t=this;if(!this._closed){if(wb.debug("close() with reason:",e),this._closed=!0,this._destroyTrack(),e===bb)return void this.observer.emit("close");this._handler.stopSending(this.localId).then((function(n){var r=n.offerSdp,i=n.callback;t.safeEmit("close",r,i,e)})).finally((function(){t.observer.emit("close")}))}}},{key:"getStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new _b("closed");case 2:return e.abrupt("return",this._handler.getSenderStats(this.localId));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pause",value:function(){wb.debug("producer(".concat(this.id,"):pause()")),this._closed&&wb.error("pause() | Producer closed"),this._paused=!0,this._track&&this._disableTrackOnPause&&(this._track.enabled=!1),this._zeroRtpOnPause&&this._handler.replaceTrack(this.localId,null),this.observer.emit("pause")}},{key:"resume",value:function(){wb.debug("producer(".concat(this.id,"):resume()")),this._closed?wb.error("resume() | Producer closed"):(this._paused=!1,this._track&&this._disableTrackOnPause&&(this._track.enabled=!0),this._zeroRtpOnPause&&this._handler.replaceTrack(this.localId,this._track),this.observer.emit("resume"))}},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.track,wb.debug("replaceTrack() [track:%o]",n),!this._closed){e.next=6;break}if(n&&this._stopTracks)try{n.stop()}catch(r){wb.error(r)}throw new _b("closed");case 6:if(!n||"ended"!==n.readyState){e.next=8;break}throw new _b("track ended");case 8:if(n!==this._track){e.next=11;break}return wb.debug("replaceTrack() | same track, ignored"),e.abrupt("return");case 11:if(e.t0=!this._zeroRtpOnPause||!this._paused,!e.t0){e.next=15;break}return e.next=15,this._handler.replaceTrack(this.localId,n);case 15:this._destroyTrack(),this._track=n,this._track&&this._disableTrackOnPause&&(this._paused?this._paused&&(this._track.enabled=!1):this._track.enabled=!0),this._handleTrack();case 19:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setMaxSpatialLayer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new _b("closed");case 2:if("video"===this._kind){e.next=4;break}throw new kb("not a video Producer");case 4:if("number"==typeof t){e.next=6;break}
2throw new TypeError("invalid spatialLayer");case 6:return e.next=8,this._handler.setMaxSpatialLayer(this.localId,t);case 8:this._maxSpatialLayer=t;case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setRtpEncodingParameters",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new _b("closed");case 2:if("object"==typeof t){e.next=4;break}throw new TypeError("invalid params");case 4:return e.next=6,this._handler.setRtpEncodingParameters(this.localId,t);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_onTrackEnded",value:function(){wb.debug('track "ended" event'),this.observer.emit("trackended"),this.safeEmit("trackended",this.track.id)}},{key:"_handleTrack",value:function(){this._track&&this._track.addEventListener("ended",this._onTrackEnded)}},{key:"_destroyTrack",value:function(){if(this._track)try{this._track.removeEventListener("ended",this._onTrackEnded),this._stopTracks&&this._track.stop()}catch(e){wb.error(e)}}}]),n}(db),Sb=ub.getLogger("Consumer"),Eb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.id,a=e.localId,o=e.producerId,s=e.producingPeerId,c=e.handler,u=e.track,l=e.appData,d=e.paused;return(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"_id"),Cs((0,f.Z)(r),"_localId"),Cs((0,f.Z)(r),"_producerId"),Cs((0,f.Z)(r),"_closed",!1),Cs((0,f.Z)(r),"_handler"),Cs((0,f.Z)(r),"_track"),Cs((0,f.Z)(r),"_paused"),Cs((0,f.Z)(r),"_peerId"),Cs((0,f.Z)(r),"_appData"),Cs((0,f.Z)(r),"observer"),r._id=i,r._localId=a,r._handler=c,r._appData=l,r._peerId=s,r._producerId=o,r._onTrackEnded=r._onTrackEnded.bind((0,f.Z)(r)),r._track=u,r._paused=null!=d&&d,r.observer=new db,r._handleTrack(),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"peerId",get:function(){return this._peerId}},{key:"localId",get:function(){return this._localId}},{key:"producerId",get:function(){return this._producerId}},{key:"closed",get:function(){return this._closed}},{key:"kind",get:function(){return this._track.kind}},{key:"track",get:function(){return this._track}},{key:"paused",get:function(){return this._paused}},{key:"remotelyPaused",get:function(){return this.paused}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"close",value:function(e){this._closed||(Sb.debug("close() with reason:",e),this._closed=!0,this._destroyTrack(),this.emit("close",e),this.observer.safeEmit("close",e))}},{key:"getStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new _b("closed");case 2:return e.abrupt("return",this._handler.getReceiverStats(this.localId));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pause",value:function(){Sb.debug("consumer(".concat(this.id,"):pause()")),this._closed?Sb.error("pause() | Consumer closed"):(this._paused=!0,this._track.enabled=!1,this.observer.safeEmit("pause"))}},{key:"resume",value:function(){Sb.debug("consumer(".concat(this.id,"):resume()")),this._closed?Sb.error("resume() | Consumer closed"):(this._paused=!1,this._track.enabled=!0,this.observer.safeEmit("resume"))}},{key:"_onTrackEnded",value:function(){Sb.debug('track "ended" event'),this.safeEmit("trackended"),this.observer.safeEmit("trackended")}},{key:"_handleTrack",value:function(){this._track.addEventListener("ended",this._onTrackEnded)}},{key:"_destroyTrack",value:function(){try{this._track.removeEventListener("ended",this._onTrackEnded),this._track.stop()}catch(e){Sb.error(e)}}}]),n}(db),Tb=ub.getLogger("Transport"),Pb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r,i=e.id,a=e.direction,o=e.handlerFactory,s=e.iceServers,c=e.iceTransportPolicy,u=e.proprietaryConstraints,l=e.additionalSettings,d=e.appData;(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"_id"),Cs((0,f.Z)(r),"_serverId"),Cs((0,f.Z)(r),"_closed",!1),Cs((0,f.Z)(r),"_direction"),Cs((0,f.Z)(r),"_maxSctpMessageSize"),Cs((0,f.Z)(r),"_handler"),Cs((0,f.Z)(r),"_connectionState","new"),Cs((0,f.Z)(r),"_producers"),Cs((0,f.Z)(r),"_consumers"),Cs((0,f.Z)(r),"_datachannels"),Cs((0,f.Z)(r),"_connected",!1),Cs((0,f.Z)(r),"_transportConnectionPromise",null),Cs((0,f.Z)(r),"awaitQueue"),Cs((0,f.Z)(r),"observer"),Cs((0,f.Z)(r),"consumerTrackEvents"),Cs((0,f.Z)(r),"unknownTracksMap"),Cs((0,f.Z)(r),"_appData"),Cs((0,f.Z)(r),"datachannelCache",new Map),Tb.debug("constructor() [id: %s, direction: %s]",i,a),r._id=i,r._direction=a;var p=function(e,t){return"undefined"==typeof e?t:JSON.parse(JSON.stringify(e))}(l,{});return delete p.iceServers,delete p.iceTransportPolicy,delete p.bundlePolicy,delete p.rtcpMuxPolicy,delete p.sdpSemantics,r._producers=new Map,r._consumers=new Map,r._datachannels=new Map,r.consumerTrackEvents=new Map,r.unknownTracksMap=new Map,r.awaitQueue=new eo.Cg,r.observer=new db,r._handler=o(),r._handler.init({onTrackHandler:r._ontrack.bind((0,f.Z)(r)),direction:a,iceServers:s,iceTransportPolicy:c,additionalSettings:l,proprietaryConstraints:u}),r._appData=d||{},r._transportConnectionPromise=new Promise((function(e){r.observer.once("connected",(function(){e(!0)})),r.observer.once("disconnect",(function(){e(!1)})),r.observer.once("close",(function(){e(!1)}))})),r._handler.on("@connectionstatechange",(function(e){e!==r._connectionState&&(Tb.debug("connection state changed to %s",e),r._connectionState=e,"connected"===e&&(r._connected=!0,r.observer.emit("connected")),"disconnected"===e&&(r._connected=!1,r.observer.emit("disconnect")),("failed"===e||"closed"===e)&&(r._connected=!1,r.observer.emit("close")),r._closed||r.safeEmit("connectionstatechange",e))})),r._handler.on("@icecandidate",(function(e){var t=e.candidate;r._closed||r.safeEmit("icecandidate",t)})),r._handler.on("datachannel",(function(e,t){var n,i;r._datachannels.has(e.label)||r._datachannels.set(e.label,e);var a=JSON.parse(t);if(r.datachannelCache.has(a.id)||r.datachannelCache.set(a.id,[]),null==(n=r.datachannelCache.get(a.id))||n.push(a),(null==(i=r.datachannelCache.get(a.id))?void 0:i.length)===a.count){var o=r.datachannelCache.get(a.id),s=null==o?void 0:o.reduce((function(e,t){return e+t.chunk}),"");r.datachannelCache.delete(a.id);try{var c=JSON.parse(s);r.safeEmit("datachannel:".concat(e.label),e,c)}catch(c){Tb.error("error parsing message",c)}}})),r}return(0,y.Z)(n,[{key:"id",get:function(){return this._id}},{key:"serverId",get:function(){return this._serverId}},{key:"connected",get:function(){return this._connected}},{key:"isConnected",get:function(){return this._transportConnectionPromise}},{key:"datachannels",get:function(){return this._datachannels}},{key:"closed",get:function(){return this._closed}},{key:"direction",get:function(){return this._direction}},{key:"handler",get:function(){return this._handler}},{key:"connectionState",get:function(){return this._connectionState}},{key:"appData",get:function(){return this._appData},set:function(e){throw new Error("cannot override appData object")}},{key:"setServerId",value:function(e){this._serverId=e}},{key:"getDatachannel",value:function(e){return this._datachannels.get(e)}},{key:"close",value:function(){this._closed||(Tb.debug("close()"),this._connected=!1,this._closed=!0,this._handler.close(),(0,o.Z)(this._producers.values()).forEac
2h((function(e){return e.close(bb)})),this._producers.clear(),(0,o.Z)(this._consumers.values()).forEach((function(e){return e.close(bb)})),this._consumers.clear(),this.emit("close"),this.observer.emit("close"))}},{key:"getStats",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._closed){e.next=2;break}throw new _b("closed");case 2:return e.abrupt("return",this._handler.getTransportStats());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._handler.connect();case 3:return t=e.sent,n=t.offerSdp,r=t.callback,e.next=8,this.safeEmitAsPromise("connect",{offer:n});case 8:return i=e.sent,a=i.answer,e.next=12,r(a);case 12:return e.next=14,this.isConnected;case 14:if(e.sent){e.next=16;break}throw new Error("ice connection failed");case 16:e.next=21;break;case 18:throw e.prev=18,e.t0=e.catch(0),Tb.error("transport failed to connect:",e.t0),e.t0;case 21:case"end":return e.stop()}}),e,this,[[0,18]])})));return function(){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Tb.debug("restartIce()"),!this._closed){e.next=2;break}throw new _b("closed");case 2:return e.abrupt("return",this._handler.restartIce());case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"updateIceServers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(n.length>0&&void 0!==n[0]?n[0]:{}).iceServers,Tb.debug("updateIceServers()"),!this._closed){e.next=3;break}throw new _b("closed");case 3:this._handler.updateIceServers(t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"produce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c,u,l,d,f,v,m,g,y,b=this,k=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(t=k.length>0&&void 0!==k[0]?k[0]:{}).track,r=t.encodings,i=t.codecOptions,a=t.stopTracks,o=void 0===a||a,s=t.disableTrackOnPause,c=void 0===s||s,u=t.zeroRtpOnPause,l=void 0!==u&&u,d=t.appData,f=void 0===d?{}:d,Tb.debug("produce() [track:".concat(n.id,"]")),!n){e.next=14;break}if("send"===this._direction){e.next=4;break}throw new kb("not a sending Transport");case 4:if("ended"!==n.readyState){e.next=6;break}throw new _b("track ended");case 6:if(0!==this.listenerCount("connect")||"new"!==this._connectionState){e.next=8;break}throw new TypeError('no "connect" listener set into this transport');case 8:if(0!==this.listenerCount("produce")){e.next=10;break}throw new TypeError('no "produce" listener set into this transport');case 10:if(!f||"object"==typeof f){e.next=12;break}throw new TypeError("if given, appData must be an object");case 12:e.next=15;break;case 14:throw new TypeError("missing track");case 15:return e.next=17,this.isConnected;case 17:if(e.sent){e.next=19;break}return e.abrupt("return",Promise.reject(new Error("Transport not connected")));case 19:return e.next=21,this.awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){var t,a,o,s,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b._handler.send({track:n,encodings:r,codecOption:i,screenShare:null==f?void 0:f.screenShare});case 2:return t=e.sent,a=t.offerSdp,o=t.callback,e.next=7,b.safeEmitAsPromise("produce",{offer:a,kind:n.kind,paused:!!c&&!n.enabled,appData:f});case 7:return s=e.sent,u=s.answer,l=s.producerId,e.next=12,o(u);case 12:return d=e.sent,e.abrupt("return",{producerId:l,localId:d});case 14:case"end":return e.stop()}}),e)}))));case 21:return v=e.sent,m=v.producerId,g=v.localId,y=new xb({id:m,localId:g,track:n,stopTracks:o,disableTrackOnPause:c,zeroRtpOnPause:l,appData:f,handler:this.handler}),e.abrupt("return",(this._producers.set(m,y),y.observer.on("close",(function(){b._producers.delete(y.id)}
2)),this.emit("newproducer",y),this.observer.emit("newproducer",y),y));case 26:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"consumePeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o=this,s=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:{},Tb.debug("consumePeer() producingPeerId:",t),!this._closed){e.next=3;break}throw new _b("closed");case 3:if("recv"===this._direction){e.next=5;break}throw new kb("not a receiving Transport");case 5:if("string"==typeof t){e.next=7;break}throw new TypeError("missing producingPeerId");case 7:if(0!==this.listenerCount("connect")||"new"!==this._connectionState){e.next=9;break}throw new TypeError('no "connect" listener set into this transport');case 9:if(!n||"object"==typeof n){e.next=11;break}throw new TypeError("if given, appData must be an object");case 11:return e.next=13,this.isConnected;case 13:if(e.sent){e.next=15;break}return e.abrupt("return",Promise.reject(new Error("Transport not connected")));case 15:return r=[],e.next=18,this.safeEmitAsPromise("consumePeer",{producingPeerId:t});case 18:return i=e.sent,a=i.consumersMap,e.abrupt("return",(a.forEach((function(e,i){var a=e.consumerId,s=e.trackId,c=e.screenShare,u=e.paused,l=e.streamId,d=e.kind;r.push(o._consumerCreationTask({consumerId:a,trackId:s,streamId:l,kind:d,producerId:i,producingPeerId:t,paused:u,screenShare:c,appData:n}))})),Tb.info("promises",r),Promise.allSettled(r)));case 21:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"consume",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.producerId,r=t.producingPeerId,i=t.appData,a=void 0===i?{}:i,Tb.debug("consume()"),!this._closed){e.next=3;break}throw new _b("closed");case 3:if("recv"===this._direction){e.next=5;break}throw new kb("not a receiving Transport");case 5:if("string"==typeof n){e.next=7;break}throw new TypeError("missing producerId");case 7:if(0!==this.listenerCount("connect")||"new"!==this._connectionState){e.next=9;break}throw new TypeError('no "connect" listener set into this transport');case 9:if(!a||"object"==typeof a){e.next=11;break}throw new TypeError("if given, appData must be an object");case 11:return e.next=13,this.isConnected;case 13:if(e.sent){e.next=15;break}return e.abrupt("return",Promise.reject(new Error("Transport not connected")));case 15:return e.prev=15,e.next=18,this.safeEmitAsPromise("consume",{producerId:n,producingPeerId:r});case 18:return o=e.sent,s=o.consumerId,c=o.screenShare,u=o.trackId,l=o.paused,d=o.streamId,h=o.kind,e.abrupt("return",this._consumerCreationTask({consumerId:s,screenShare:c,trackId:u,streamId:d,kind:h,paused:l,producerId:n,producingPeerId:r,appData:a}));case 28:throw e.prev=28,e.t0=e.catch(15),Tb.error("consume failed:",e.t0),e.t0;case 31:case"end":return e.stop()}}),e,this,[[15,28]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_consumerCreationTask",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,c,u,l,d,f,v,m=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.consumerId,r=t.producerId,i=t.producingPeerId,a=t.streamId,o=t.trackId,c=t.paused,u=t.screenShare,l=t.appData,d=t.kind,f="".concat(a,":").concat(d),v={consumerId:n,producerId:r,producingPeerId:i,streamId:a,trackId:o,appData:l,kind:d,paused:c,screenShare:u,name:"consumer creation task error",message:"consumer creation failed"},e.abrupt("return",new Promise((function(e,t){var a=setTimeout((function(){m.consumerTrackEvents.delete(f),v.isTimedout=!0,m.consumerTrackEvents.delete(f),t(v)}),5e3),d=function(){var d=(0,h.Z)((0,p.Z)().mark((function d(h){var f,g;return(0,p.Z)().wrap((function(d){for(;;)switch(d.prev=d.next){case 0:try{"ended"===h.track.readyState?(clearTimeout(a),t(v)):(f=h.transceiver,m.handler.midTransceiverMap.set(f.mid,f),g=new Eb({id:n,localId:h.transceiver.mid,track:h.track,paused:c,producerId:r,producingPeerId:i,handler:m._handler,appData:(0,s.Z)((0,s.Z)({},l),{},{screenShare:u})}),m._consumers.set(n,g),g.once("close",(function(){m._consumers.delete(g.id),m.handler.midTransceiverMap.delete(f.mid)})),Tb.info("consumer created for ",{producerId:r,trackId:o,producingPeerId:i}),m.observer.emit("newconsumer",g),clearTimeout(a),e(g))}catch(f){Tb.warn("error while creating consumer:",f),clearTimeout(a),t(v)}case 1:case"end":return d.stop()}}),d)})));return function(e){return d.apply(this,arguments)}}(),g=m.unknownTracksMap.get(f);g?(m.unknownTracksMap.delete(f),d(g)):m.consumerTrackEvents.set(f,d)})));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"_ontrack",value:function(e){Tb.info("track event received",e);var t="".concat(e.streams[0].id,":").concat(e.track.kind),n=this.consumerTrackEvents.get(t);n?(n(e),this.consumerTrackEvents.delete(t)):(Tb.warn("track event handler not found ".concat(t)),this.unknownTracksMap.set(t,e))}},{key:"setRemoteDescription",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._handler.pc.setRemoteDescription(t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setLocalDescription",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Tb.debug("".concat(this.direction,"() {transportId: ").concat(this.serverId,"} | calling pc.setLocalDescription() [offer:%o]"),t),e.next=3,this._handler.pc.setLocalDescription(t);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setRemoteOffer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setRemoteDescription(t);case 2:return e.next=4,this._handler.pc.createAnswer();case 4:return n=e.sent,(r=A.Qc(n.sdp)).media=r.media.map((function(e){if("audio"===e.type){var t=(0,s.Z)({},e);return t.rtcpFb||(t.rtcpFb=[]),t.rtcpFb.some((function(e){return"nack"===e.type}))||t.rtcpFb.push({payload:parseInt(t.payloads,10),type:"nack"}),t}return e})),n.sdp=A.cW(r),e.next=10,this.setLocalDescription(n);case 10:return e.abrupt("return",n);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"retryFailedConsumerCreationTasks",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.allSettled(t.map((function(e){return Tb.warn("retrying failed consumer creation task",e),n._consumerCreationTask((0,s.Z)({},e))}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(db);function Cb(e){return"name"in e&&"consumer creation task error"===e.name}var Rb=ub.getLogger("Device");var Zb,Mb=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.handlerName,r=t.handlerFactory;if((0,g.Z)(this,e),Cs(this,"_handlerFactory"),Cs(this,"_handlerName"),Cs(this,"_observer"),Rb.debug("constructor()"),n&&r)throw new TypeError("just one of handlerName or handlerInterface can be given");if(r)this._handlerFactory=r;else{if(n)Rb.debug("constructor() | handler given: %s",n);else{if(n=function(){if("object"==typeof navigator&&"ReactNative"===navigator.product)return"undefined"==typeof RTCPeerConnection?void Rb.warn("this._detectDevice() | unsupported ReactNative without RTCPeerConnection"):(Rb.debug("this._detectDevice() | ReactNative handler chosen"),"ReactNative");if("object"!=typeof navigator||"string"!=typeof navigator.userAgent)Rb.warn("this._detectDevice() | unknown device");else{var e=navigator.userAgent,t=M().getParser(e),n=t.getEngine();if(t.satisfies({chrome:">=74",chromium:">=74","microsoft edge":">=88"}))return"Chrome74";if(t.satisfies({chrome:">=70",chromium:">=70"}))return"Chrome70";if(t.satisfies({chrome:">=67",chromium:">=67"}))return"Chrome67";if(t.satisfies({chrome:">=55",chromium:">=55"}))return"Chrome55";if(t.satisfies({firefox:">=60"}))return"Firefox60";if(t.satisfies({ios:{OS:">=14.3",firefox:">=30.0"}})||t.satisfies({safari:">=12.0"})&&"undefined"!=typeof RTCRtpTransceiver&&RTCRtpTransceiver.prototype.hasOwnProperty("currentDirection"))return"Safari12";if(t.satisfies({safari:">=11"}))return"Safari11";if(t.satisfies({"microsoft edge":">=11"})&&t.satisfies({"microsoft edge":"<=18"}))return"Edge11";if(n.name&&"blink"===n.name.toLowerCase()){var r=e.match(/(?:(?:Chrome|Chromium))[ /](\w+)/i);if(r){var i=Number(r[1]);return i>=74?"Chrome74":i>=70?"Chrome70":i>=67?"Chrome67":"Chrome55"}return"Chrome74"}Rb.warn("this._detectDevice() | browser not supported [name:%s, version:%s]",t.getBrowserName(),t.getBrowserVersion())}}(),!n)throw new Error("device not supported");Rb.debug("constructor() | detected handler: %s",n)}switch(n){case"Chrome74":this._handlerFactory=fb.createFactory();break;case"Safari12":this._handlerFactory=yb.createFactory();break;case"Firefox60":this._handlerFactory=mb.createFactory();break;default:throw new TypeError('unknown handlerName "'.concat(n,'"'))}}var i=this._handlerFactory();this._handlerName=i.name,i.close(),this._observer=new Ns}return(0,y.Z)(e,[{key:"handlerName",get:function(){return this._handlerName}},{key:"createSendTransport",value:function(e){var t=e.iceServers,n=e.iceTransportPolicy,r=e.additionalSettings,i=e.proprietaryConstraints,a=e.appData;return Rb.debug("createSendTransport()"),this._createTransport({direction:"send",iceServers:t,iceTransportPolicy:n,additionalSettings:r,proprietaryConstraints:i,appData:a})}},{key:"createRecvTransport",value:function(e){var t=e.iceServers,n=e.iceTransportPolicy,r=e.additionalSettings,i=e.proprietaryConstraints,a=e.appData;return Rb.debug("createRecvTransport()"),this._createTransport({direction:"recv",iceServers:t,iceTransportPolicy:n,additionalSettings:r,proprietaryConstraints:i,appData:a})}},{key:"_createTransport",value:function(e){var t=e.direction,n=e.iceServers,r=e.iceTransportPolicy,i=e.additionalSettings,a=e.proprietaryConstraints,o=e.appData,s=P(),c=new Pb({id:s,direction:t,iceServers:n,iceTransportPolicy:r,additionalSettings:i,proprietaryConstraints:a,appData:o,handlerFactory:this._handlerFactory});return Rb.info("transport created",c),this._observer.emit("newtransport",c),c}}]),e}(),Ab=function(){function e(t){(0,g.Z)(this,e),Ms(this,Zb,void 0),As(this,Zb,t)}return(0,y.Z)(e,[{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={roomUuid:t,displayName:n,prejoined:!1},e.next=3,Zs(this,Zb).sendMessagePromise(ob.joinRoom,ym.toBinary(r));case 3:return e.abrupt("return",e.sent.payload);case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"connectTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Zb).sendMessagePromise(ob.createWebRTCTransport,lm.toBinary(t));case 2:return n=e.sent.payload,r=dm.fromBinary(n),i=r.transportId,a=r.description,o={sdp:null==a?void 0:a.sdp,type:a.type},e.abrupt("return",{transportId:i,answer:o});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"produce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Zb).sendMessagePromise(ob.produce,wm.toBinary(t));case 2:return i=e.sent.payload,a=Vm.fromBinary(i),e.abrupt("return",{answer:{sdp:null==(n=null==a?void 0:a.description)?void 0:n.sdp,type:null==(r=null==a?void 0:a.description)?void 0:r.type},producerId:a.producerId});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"consume",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Zb).sendMessagePromise(ob.consume,_m.toBinary(t));case 2:return n=e.sent.payload,r=Um.fromBinary(n),i=r.consumerIdsMap.map,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"closeProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Zb).sendMessagePromise(ob.closeProducer,Tm.toBinary(t));case 2:return n=e.sent.payload,r=Fm.fromBinary(n),i=r.description,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"closeConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Zb).sendMessagePromise(ob.closeConsumer,Pm.toBinary(t));case 2:return e.abrupt("return",e.sent.payload);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"hostControlForPeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={audio:"audio"===n,screeShare:!1,video:"video"===n,participantId:t},e.next=3,Zs(this,Zb).sendMessagePromise(ob.hostControlPeer,Mm.toBinary(r));case 3:if(i=e.sent.payload){e.next=6;break}return e.abrupt("return",!1);case 6:return a=qm.fromBinary(i),o=a.status,e.abrupt("return","success"===o);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"hostControlForAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={audio:"audio"===t,screenShare:!1,video:"video"===t},e.next=3,Zs(this,Zb).sendMessagePromise(ob.hostControlAllPeers,Am.toBinary(n));case 3:if(r=e.sent.payload){e.next=6;break}return e.abrupt("return",!1);case 6:return i=Gm.fromBinary(r),a=i.status,e.abrupt("return","success"===a);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"kickAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},e.next=3,Zs(this,Zb).sendMessagePromise(ob.kickAll,Rm.toBinary(t));case 3:if(n=e.sent.payload){e.next=6;break}return e.abrupt("return",!1);case 6:return r=Hm.fromBinary(n),i=r.status,e.abrupt("return","success"===i);case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"kickPeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Zb).sendMessagePromise(ob.kickPeer,Cm.toBinary(t));case 2:if(n=e.sent.payload){e.next=5;break}return e.abrupt("return",!1);case 5:return r=zm.fromBinary(n),i=r.status,e.abrupt("return","success"===i);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"changeDisplayName",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Zb).sendMessagePromise(ob.changeDisplayName,Zm.toBinary(t));case 2:if(n=e.sent.payload){e.next=5;break}return e.abrupt("return",!1);case 5:return r=Wm.fromBinary(n),i=r.status,e.abrupt("return","success"===i);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"notifySelfJoinComplete",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},e.next=3,Zs(this,Zb).sendMessagePromise(ob.selfJoinComplete,bm.toBinary(t
2));case 3:return n=e.sent.payload,e.abrupt("return",jm.fromBinary(n));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();Zb=new WeakMap;var Ib,Ob,Lb,Db,Nb,jb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"_device"),Cs((0,f.Z)(r),"_sendTransport"),Cs((0,f.Z)(r),"_recvTransport"),Cs((0,f.Z)(r),"_consumers"),Cs((0,f.Z)(r),"_producers"),Cs((0,f.Z)(r),"_producerIdToConsumerIdMap"),Cs((0,f.Z)(r),"_logger"),Cs((0,f.Z)(r),"_socket"),Cs((0,f.Z)(r),"_socketHandler"),Cs((0,f.Z)(r),"transportConnectionStatus"),r._producers=new Map,r._consumers=new Map,r._producerIdToConsumerIdMap=new Map,r.transportConnectionStatus=new Map,r._device=new Mb,r._logger=ub.getLogger("HiveSFUHandler"),r._socket=e,r._socketHandler=new Ab(e),r}return(0,y.Z)(n,[{key:"socket",get:function(){return this._socket}},{key:"producers",get:function(){return this._producers}},{key:"consumers",get:function(){return this._consumers}},{key:"producerIdToConsumerIdMap",get:function(){return this._producerIdToConsumerIdMap}},{key:"hiveSocketHandler",get:function(){return this._socketHandler}},{key:"setupTransports",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy().getICEServers();case 2:return n=e.sent,r=t.map((function(e){var t=i.transportConnectionStatus.get(e);if(t)return t;switch(e){case"send":var r=i.createSendTransport({iceServers:n});return i.transportConnectionStatus.set(e,r),r;case"recv":var a=i.createRecvTransport({iceServers:n});return i.transportConnectionStatus.set(e,a),a;default:return i._logger.warn("what are you thinking when passing this ".concat(e,"?")),Promise.reject(Error("TYPE_OF_TRANSPORT_UNKNOWN"))}})),e.next=6,Promise.all(r).finally((function(){t.forEach((function(e){i.transportConnectionStatus.delete(e)}))}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopAllTransports",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._logger.info("closing all the transports"),null==(t=this._sendTransport)||t.close(),null==(n=this._recvTransport)||n.close(),this._sendTransport=void 0,this._recvTransport=void 0;case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"createSendTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._sendTransport||!this._sendTransport.connected){e.next=2;break}return e.abrupt("return");case 2:return this._logger.info("sendTransport::initializing_transport"),n=this._device.createSendTransport(t),this._logger.info("sendTransport::initialized_transport"),this.handleTransport(n,!1),this._logger.info("sendTransport::connecting_transport"),e.prev=5,e.next=8,n.connect();case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(5),this._logger.error("fail to connect send transport:",n.id,"[Error]:",e.t0,"retrying once."),e.next=15,n.connect().catch((function(e){r._logger.error("failed to connect send transport after retry:",n.id,"[Error]:",e)}));case 15:this._logger.info("sendTransport::connected_transport"),this._sendTransport=n,Ic.onSafeInitialization((function(){Ic.configureSendTransport(n)})),Object.assign(window,{sendTransport:n});case 16:case"end":return e.stop()}}),e,this,[[5,10]])})));return function(t){return e.apply(this,arguments)}}()},{key:"createRecvTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._recvTransport||!this._recvTransport.connected){e.next=2;break}return e.abrupt("return");case 2:return this._logger.info("recvTransport::initializing_transport"),n=this._device.createRecvTransport((0,s.Z)((0,s.Z)({},t),{},{additionalSettings:{rtcAudioJitterBufferMaxPackets:25,rtcAudioJitterBufferFastAccelerate:!0,rtcAudioJitterBufferMinDelayMs:20}})),Ic.onSafeInitialization((function(){Ic.configureRecvTransport(n)})),this._logger.info("recvTransport::initialized_transport"),this.handleTrans
2port(n,!0),this._logger.info("recvTransport::connecting_transport"),e.prev=5,e.next=8,n.connect();case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(5),this._logger.error("fail to connect recv transport:",n.id,"[Error]:",e.t0,"retrying once."),e.next=15,n.connect().catch((function(e){r._logger.error("failed to connect recv transport after retry:",n.id,"[Error]:",e)}));case 15:this._logger.info("recvTransport::connected_transport"),this._recvTransport=n,this.producerIdToConsumerIdMap.clear();case 16:case"end":return e.stop()}}),e,this,[[5,10]])})));return function(t){return e.apply(this,arguments)}}()},{key:"handleTransport",value:function(e,t){var n=this;e.on("connect",function(){var r=(0,h.Z)((0,p.Z)().mark((function r(i,a,o){var s,c,u,l,d;return(0,p.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=i.offer,r.prev=1,c={consuming:t,description:{sdp:s.sdp,type:s.type,target:t?am.SUBSCRIBER:am.PUBLISHER}},r.next=5,n._socketHandler.connectTransport(c);case 5:u=r.sent,l=u.transportId,d=u.answer,e.setServerId(l),a({answer:d}),r.next=14;break;case 11:r.prev=11,r.t0=r.catch(1),n._logger.error("".concat(t?"consumer":"producer"," transport connection error:"),r.t0),o(r.t0);case 14:case"end":return r.stop()}}),r,null,[[1,11]])})));return function(e,t,n){return r.apply(this,arguments)}}()),e.on("connectionstatechange",function(){var r=(0,h.Z)((0,p.Z)().mark((function r(i){return(0,p.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=(n._logger.info("".concat(t?"consumer":"producer"," transport connectionState:"),i),i),r.next="failed"===r.t0||"disconnected"===r.t0?3:"new"===r.t0||"closed"===r.t0?7:8;break;case 3:if(!e.closed){r.next=5;break}return r.abrupt("return");case 5:return n._logger.info("".concat(t?"consumer":"producer"," transport disconnected or failed, reconnecting...")),jc.hasFeature(Ff)?(sm.emit(cm.HIVE_TRANSPORT_STATE_CHANGED,{state:"reconnecting",transportDirection:t?"recv":"send"}),n.emit("reconnect_transport",e)):sm.emit(cm.HIVE_TRANSPORT_STATE_CHANGED,{state:i,transportDirection:t?"recv":"send"}),r.abrupt("break",10);case 7:return r.abrupt("break",10);case 8:return sm.emit(cm.HIVE_TRANSPORT_STATE_CHANGED,{state:i,transportDirection:t?"recv":"send"}),r.abrupt("break",10);case 10:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()),e.on("icecandidate",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n._logger.debug("sending icecandidate:",t.toJSON());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.on("datachannel:events",function(){var t=(0,h.Z)((0,p.Z)().mark((function t(r,i){var a,o,s,c,u,l,d;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n._logger.debug("got data channel message on event:",i),t.prev=1,t.t0=i.type,t.next="offer"===t.t0?5:"consumer_toggle"===t.t0?18:26;break;case 5:return a={sdp:i.payload.sdp,type:"offer"},t.prev=6,t.next=9,e.setRemoteOffer(a);case 9:s=t.sent,o={type:"answer",payload:{type:s.type,sdp:s.sdp}},t.next=16;break;case 13:t.prev=13,t.t1=t.catch(6),n._logger.error("datachannel:events::Error:",t.t1),o={type:"error",payload:{error:t.t1.message}};case 16:return n._logger.debug("datachannel answer:",o),r.send(JSON.stringify(o)),t.abrupt("break",28);case 18:if(c=i.payload,u=c.mute,l=c.trackId,n._logger.info("consumer toggled for",l,"muted:",u),d=n.consumers.get(l)){t.next=24;break}return n._logger.warn("consumer with id",l," not found"),t.abrupt("return");case 24:return d.paused!==u&&(n._logger.debug("consumer state is not same",{consumerPaused:d.paused,mute:u}),u?(d.pause(),sm.emit(cm.CONSUMER_PAUSED,{id:d.id})):(d.resume(),sm.emit(cm.CONSUMER_RESUMED,{id:d.id}))),t.abrupt("break",28);case 26:return n._logger.warn("unknown event received from hive node, event:",i.type),t.abrupt("break",28);case 28:t.next=33;break;case 30:t.prev=30,t.t2=t.catch(1),n._logger.error("Unable to handle the incoming datachannel message on",r.label);case 33:case"end":return t.stop()}}),t,null,[[1,30],[6,13]])})));return function(e,n){return t.apply(this,arguments)}}()),e.on("negotiate",function(){var t=(0,h.Z)((0,p.Z)().mark((function t(r,i,a){var o,s,c;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.description,t.prev=1,s={sdp:null==o?void 0:o.sdp,type:null==o?void 0:o.type},t.next=5,n.negotiate(e,s);case 5:c=t.sent,i({answer:c}),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),n._logger.error("negotiate error:",t.t0),a(t.t0);case 12:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,n,r){return t.apply(this,arguments)}}()),e.on("close",(function(){n._logger.info("".concat(t?"consumer":"producer"," transport closed"),e.id),t?n._recvTransport=void 0:n._sendTransport=void 0})),t?(e.on("datachannel:negotiation",function(){var t=(0,h.Z)((0,p.Z)().mark((function t(r,i){var a,o;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n._logger.info("datachannel message recieved:",r.label,i),a={sdp:i,type:"offer"},t.next=5,e.setRemoteOffer(a);case 5:o=t.sent,n._logger.info("datachannel answer:",o),r.send(o.sdp),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),n._logger.error("datachannel:negotiation::Error:",t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(e,n){return t.apply(this,arguments)}}()),e.on("consumePeer",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,r,i){var a,o,s,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.producingPeerId,n._logger.info("consumePeer:",a),o={producingPeerId:a},e.prev=3,e.next=6,n._socketHandler.consume(o);case 6:s=e.sent,n._logger.debug("consumePeer response for ".concat(a,":"),{consumerStateMap:s}
2),c=new Map,Object.entries(s).forEach((function(e){var t,n,r,i=(0,d.Z)(e,2),a=i[0],o=i[1];c.set(a,{consumerId:o.consumerId,trackId:null==(t=o.producerTrack)?void 0:t.trackId,streamId:o.producerTrack.streamId,kind:o.producerState.kind===om.VIDEO?"video":"audio",screenShare:null==(n=o.producerState)?void 0:n.screenShare,paused:null==(r=o.producerState)?void 0:r.pause})})),r({consumersMap:c}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),n._logger.error("consumePeer error:",e.t0),i(e.t0);case 15:case"end":return e.stop()}}),e,null,[[3,12]])})));return function(t,n,r){return e.apply(this,arguments)}}()),e.on("consume",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,r,i){var a,o,s,c,u,l,d,h;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.producerId,o=t.producingPeerId,d={producingPeerId:o,producerId:a},e.prev=2,e.next=5,n._socketHandler.consume(d);case 5:e.t0=a,h=e.sent[e.t0],n._logger.info("consumer create response:",{consumerState:h,paused:null==(s=h.producerState)?void 0:s.pause}),r({consumerId:h.consumerId,screenShare:null==(c=h.producerState)?void 0:c.screenShare,trackId:null==(u=h.producerTrack)?void 0:u.trackId,streamId:h.producerTrack.streamId,kind:h.producerState.kind===om.VIDEO?"video":"audio",paused:null==(l=h.producerState)?void 0:l.pause}),e.next=13;break;case 10:e.prev=10,e.t1=e.catch(2),n._logger.error("error during consuming on server:",e.t1),i(e.t1);case 13:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,n,r){return e.apply(this,arguments)}}())):e.on("produce",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,r,i){var a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t.offer,o=t.kind,s=t.paused,c=t.appData,l=A.Qc(a.sdp).media.filter((function(e){return"video"===o?"video"===e.type:"audio"===e.type})).at(-1).msid,d={description:{sdp:a.sdp,type:a.type,target:am.PUBLISHER},paused:s,kind:o,msid:l,screenShare:null!=(u=c.screenShare)&&u},e.prev=2,e.next=5,n._socketHandler.produce(d);case 5:h=e.sent,f=h.answer,v=h.producerId,r({answer:f,producerId:v}),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),n._logger.error("create producer error:",e.t0),i(e.t0);case 14:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t,n,r){return e.apply(this,arguments)}}())}},{key:"createProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this._sendTransport&&!this._sendTransport.closed){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this._sendTransport.produce(n);case 4:(i=e.sent).on("close",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n,o,s){var c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a._logger.info("producer id:",i.id,"closed with reason:",s),c={producerId:i.id,description:{sdp:n.sdp,type:n.type,target:am.PUBLISHER}},e.prev=2,e.next=5,a._socketHandler.closeProducer(c);case 5:u=e.sent,a._logger.info("response",u),l={sdp:null==u?void 0:u.sdp,type:null==u?void 0:u.type},o(l),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),a._logger.error("producer close error:",e.t0);case 14:a._producers.delete(t),r(),t===wf.SCREENSHARE_VIDEO&&a._switchWebcamLayers(3);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t,n,r){return e.apply(this,arguments)}}()),i.on("trackended",(function(){Dv.info("producer::trackended",{producer:{id:null==i?void 0:i.id,kind:t,status:"UNKNOWN",appData:null==i?void 0:i.appData}}),[wf.MIC,wf.WEBCAM].includes(t)||r()})),this._producers.set(t,i),this._producers.has(wf.SCREENSHARE_VIDEO)&&this._switchWebcamLayers(0);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_switchWebcamLayers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this._producers.get(wf.WEBCAM))){e.next=11;break}return e.prev=2,this._logger.debug("switching layer of webcam producer to:",t),e.next=6,n.setMaxSpatialLayer(t);case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),this._logger.error("failed to switch spatial layer",e.t0);case 11:case"end":return e.stop()}}),e,this,[[2,8]])})));return function(t){return e.apply(this,arguments)}}()}
2,{key:"_initConsumer",value:function(e){var t=this;e&&(e.observer.on("close",function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r){return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t._logger.debug("consumer closed",r),t._consumers.delete(e.id),sm.emit(cm.CONSUMER_CLOSED,{id:e.id});case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()),this._consumers.set(e.id,e),this.producerIdToConsumerIdMap.set(e.producerId,e.id),sm.emit(cm.NEW_CONSUMER,{id:e.id}))}},{key:"consumePeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this._recvTransport&&!this._recvTransport.closed&&this._recvTransport.connected){e.next=2;break}throw Error("Receiving transport not connected");case 2:return e.prev=2,e.next=5,this._recvTransport.consumePeer(t);case 5:n=e.sent,r=[],n.forEach((function(e){"rejected"===e.status?r.push(e.reason):i._initConsumer(e.value)})),this._recvTransport.retryFailedConsumerCreationTasks(r).then((function(e){e.forEach((function(e){"rejected"===e.status?i._logger.error("consumer creation failed 2nd time, this should never happen second time.",e.reason):i._initConsumer(e.value)}))})),e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(2),this._logger.error("got error in consumePeer",e.t0),e.t0;case 13:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t){return e.apply(this,arguments)}}()},{key:"createConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this._recvTransport&&!this._recvTransport.closed&&this._recvTransport.connected){e.next=2;break}return e.abrupt("return");case 2:if(n=t.producerId,r=t.producingPeerId,i=t.appData,!this.getProducer(n)){e.next=6;break}return this._logger.warn("why are you creating a consumer for local producer?"),e.abrupt("return");case 6:return e.prev=6,e.next=9,this._recvTransport.consume({producerId:n,producingPeerId:r,appData:i});case 9:a=e.sent,this._initConsumer(a),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),Cb(e.t0)&&this._recvTransport.retryFailedConsumerCreationTasks([e.t0]).then((function(e){var t=(0,d.Z)(e,1)[0];"fulfilled"===t.status?o._initConsumer(t.value):o._logger.error("failed to complete consumer creation task again.","this should not happen",t.reason)}));case 16:Object.assign(window,{consumers:this._consumers});case 17:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._producers.get(t)){e.next=4;break}return this._logger.warn("producer type:",t,"not found"),e.abrupt("return");case 4:n.pause(),this._logger.info(t,"producer id:",n.id,"paused");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._producers.get(t)){e.next=4;break}return this._logger.warn("producer type:",t,"not found"),e.abrupt("return");case 4:n.resume(),this._logger.info(t,"producer id:",n.id,"resumed");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"replaceTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._producers.get(t)){e.next=4;break}return this._logger.warn("producer type:",t,"not found"),e.abrupt("return");case 4:return e.next=6,r.replaceTrack({track:n});case 6:this._logger.info("track replaced with id:",n.id,"on producer:",t);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"removeProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._producers.get(t)){e.next=4;break}return this._logger.warn("producer type:",t,"not found"),e.abrupt("return");case 4:n&&r.track.stop(),r.close();case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"pauseConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._consumers.get(t)){e.next=4;break}return this._logger.warn("consumer id:",t,"not found"),e.abrupt("return");case 4:return e.prev=4,r={consumerId:t,pause:!0},e.next=8,this.socket.sendMessagePromise(ob.toggleConsumer,Em.toBinary(r));case 8:n.pause(),sm.emit(cm.CONSUMER_PAUSED,{id:n.id}),this._logger.info("consumer:",t,"paused"),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),this._logger.error("error on pausing consumer",e.t0);case 16:case"end":return e.stop()}}
2),e,this,[[4,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"toggleConsumerOverDC",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r={type:"consumer_toggle",payload:{consumerId:t,mute:n}},i=this._recvTransport.getDatachannel("events")){e.next=4;break}return this._logger.warn("events datachannel not found"),e.abrupt("return");case 4:i.send(JSON.stringify(r));case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"resumeConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._consumers.get(t)){e.next=4;break}return this._logger.warn("consumer id:",t,"not found"),e.abrupt("return");case 4:if(n.paused){e.next=7;break}return this._logger.warn("consumer is not paused so not resuming",t),e.abrupt("return");case 7:return e.prev=7,r={consumerId:t,pause:!1},e.next=11,this.socket.sendMessagePromise(ob.toggleConsumer,Em.toBinary(r));case 11:n.resume(),sm.emit(cm.CONSUMER_RESUMED,{id:n.id}),this._logger.info("consumer:",t,"resumed"),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(7),this._logger.error("error on resuming consumer",e.t0);case 19:case"end":return e.stop()}}),e,this,[[7,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"closeConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.closeConsumers([t],n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"closeConsumers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s=this,c=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=c.length>1&&void 0!==c[1]&&c[1],this._logger.info("Closing consumers:",t,"with force:",n),r=!0,i=t.filter((function(e){return!!s._consumers.get(e)||(s._logger.warn("consumer id:",e,"not found"),!1)})),a={consumerIds:i},o=function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null==(t=s._recvTransport)?void 0:t.awaitQueue.push((0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s._socketHandler.closeConsumer(a);case 2:case"end":return e.stop()}}),e)})))).catch((function(e){s._logger.warn("error on closing consumer:",e),r=n})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),!n){e.next=8;break}o(),e.next=10;break;case 8:return e.next=10,o();
2case 10:r&&i.forEach((function(e){var t=s.consumers.get(e);s.producerIdToConsumerIdMap.delete(t.producerId),t.close(n?"manually closed":void 0)}));case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"cleanupConsumers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],this._consumers.forEach((function(e){t?e.peerId===t&&n.push(e.id):n.push(e.id)})),this.closeConsumers(n,!0);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopAllProducers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._logger.info("stopping all available producers"),this._producers.forEach((function(e,n){t._logger.debug("closing producer type",n),e.close()}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getProducer",value:function(e){return(0,o.Z)(this.producers.values()).filter((function(t){return t.id===e})).at(0)}},{key:"negotiate",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._logger.info("initiating negotiation",n),this._logger.info("setting remote offer :",n,"on transport",t.serverId),e.next=3,t.setRemoteOffer(n);case 3:return r=e.sent,i={transportId:t.serverId,description:{sdp:r.sdp,type:r.type,target:am.SUBSCRIBER}},this._logger.info("sending renegotiate request",i),e.next=8,this.socket.sendMessagePromise(ob.renegotiateSessionDescription,pm.toBinary(i));case 8:return this._logger.info("renegotiation done",t.serverId),e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(cb),Bb=Object.defineProperty,Ub=Object.getOwnPropertyDescriptor,Vb=function(e,t,n,r){for(var i,a=r>1?void 0:r?Ub(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Bb(t,n,a),a},Fb=(Nb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),Ib,void 0),Ms((0,f.Z)(r),Ob,void 0),Ms((0,f.Z)(r),Lb,void 0),Ms((0,f.Z)(r),Db,void 0),Cs((0,f.Z)(r),"legacyMode"),Cs((0,f.Z)(r),"roomNodeUrl"),Cs((0,f.Z)(r),"peerDisplayName"),Cs((0,f.Z)(r),"activatedProducingPeerIds"),Cs((0,f.Z)(r),"logger");var i=e.roomName,a=e.peerId,o=e.authToken,s=e.legacyMode,c=e.socketClient,u=e.meetingTitle;return r.roomName=i,r.peerId=a,r.authToken=o,r.legacyMode=s,r.roomJoined=!1,r.meetingTitle=u,As((0,f.Z)(r),Db,!1),As((0,f.Z)(r),Ib,c),As((0,f.Z)(r),Ob,new jb(c)),r.maxPreferredStreams=6,r.activatedProducingPeerIds=new Set,r.logger=ub.getLogger("HiveNodeClient()"),Ic.legacySwitch(s),r.handleSocketEvents(),r.handleSFUEvents(),As((0,f.Z)(r),Lb,(function(){r.logger.info("noop reconnection handler")})),r}return(0,y.Z)(n,[{key:"sfuHandler",get:function(){return Zs(this,Ob)}},{key:"onSocketReconnection",set:function(e){As(this,Lb,e)}},{key:"reconnectTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("Room joining state",Zs(this,Db)),!t||Zs(this,Db)){e.next=13;break}if(t.close(),"send"!==t.direction){e.next=7;break}return e.next=4,this.sfuHandler.setupTransports(["send"]);case 4:return this.logger.info("send transport reconected!"),sm.emit(cm.RESET_PRODUCER_STATE),e.abrupt("return");case 7:return this.sfuHandler.cleanupConsumers(),e.next=10,this.sfuHandler.setupTransports(["recv"]);case 10:this.logger.info("recv transport reconnected!"),this.activatedProducingPeerIds=new Set,sm.emit(cm.REFRESH_GRID,!0);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupTransports",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Ob).setupTransports(["recv","send"]);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i){var a,o=this,c=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=c.length>4&&void 0!==c[4]?c[4]:{},e.next=3,this.sfuHandler.stopAllTransports();case 3:return this.peerDisplayName=t,As(this,Db,!0),e.prev=5,e.next=8,this.sfuHandler.hiveSocketHandler.joinRoom(r,t);case 8:return e.next=10,this.setupTransports();case 10:return jc.hasFeature(Pf)&&"ReactNative"!==navigator.product&&setTimeout((0,h.Z)((0,p.Z)().mark((function e(){var n,r,i,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy().getUserDetails();case 2:r=e.sent,i=Wv.isV2AuthToken?r.participant:r,c={userId:null!=(n=i.id)?n:i.participant.id,peerId:o.peerId,displayName:t,roomUUID:o.roomUUID,roomViewType:"groupCall",roomName:o.roomName,deviceInfo:(0,s.Z)((0,s.Z)({},ff.getDeviceInfo()),{},{userAgent:navigator.userAgent,memory:navigator.deviceMemory,cpus:navigator.hardwareConcurrency}),metaData:{},permissions:{}},Ic.roomJoined(c),null!=a&&a.audio?Ic.audioOn():Ic.audioOff(),null!=a&&a.video?Ic.videoOn():Ic.videoOff();case 6:case"end":return e.stop()}}),e)})))),e.next=13,this.completeJoinRoom();case 13:return e.t0=e.sent,e.abrupt("return",{roomJoined:e.t0});case 17:return e.prev=17,e.t1=e.catch(5),e.abrupt("return",(this.logger.error("error on sending join room request",e.t1),{roomJoined:!1}
2));case 20:case"end":return e.stop()}}),e,this,[[5,17]])})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"completeJoinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c,u,l,d=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.sfuHandler.hiveSocketHandler.notifySelfJoinComplete();case 3:return t=e.sent,n=t.maxPreferredStreams,r=t.participants,i=t.roomState,a=t.selectedPeers,this.logger.debug("peerJoinCompleteResponse",{participants:r,roomState:i,selectedPeers:a}),this.roomUUID=i.roomUuid,this.maxPreferredStreams=n,o=r.map((function(e){var t=e.producerStates,n={id:e.peerId,isHost:!1,displayName:e.displayName,flags:{},userId:e.userId,audioMuted:!0,videoEnabled:!1,audioTrack:null,videoTrack:null,producers:[]};return t.forEach((function(e){e.kind===om.AUDIO?n.audioMuted=e.pause:n.videoEnabled=!e.pause,n.producers.push({producerId:e.producerId,kind:e.kind===om.AUDIO?"audio":"video",pause:e.pause,screenShare:e.screenShare})})),n})),c=(s=null!=a?a:{}).audioPeers,u=s.compulsoryPeers,l=o.filter((function(e){return e.id!==d.peerId})),As(this,Db,!1),this.roomJoined=!0,Dv.info("HiveNodeClient::joinRoom::pre_emitasync_room_joined"),e.next=15,sm.emitAsync(cm.ROOM_JOINED,{peers:l});case 15:return i.isRecording&&sm.emit(cm.HIVE_RECORDING_STARTED,i.recorderParticipantId),Dv.info("HiveNodeClient::joinRoom::post_emitasync_room_joined"),sm.emit(cm.SELF_ROOM_JOINED),sm.emit(cm.SELECTED_PEERS,{peerIds:null!=c?c:[],compulsoryPeers:u}),sm.emit(cm.REFRESH_GRID),e.abrupt("return",!0);case 23:return e.prev=23,e.t0=e.catch(0),e.abrupt("return",(this.logger.error("error on completing join room:",e.t0),!1));case 26:case"end":return e.stop()}}),e,this,[[0,23]])})));return function(){return e.apply(this,arguments)}}()},{key:"leaveRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Ob).stopAllTransports();case 2:t={closeRoom:!1},Zs(this,Ib).sendMessagePromise(ob.leaveRoom,km.toBinary(t)).then((function(e){var t;(null==(t=Bm.fromBinary(e.payload))?void 0:t.closed)||n.logger.warn("weird state on peer closed and should not happen")})).catch((function(e){n.logger.error("error on sending leave room request",e)})),Ic.callEnded(),Lv.destruct();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getConsumers",value:function(){return Zs(this,Ob).consumers}},{key:"activatePeers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.map((function(e){var t=e.peerId,n=e.producers,i=e.force;if(0===n.length)return Promise.resolve();var a=!1,o=[];return n.every((function(e){var t=r.sfuHandler.producerIdToConsumerIdMap.get(e.producerId);if(!t)return a=!0,!1;var n=r.sfuHandler.consumers.get(t);return n&&!e.pause&&n.paused&&o.push(t),!0})),a||i?r.consumePeer(t,i):o.length>0?r.resumeConsumers(o):Promise.resolve()})),e.next=3,Promise.all(n);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"deactivatePeers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.logger.info("deactivating producers",t),t.producers.forEach((function(e){var t=e.producerId,r=e.kind,i=e.screenShare;if("audio"===r||"video"===r&&i)n.logger.debug("we don't want to pause audio or screenshare");else{var a=n.sfuHandler.producerIdToConsumerIdMap.get(t);a?n.sfuHandler.pauseConsumer(a):n.logger.warn("consumer not found in deactivate producers:",t)}})),this.activatedProducingPeerIds.delete(t.peerId);case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.producerId,r=t.producingPeerId,i=t.screenShare,e.abrupt("return",this.sfuHandler.createConsumer({producerId:n,producingPeerId:r,appData:{screenShare:i}}));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseConsumers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.forEach((function(e){n.sfuHandler.pauseConsumer(e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeConsumers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.forEach((function(e){n.sfuHandler.resumeConsumer(e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"closeConsumers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,o.Z)(this.getConsumers().values()).filter((function(e){return t.includes(e.peerId)})).map((function(e){return e.id})),e.abrupt("return",(t.forEach((function(e){r.activatedProducingPeerIds.delete(e)})),this.sfuHandler.closeConsumers(n)));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"consumePeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("current activated Peer ids",(0,o.Z)(this.activatedProducingPeerIds.values()),"forced?:",n),this.activatedProducingPeerIds.has(t)&&!n){e.next=12;break}return e.prev=1,e.next=4,Zs(this,Ob).consumePeer(t);case 4:this.activatedProducingPeerIds.add(t),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this.logger.error("consumePeer failed in HiveNodeClient.ts",e.t0);case 10:e.next=13;break;case 12:this.logger.info("not creating consumer for this peerId",t);case 13:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"shareWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return");case 2:if(!Zs(this,Ob).producers.has(wf.WEBCAM)){e.next=12;break}if((n=Zs(this,Ob).producers.get(wf.WEBCAM)).closed){e.next=10;break}return e.next=7,n.replaceTrack({track:t});case 7:return e.next=9,this.resumeWebcam();case 9:return e.abrupt("return");case 10:return e.next=12,Zs(this,Ob).removeProducer(n.id);case 12:return r={track:t,codecOptions:{name:"VP8"},appData:{screenShare:!1},stopTracks:!1},jc.hasFeature(Vf)&&((i=t.getConstraints().width)in kf||(i=320),r.encodings=kf[i]),a=function(){o.disableWebcam()},e.next=17,Zs(this,Ob).createProducer(wf.WEBCAM,r,a);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"shareScreen",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.video,r=t.audio,void 0!==n){e.next=3;break}return e.abrupt("return");case 3:return i={track:n,codecOptions:{name:"VP8"},appData:{screenShare:!0,supportsRemoteControl:ff.isElectron()},stopTracks:!1},a=function(){s.disableScreenShare()},Ic.screenShareRequested(),e.next=8,Zs(this,Ob).createProducer(wf.SCREENSHARE_VIDEO,i,a);case 8:if(!r){e.next=13;break}return o={track:r,codecOptions:{name:"opus"}
2,appData:{screenShare:!0,supportsRemoteControl:ff.isElectron()},stopTracks:!1},a=function(){},e.next=13,Zs(this,Ob).createProducer(wf.SCREENSHARE_AUDIO,o,a);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"shareMic",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return");case 2:if(!Zs(this,Ob).producers.has(wf.MIC)){e.next=12;break}if((n=Zs(this,Ob).producers.get(wf.MIC)).closed){e.next=10;break}return e.next=7,n.replaceTrack({track:t});case 7:return e.next=9,this.resumeMic();case 9:return e.abrupt("return");case 10:return e.next=12,Zs(this,Ob).removeProducer(wf.MIC,!1);case 12:return r={track:t,encodings:[{priority:"high"}],codecOptions:{name:"opus"},stopTracks:!1},i=function(){a.disableMic()},e.next=15,Zs(this,Ob).createProducer(wf.MIC,r,i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseMic",value:function(){var e=Zs(this,Ob).producers.get(wf.MIC);if(e)if(e.paused)Dv.info("pauseMic::mic_producer_already_paused");else{e.pause();var t={producerId:e.id,pause:!0};Zs(this,Ib).sendMessage(ob.toggleProducer,Sm.toBinary(t))}else Dv.error("pauseMic::could_not_find_mic_producer")}},{key:"pauseWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Zs(this,Ob).producers.get(wf.WEBCAM)){e.next=4;break}return Dv.error("pauseWebcam::could_not_find_webcam_producer"),e.abrupt("return");case 4:t.pause(),n={producerId:t.id,pause:!0},Zs(this,Ib).sendMessage(ob.toggleProducer,Sm.toBinary(n));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resumeMic",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Zs(this,Ob).producers.get(wf.MIC)){e.next=4;break}return Dv.error("resumeMic::could_not_find_mic_producer"),e.abrupt("return");case 4:if(t.pause){e.next=7;break}return Dv.info("resumeMic::mic_producer_already_resumed"),e.abrupt("return");case 7:t.resume(),n={producerId:t.id,pause:!1},Zs(this,Ib).sendMessage(ob.toggleProducer,Sm.toBinary(n));case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resumeWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Zs(this,Ob).producers.get(wf.WEBCAM)){e.next=4;break}return Dv.error("resumeWebcam::could_not_find_webcam_producer"),e.abrupt("return");case 4:t.resume(),n={producerId:t.id,pause:!1},Zs(this,Ib).sendMessage(ob.toggleProducer,Sm.toBinary(n));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Ob).removeProducer(wf.WEBCAM);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableMic",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,Ob).removeProducer(wf.MIC);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Dv.info("screen_sharing_stopped"),e.next=3,Zs(this,Ob).removeProducer(wf.SCREENSHARE_VIDEO);case 3:return e.next=5,Zs(this,Ob).removeProducer(wf.SCREENSHARE_AUDIO);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"muteSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.pauseMic();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"unmuteSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resumeMic();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resetVideoProducers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t,!e.t0){e.next=5;break}return e.next=4,Zs(this,Ob).removeProducer(wf.WEBCAM,!1);case 4:this.shareWebcam(t);case 5:if(e.t1=n,!e.t1){e.next=10;break}return e.next=9,Zs(this,Ob).removeProducer(wf.SCREENSHARE_VIDEO,!1);case 9:this.shareScreen({video:n});case 10:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getPolls",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{payload:{polls:{}}});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"changeDisplayName",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={displayName:t,participantId:null!=n?n:this.peerId},e.next=3,this.sfuHandler.hiveSocketHandler.changeDisplayName(r);case 3:if(e.sent){e.next=5;break}throw new Error("failed to change display name!");case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"kick",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={participantId:t},e.next=3,this.sfuHandler.hiveSocketHandler.kickPeer(n);case 3:if(e.sent){e.next=5;break}throw new Error("failed to kickout the participant!");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"kickAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.hiveSocketHandler.kickAll();case 2:if(e.sent){e.next=4;break}throw new Error("failed to kickout all participant!");case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"muteAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.hiveSocketHandler.hostControlForAll("audio");case 2:if(e.sent){e.next=4;break}throw new Error("failed to mute all participant");case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"muteAllVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.hiveSocketHandler.hostControlForAll("video");case 2:if(e.sent){e.next=4;break}throw new Error("failed to mute all video participant");case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"mutePeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.hiveSocketHandler.hostControlForPeer(t,"audio");case 2:if(e.sent){e.next=4;break}throw new Error("failed to mute given participant");case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"mutePeerVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.hiveSocketHandler.hostControlForPeer(t,"video");case 2:if(e.sent){e.next=4;break}throw new Error("failed to mute video of given participant");case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pinPeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={participantId:null!=t?t:""},e.prev=1,e.next=4,Zs(this,Ib).sendMessagePromise(ob.globalPinPeer,xm.toBinary(n));case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),this.logger.error("Error in pinning peer: ".concat(e.t0));case 9:case"end":return e.stop()}}),e,this,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()},{key:"handleSocketEvents",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Zs(this,Ib).on(ob.peerJoinedBroadcast,(function(e){var n=e.id,r=e.payload;if(t.roomJoined){t.logger.debug("got peer joined with id",n);try{var i=Jm.fromBinary(r).participant,a=i.peerId,o=i.displayName,s=i.producerStates,c=i.userId;if(a===t.peerId)return;t.logger.info("peer-joined",{peerId:a,displayName:o,producerStates:s});var u={id:a,isHost:!1,displayName:o,flags:{},userId:c,audioMuted:!0,videoEnabled:!1,audioTrack:null,videoTrack:null,producers:[]};
2s.forEach((function(e){e.kind===om.AUDIO?u.audioMuted=e.pause:u.videoEnabled=!e.pause,u.producers.push({producerId:e.producerId,kind:e.kind===om.AUDIO?"audio":"video",pause:e.pause,screenShare:e.screenShare})})),sm.emit(cm.PEER_JOINED,u),sm.emit(cm.REFRESH_GRID)}catch(l){t.logger.error("error in peer-joined-broadcast",l)}}})),Zs(this,Ib).on(ob.peerProducerCreateBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r=$m.fromBinary(n),i=r.participantId,a=r.producerState;if(i===t.peerId)return;t.logger.info("producer created broadcast:",i,"producer state",a),sm.emit(cm.NEW_PRODUCER,{peerId:i,producer:{producerId:a.producerId,kind:a.kind===om.AUDIO?"audio":"video",pause:a.pause,screenShare:a.screenShare}})}catch(o){t.logger.error("error in peer-producer-create-broadcast",o)}})),Zs(this,Ib).on(ob.peerProducerToggleBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r=Km.fromBinary(n),i=r.participantId,a=r.producerState,s=a.kind,c=a.pause,u=a.producerId,l=s===om.AUDIO?"audio":"video";if(t.logger.info("producer toggle broadcast:",i,"producerId",u,"kind",l,"paused",c),i===t.peerId&&c)return void sm.emit("audio"===l?cm.MUTE_ALL:cm.MUTE_ALL_VIDEO);sm.emit(cm.PRODUCER_TOGGLE,{peerId:i,producerId:u,paused:c,kind:l}),(0,o.Z)(t.getConsumers().values()).filter((function(e){return e.producerId===u})).forEach((function(e){e.paused!==c&&(t.logger.debug("consumer state mismatched for",e.id,". updating consumer pause state",e.paused,"to",c),c?(e.pause(),sm.emit(cm.CONSUMER_PAUSED,{id:e.id})):(e.resume(),sm.emit(cm.CONSUMER_RESUMED,{id:e.id})))}))}catch(d){t.logger.error("error in producer toggle broadcast handler",d)}})),Zs(this,Ib).on(ob.selectedPeer,(function(e){var n=e.payload;if(t.roomJoined)try{var r=Lm.fromBinary(n),i=r.audioPeers,a=r.compulsoryPeers;t.logger.info("selected peers:",i,a),sm.emit(cm.SELECTED_PEERS,{peerIds:a.concat(i)})}catch(o){t.logger.error("error in selected-peer",o)}})),Zs(this,Ib).on(ob.selectedPeerDiff,(function(e){var n=e.payload;if(t.roomJoined)try{var r=Nm.fromBinary(n).entries;t.logger.debug("selected peers diff:",r);var i=r.map((function(e){return{peerId:e.peerId,priority:e.priority}}));sm.emit(cm.SELECTED_PEERS_DIFF,{entries:i})}catch(a){t.logger.error("error in selected-peer-diff",a)}})),Zs(this,Ib).on(ob.peerLeaveBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r=Ym.fromBinary(n).participantId;if(r===t.peerId)return t.logger.warn("peer got kicked out of the room"),void sm.emit(cm.KICKED);t.logger.info("peer left broadcast:",r),t.sfuHandler.cleanupConsumers(r),sm.emit(cm.PEER_CLOSED,{id:r})}catch(i){t.logger.error("error in peer left broadcast",i)}})),Zs(this,Ib).on(ob.peerProducerCloseBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r=Qm.fromBinary(n),i=r.participantId,a=r.producerState.producerId;if(i===t.peerId)return;t.logger.info("producer closed broadcast:",i),sm.emit(cm.PRODUCER_CLOSED,{peerId:i,producerId:a});var o=t.sfuHandler.producerIdToConsumerIdMap.get(a);if(!o)return void t.logger.warn("no consumer found for producer",a);t.logger.info("closing consumer",o,"producer id ",a),t.sfuHandler.closeConsumer(o).then((function(){t.logger.info("closed consumer",o),t.sfuHandler.producerIdToConsumerIdMap.delete(a),sm.emit(cm.CONSUMER_CLOSED,{id:o})})).catch((function(e){t.logger.error("error closing consumer",e)}))}catch(s){t.logger.error("error on producer close broadcast",s)}})),Zs(this,Ib).on(ob.globalPeerPinBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r;if(n){var i=Xm.fromBinary(n);t.logger.info("pinning peerId: ",i),r=i.participantId}sm.emit(cm.PEER_PINNED,{peerId:r})}catch(a){t.logger.error("error on global peer pin broadcast",a)}})),Zs(this,Ib).on(ob.recordingStartedBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r;if(n){var i=eg.fromBinary(n);t.logger.info("recording started. peerId: ",i),r=i.participantId}sm.emit(cm.HIVE_RECORDING_STARTED,r)}catch(a){t.logger.error("error on recording started broadcast",a)}})),Zs(this,Ib).on(ob.recordingStoppedBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r;if(n){var i=tg.fromBinary(n);t.logger.info("recording stopped. peerId: ",i),r=i.participantId}sm.emit(cm.HIVE_RECORDING_STOPPED,r)}catch(a){t.logger.error("error on recording started broadcast",a)}})),Zs(this,Ib).on(ob.peerDisplayNameEditBroadcast,(function(e){var n=e.payload;if(t.roomJoined)try{var r=ng.fromBinary(n);
2t.logger.debug("peer display name changed to:",r.displayName),sm.emit(cm.PEER_DISPLAY_NAME_CHANGED,r.participantId)}catch(i){t.logger.error("failed to handle peerDisplayNameEditBroadcast:",i)}}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"handleSFUEvents",value:function(){var e=this;Zs(this,Ob).on("reconnect_transport",function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.reconnectTransport(n);case 3:e.logger.info("transport reconnected [id:%s]",n.id),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),e.logger.error("error on reconnection transports",t.t0);case 9:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(e){return t.apply(this,arguments)}}())}}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.legacyMode,r=void 0===n||n,i=t.roomName,a=t.peerId,o=t.authToken,s=t.meetingTitle,c=t.socket,u=new Fb({legacyMode:r,authToken:o,socketClient:c,peerId:a,roomName:i,meetingTitle:s}),e.abrupt("return",(c.onStateEvent("disconnected",(function(e){var t;u.isDisconnected=!0,null==(t=Zs(u,Ob))||t.cleanupConsumers(),sm.emit(cm.ROOM_NODE_DISCONNECTED,e),u.roomJoined=!1,u.activatedProducingPeerIds=new Set,Dv.info("HIVE_NODE_DISCONNECTED")})),c.onStateEvent("reconnected",(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Dv.info("HIVE_NODE_RECONNECTED"),e.next=3,null==(t=Zs(u,Ob))?void 0:t.cleanupConsumers();case 3:Zs(n=u,Lb).call(n);case 4:case"end":return e.stop()}}),e)})))),c.onStateEvent("connected",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:sm.emit(cm.ROOM_NODE_CONNECTED,t),Dv.info("HIVE_NODE_CONNECTED");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(sb),Ib=new WeakMap,Ob=new WeakMap,Lb=new WeakMap,Db=new WeakMap,Nb),zb=Fb;Vb([Lv.trace("HiveNodeClient.reconnect")],zb.prototype,"reconnectTransport",1),Vb([Lv.trace("HiveNodeClient.setupTransport")],zb.prototype,"setupTransports",1),Vb([Lv.trace("HiveNodeClient.joinRoom")],zb.prototype,"joinRoom",1),Vb([Lv.trace("HiveNodeClient.completeJoinRoom")],zb.prototype,"completeJoinRoom",1),Vb([Lv.trace("HiveNodeClient.leaveRoom")],zb.prototype,"leaveRoom",1),Vb([Lv.trace("HiveNodeClient.activatePeers")],zb.prototype,"activatePeers",1),Vb([Lv.trace("HiveNodeClient.deactivatePeers")],zb.prototype,"deactivatePeers",1),Vb([Lv.trace("HiveNodeClient.createConsumer")],zb.prototype,"createConsumer",1),Vb([Lv.trace("HiveNodeClient.pauseConsumers")],zb.prototype,"pauseConsumers",1),Vb([Lv.trace("HiveNodeClient.resumeConsumers")],zb.prototype,"resumeConsumers",1),Vb([Lv.trace("HiveNodeClient.closeConsumers")],zb.prototype,"closeConsumers",1),Vb([Lv.trace("HiveNodeClient.consumePeer")],zb.prototype,"consumePeer",1),Vb([Lv.trace("HiveNodeClient.shareWebcam")],zb.prototype,"shareWebcam",1),Vb([Lv.trace("HiveNodeClient.shareScreen")],zb.prototype,"shareScreen",1),Vb([Lv.trace("HiveNodeClient.shareMic")],zb.prototype,"shareMic",1),Vb([Lv.trace("HiveNodeClient.pauseMic")],zb.prototype,"pauseMic",1),Vb([Lv.trace("HiveNodeClient.pauseWebcam")],zb.prototype,"pauseWebcam",1),Vb([Lv.trace("HiveNodeClient.resumeMic")],zb.prototype,"resumeMic",1),Vb([Lv.trace("HiveNodeClient.resumeWebcam")],zb.prototype,"resumeWebcam",1),Vb([Lv.trace("HiveNodeClient.disableWebcam")],zb.prototype,"disableWebcam",1),Vb([Lv.trace("HiveClient.disableMic")],zb.prototype,"disableMic",1),Vb([Lv.trace("HiveClient.disableScreenShare")],zb.prototype,"disableScreenShare",1),Vb([Lv.trace("HiveNodeClient.muteSelf")],zb.prototype,"muteSelf",1),Vb([Lv.trace("HiveNodeClient.unmuteSelf")],zb.prototype,"unmuteSelf",1),Vb([Lv.trace("HiveNodeClient.resetVideoProducers")],zb.prototype,"resetVideoProducers",1),Vb([Lv.trace("HiveNodeClient.getPolls")],zb.prototype,"getPolls",1),Vb([Lv.trace("HiveNodeClient.changeDisplayName")],zb.prototype,"changeDisplayName",1),Vb([Lv.trace("HiveNodeClient.kickPeer")],zb.prototype,"kick",1),Vb([Lv.trace("HiveNodeClient.kickAllPeers")],zb.prototype,"kickAll",1),Vb([Lv.trace("HiveNodeClient.muteAll")],zb.prototype,"muteAll",1),Vb([Lv.trace("HiveNodeClient.muteAllVideo")],zb.prototype,"muteAllVideo",1),Vb([Lv.trace("HiveNodeClient.mute")],zb.prototype,"mutePeer",1),Vb([Lv.trace("HiveNodeClient.muteVideo")],zb.prototype,"mutePeerVideo",1),Vb([Lv.trace("HiveNodeClient.pinPeer")],zb.prototype,"pinPeer",1),Vb([Lv.trace("HiveNodeClient.init")],zb,"init",1);var Hb=function(e){return e.SOCKET_CONNECTED="SOCKET_CONNECTED",e.SOCKET_DISCONNECTED="SOCKET_DISCONNECTED",e.SOCKET_CONNECTION_ERROR="SOCKET_CONNECTION_ERROR",e.SOCKET_MESSAGE="SOCKET_MESSAGE",e}(Hb||{}),qb=function(e){return e[e.NOT_STARTED=0]="NOT_STARTED",e[e.CONNECTED=1]="CONNECTED",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.ERRORED=3]="ERRORED",e}(qb||{}),Gb=Object.defineProperty,Wb=Object.getOwnPropertyDescriptor,Jb=function(e,t,n,r){for(var i,a=r>1?void 0:r?Wb(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Gb(t,n,a),a},$b=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"socket"),Cs((0,f.Z)(r),"socketState"),Cs((0,f.Z)(r),"callbackHandler",null),r.socketState=qb.NOT_STARTED,e.callbackHandler&&(r.callbackHandler=e.callbackHandler),r}
2return(0,y.Z)(n,[{key:"connect",value:function(e){this.socket&&(this.socket.removeAllListeners(),this.socket.disconnect()),this.socket=bs(e,{closeOnBeforeunload:!1}),this.setupSocket()}},{key:"disconnect",value:function(){this.socket.disconnect()}},{key:"reconnect",value:function(){this.socket.connect()}},{key:"setupSocket",value:function(){var e=this;this.socket.on("disconnect",(function(t){e.socketState=qb.DISCONNECTED,Dv.warn("SocketClient::socket_disconnected",{error:{reason:t}}),e.emit(Hb.SOCKET_DISCONNECTED,{reason:t})})),this.socket.on("connect_error",(function(t){e.socketState=qb.ERRORED,jc.hasFeature(ev)&&(e.socket.io.opts.transports=["polling","websocket"]),Dv.error("SocketClient::socket_connection_errored",{error:t}),e.emit(Hb.SOCKET_CONNECTION_ERROR,{err:t})})),this.socket.on("connect",(function(){e.socketState=qb.CONNECTED,Dv.info("SocketClient::socket_connected"),e.emit(Hb.SOCKET_CONNECTED)})),this.socket.on("event://server-simple-message",function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n,r){var i,a;return(0,p.Z)().wrap((function(t){for(;;
2)switch(t.prev=t.next){case 0:if(i=JSON.parse(n),(!Lv.logExclusionList.includes(null==i?void 0:i.type)||jc.hasFeature(zf))&&Dv.info("SocketClient::SIMPLE_SERVER_MESSAGE_EVENT::".concat(null==i?void 0:i.type)),!r){t.next=11;break}if(a="OK",t.t0=e.callbackHandler,!t.t0){t.next=8;break}return t.next=7,e.callbackHandler(i);case 7:a=t.sent;case 8:r(a),t.next=12;break;case 11:e.emit(Hb.SOCKET_MESSAGE,i);case 12:Object.values(cm).find((function(e){return e===i.type}))&&sm.emit(i.type,i.payload);case 13:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())}},{key:"sendMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",((!Lv.logExclusionList.includes(null==t?void 0:t.type)||jc.hasFeature(zf))&&Dv.info("SocketClient::sendMessage::".concat(null==t?void 0:t.type)),Object.assign(t,{metadata:t.metadata||{}}),Lv.injectContext(t.metadata),new Promise((function(e){n.socket.emit("event://send-message",JSON.stringify(t),(function(t){if(t){var n=JSON.parse(t);e(n)}else e(void 0)}))}))));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Ns);Jb([Lv.trace("SocketClient.connect")],$b.prototype,"connect",1),Jb([Lv.trace("SocketClient.disconnect")],$b.prototype,"disconnect",1),Jb([Lv.trace("SocketClient.reconnect")],$b.prototype,"reconnect",1),Jb([Lv.trace("SocketClient.setupSocket")],$b.prototype,"setupSocket",1);var Kb=Object.defineProperty,Qb=Object.getOwnPropertyDescriptor,Yb=function(e,t,n,r){for(var i,a=r>1?void 0:r?Qb(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Kb(t,n,a),a},Xb=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this),Cs((0,f.Z)(i),"device"),Cs((0,f.Z)(i),"sendTransport"),Cs((0,f.Z)(i),"recvTransport"),Cs((0,f.Z)(i),"sendTransportIceStateDisconnectTime"),Cs((0,f.Z)(i),"recvTransportIceStateDisconnectTime"),Cs((0,f.Z)(i),"producerCreationStatus"),Cs((0,f.Z)(i),"consumers"),Cs((0,f.Z)(i),"producers"),Cs((0,f.Z)(i),"socketClient"),Cs((0,f.Z)(i),"iceRestartInProgress"),i.producers=new Map,i.consumers=new Map,i.producerCreationStatus=new Map,i.iceRestartInProgress={sendTransport:!1,recvTransport:!1},i.device=void 0!==r?r:new Kh,i.socketClient=e,i}return(0,y.Z)(n,[{key:"setupTransports",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy().getICEServers();case 2:return t=e.sent,e.next=5,this.loadRouter();case 5:return e.next=7,Promise.all([this.createRecvTransport(t),this.createSendTransport(t)]);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"loadRouter",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.recvTransport||this.sendTransport,!e.t0){e.next=4;break}return e.next=4,this.stopAllTransports();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRTPCapabilities",value:function(){return this.device.rtpCapabilities}},{key:"createRecvTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.socketClient){e.next=2;break}return e.abrupt("return");case 2:return n={forceTcp:!1,producing:!1,consuming:!0},e.next=5,this.socketClient.sendMessage({type:"createWebRtcTransport",payload:n});case 5:r=e.sent.payload,Dv.info("recvTransport::initializing_transport"),this.recvTransport=this.device.createRecvTransport((0,s.Z)((0,s.Z)({},r),{},{iceServers:t,proprietaryConstraints:mf})),Dv.info("recvTransport::initialized_transport"),Ic.onSafeInitialization((function(){Ic.configureRecvTransport(a.recvTransport)})),this.recvTransport.on("connect",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.dtlsParameters,e.next=3,a.socketClient.sendMessage({type:"connectWebRtcTransport",payload:{transportId:a.recvTransport.id,dtlsParameters:i}});case 3:l=e.sent,null!=(o=l.payload)&&o.error?(Dv.error("recvTransport::transport_status",{error:null==(c=l.payload)?void 0:c.error,transport:{id:null==(u=null==a?void 0:a.recvTransport)?void 0:u.id,status:"failed",type:"recv"}}),r(new Error("failed"))):(n(),Dv.info("recvTransport::transport_status",{transport:{id:null==(s=null==a?void 0:a.recvTransport)?void 0:s.id,status:"connected",type:"recv"}}));case 5:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()),jc.hasFeature(Lf)&&(Dv.info("enabling_ice_state_logging_for_recv_transport"),this.recvTransport.on("connectionstatechange",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,o,s,c,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=(Dv.info("recvTransport::connection_state_change",{transport:{id:null==(n=null==a?void 0:a.recvTransport)?void 0:n.id,status:t,type:"recv"}}),t),e.next="failed"===e.t0?3:"disconnected"===e.t0?13:"connected"===e.t0?17:19;break;case 3:if(sm.emit(cm.ICE_FAILED,{transport:"recv"}
2),Dv.warn("recvTransport::ice_state_failed"),!jc.hasFeature(If)){e.next=12;break}return e.prev=4,e.next=7,a.restartIceTillSuccess(a.recvTransport);case 7:e.next=12;break;case 9:e.prev=9,e.t1=e.catch(4),Dv.error("recvTransport::ice_restart_failed",{error:e.t1,transport:{id:null==(r=null==a?void 0:a.recvTransport)?void 0:r.id,status:"failed",type:"recv"}});case 12:return e.abrupt("break",19);case 13:sm.emit(cm.ICE_DISCONNECTED,{transport:"recv"}),Dv.warn("recvTransport::ice_state_disconnected"),a.recvTransportIceStateDisconnectTime&&Dv.warn("recvTransport::ice_state_disconnected_again",{transport:{id:null==(o=null==a?void 0:a.recvTransport)?void 0:o.id,status:"disconnected",type:"recv",lastDisconnectedTime:null==(s=a.recvTransportIceStateDisconnectTime)?void 0:s.toISOString(),lastDisconnectedTimeOffset:null==(c=a.recvTransportIceStateDisconnectTime)?void 0:c.getTimezoneOffset(),durationPassed:(new Date).getTime()-a.recvTransportIceStateDisconnectTime.getTime()}}),a.recvTransportIceStateDisconnectTime=new Date;try{"number"!=typeof(i=jc.getValue(Of))&&(i=void 0)}catch(f){i=void 0}return i&&setTimeout((0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===a.recvTransportIceStateDisconnectTime){e.next=10;break}return sm.emit(cm.ICE_RECONNECTING,{transport:"recv"}),Dv.info("recvTransport::attempting_ice_restart",{transport:{id:null==(t=null==a?void 0:a.recvTransport)?void 0:t.id,type:"recv",status:"reconnecting",lastDisconnectedTime:null==(n=a.recvTransportIceStateDisconnectTime)?void 0:n.toISOString(),lastDisconnectedTimeOffset:null==(r=a.recvTransportIceStateDisconnectTime)?void 0:r.getTimezoneOffset()},iceRestart:{isSendTransport:null==(i=null==a?void 0:a.iceRestartInProgress)?void 0:i.sendTransport,isRecvTransport:null==(o=null==a?void 0:a.iceRestartInProgress)?void 0:o.recvTransport}}),e.prev=2,e.next=5,a.restartIceTillSuccess(a.recvTransport);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),Dv.info("SFUHandler.disconnected.restartIceFailed",{error:e.t0,iceRestart:{status:"failed",isRecvTransport:!0}});case 10:case"end":return e.stop()}}),e,null,[[2,7]])}))),i),e.abrupt("break",19);case 17:return sm.emit(cm.ICE_CONNECTED,{transport:"recv"}),Dv.info("recvTransport::ice_state_connected",{transport:{id:null==(u=null==a?void 0:a.recvTransport)?void 0:u.id,type:"recv",status:"connected",lastDisconnectedTime:null==(l=a.recvTransportIceStateDisconnectTime)?void 0:l.toISOString(),lastDisconnectedTimeOffset:null==(d=a.recvTransportIceStateDisconnectTime)?void 0:d.getTimezoneOffset(),durationPassed:a.recvTransportIceStateDisconnectTime?(new Date).getTime()-a.recvTransportIceStateDisconnectTime.getTime():null}}),a.recvTransportIceStateDisconnectTime=void 0,e.abrupt("break",19);case 19:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(t){return e.apply(this,arguments)}}())),this.recvTransport.observer.on("close",(function(){a.recvTransport=void 0,Dv.warn("recvTransport_closed")}));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createSendTransport",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={forceTcp:!1,producing:!0,consuming:!1},e.next=3,this.socketClient.sendMessage({type:"createWebRtcTransport",payload:n});case 3:r=e.sent.payload,Dv.info("sendTransport::initializing_transport"),this.sendTransport=this.device.createSendTransport((0,s.Z)((0,s.Z)({},r),{},{iceServers:t,proprietaryConstraints:mf})),Dv.info("sendTransport::initialized_transport"),Ic.onSafeInitialization((function(){Ic.configureSendTransport(a.sendTransport)})),this.sendTransport.on("connect",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,o,s,c,u;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.dtlsParameters,e.next=3,a.socketClient.sendMessage({type:"connectWebRtcTransport",payload:{transportId:null==(o=a.sendTransport)?void 0:o.id,dtlsParameters:i}});case 3:if(e.t1=s=e.sent.payload,e.t0=null!=e.t1,!e.t0){e.next=7;break}e.t0=s.error;case 7:if(!e.t0){e.next=11;break}Dv.error("sendTransport::transport_status",{transport:{id:null==(u=null==a?void 0:a.sendTransport)?void 0:u.id,status:"failed",type:"send"}}),r(new Error("failed")),e.next=12;break;case 11:Dv.info("sendTransport::transport_status",{transport:{id:null==(c=null==a?void 0:a.sendTransport)?void 0:c.id,status:"connected",type:"send"}}),n();case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()),this.sendTransport.on("produce",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.kind,o=t.rtpParameters,s=t.appData,e.next=3,a.socketClient.sendMessage({type:"produce",payload:{transportId:null==(c=a.sendTransport)?void 0:c.id,kind:i,rtpParameters:o,appData:s}});case 3:v=e.sent,null!=(u=v.payload)&&u.error?(Dv.info("sendTransport::producer_status::failed",{producer:{kind:i,appData:s,status:"failed",id:null==(h=null==v?void 0:v.payload)?void 0:h.id}}),r(null==(f=v.payload)?void 0:f.error)):(Dv.info("sendTransport::producer_status::producing",{producer:{kind:i,appData:s,status:"producing",id:null==(l=null==v?void 0:v.payload)?void 0:l.id}}),n({id:null==(d=v.payload)?void 0:d.id}));case 5:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()),jc.hasFeature(Lf)&&(Dv.info("Enabling ice state logging for send transport"),this.sendTransport.on("connectionstatechange",function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=(Dv.info("sendTransport::connection_state_change",{transport:{id:null==(n=null==a?void 0:a.sendTransport)?void 0:n.id,status:t,type:"send"}}),t),e.next="failed"===e.t0?3:"disconnected"===e.t0?13:"connected"===e.t0?17:19;break;case 3:if(sm.emit(cm.ICE_FAILED,{transport:"send"}),Dv.warn("sendTransport::ice_state_failed"),!jc.hasFeature(If)){e.next=12;break}return e.prev=4,e.next=7,a.restartIceTillSuccess(a.sendTransport);case 7:e.next=12;break;case 9:e.prev=9,e.t1=e.catch(4),Dv.error("sendTransport::ice_restart_failed",{error:e.t1});case 12:return e.abrupt("break",19);case 13:sm.emit(cm.ICE_DISCONNECTED,{transport:"send"}),Dv.warn("sendTransport::ice_state_disconnected"),a.sendTransportIceStateDisconnectTime&&Dv.warn("sendTransport::ice_state_disconnected_again",{transport:{id:null==(r=null==a?void 0:a.sendTransport)?void 0:r.id,status:"disconnected",lastDisconnectedTime:a.sendTransportIceStateDisconnectTime.toLocaleTimeString(),durationPassed:(new Date).getTime()-a.sendTransportIceStateDisconnectTime.getTime(),type:"send"}}),a.sendTransportIceStateDisconnectTime=new Date;try{"number"!=typeof(i=jc.getValue(Of))&&(i=void 0)}catch(c){i=void 0}return i&&setTimeout((0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===a.sendTransportIceStateDisconnectTime){e.next=10;break}return sm.emit(cm.ICE_RECONNECTING,{transport:"send"}),Dv.info("sendTransport::attempting_ice_restart",{transport:{id:null==(t=null==a?void 0:a.sendTransport)?void 0:t.id,status:"reconnecting",type:"send",lastDisconnectedTime:null==(n=a.sendTransportIceStateDisconnectTime)?void 0:n.toISOString(),lastDisconnectedTimeOffset:null==(r=a.sendTransportIceStateDisconnectTime)?void 0:r.getTimezoneOffset()}
2,iceRestart:{status:"connecting"}}),e.prev=2,e.next=5,a.restartIceTillSuccess(a.sendTransport);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),Dv.info("SFUHandler.disconnected.restartIceFailed",{error:e.t0,transport:{id:null==(i=null==a?void 0:a.sendTransport)?void 0:i.id,type:"send",status:"failed"}});case 10:case"end":return e.stop()}}),e,null,[[2,7]])}))),i),e.abrupt("break",19);case 17:return sm.emit(cm.ICE_CONNECTED,{transport:"send"}),Dv.info("sendTransport::ice_state_connected",{transport:{id:null==(o=null==a?void 0:a.sendTransport)?void 0:o.id,type:"send",status:"connected",lastDisconnectedTime:null==(s=a.sendTransportIceStateDisconnectTime)?void 0:s.toLocaleTimeString(),durationPassed:a.sendTransportIceStateDisconnectTime?(new Date).getTime()-a.sendTransportIceStateDisconnectTime.getTime():null}}),a.sendTransportIceStateDisconnectTime=void 0,e.abrupt("break",19);case 19:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(t){return e.apply(this,arguments)}}())),this.sendTransport.observer.on("close",(function(){a.sendTransport=void 0,Dv.warn("sendTransport_closed")}));case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"restartIce",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("recv"===(n=t.direction)?this.iceRestartInProgress.recvTransport:this.iceRestartInProgress.sendTransport){e.next=15;break}return"recv"===n?this.iceRestartInProgress.recvTransport=!0:this.iceRestartInProgress.sendTransport=!0,e.prev=3,e.next=6,this.socketClient.sendMessage({type:"restartIce",payload:{transportId:t.id}});case 6:return r=e.sent.payload,e.next=9,t.restartIce(r);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),Dv.error("SFUHandler.restartIce.Failed",{error:e.t0,iceRestart:{status:"failed"},transport:{id:null==t?void 0:t.id,status:"failed",type:n}});case 14:"recv"===n?this.iceRestartInProgress.recvTransport=!1:this.iceRestartInProgress.sendTransport=!1;case 15:case"end":return e.stop()}}),e,this,[[3,11]])})));return function(t){return e.apply(this,arguments)}}()},{key:"createConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,c,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this.recvTransport&&!this.recvTransport.closed){e.next=2;break}return e.abrupt("return");case 2:return n=t.peerId,r=t.producerId,i=t.id,a=t.kind,o=t.rtpParameters,c=t.appData,u=t.remotelyPaused,Dv.info("createConsumer::initializing_consumer",{consumer:{id:i,peerId:n,kind:a,appData:c,remotelyPaused:u}}),e.next=6,this.recvTransport.consume({id:i,producerId:r,kind:a,rtpParameters:o,appData:(0,s.Z)((0,s.Z)({},c),{},{peerId:n})});case 6:l=e.sent,Dv.info("createConsumer::initialized_consumer",{consumer:{id:i,peerId:n,kind:a,appData:c,remotelyPaused:u}}),(d=l).peerId=n,d.remotelyPaused=u,d.score=10,this.consumers.set(l.id,d);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"closeConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.id,(r=this.consumers.get(n))&&(Dv.info("SFUHandler::close_consumer",{consumer:r}),r.close(),this.consumers.delete(n));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"cleanupConsumers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==(t=this.consumers)||t.forEach((function(e){sm.emit(cm.CONSUMER_CLOSED,{id:e.id}),n.closeConsumer({id:e.id})}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pauseConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.id,(r=this.consumers.get(n))&&r.pause();case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"resumeConsumer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.id,(r=this.consumers.get(n))&&r.resume();case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,a,o=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this.sendTransport&&!this.sendTransport.closed){e.next=2;break}return e.abrupt("return");case 2:if(Dv.info("createProducer::initializing_producer",{producer:{id:"TO_BE_CREATED",kind:t,status:"initializing",appData:null==n?void 0:n.appData}}),!this.producerCreationStatus.get(t)||"INITIALIZING"!==this.producerCreationStatus.get(t)){e.next=5;break}return Dv.info("createProducer::producer getting initializing",{producer:{id:"GETTING_CREATED",status:"initializing",kind:t,appData:null==n?void 0:n.appData}}),e.abrupt("return");case 5:return this.producerCreationStatus.set(t,"INITIALIZING"),e.next=8,Promise.race([this.sendTransport.produce(n),new Promise((function(e){return setTimeout((function(){return e(void 0)}),6e3)}))]);case 8:if(i=e.sent){e.next=11;break}throw Dv.error("createProducer::transport_initialization_timed_out",{producer:{id:"FAILED_TO_CREATE",kind:t,status:"failed",appData:null==n?void 0:n.appData}}),this.producerCreationStatus.set(t,"NOT_INITIALIZED"),new Bv("Producer Creation timed out! ".concat(t));case 11:return this.producerCreationStatus.set(t,"INITIALIZED"),Dv.info("createProducer::initialized_producer",{producer:{id:null==i?void 0:i.id,kind:t,status:"UNKNOWN",appData:null==n?void 0:n.appData}}),i.on("transportclose",(function(){Dv.info("producer::transportclose",{producer:{id:null==i?void 0:i.id,kind:t,status:"UNKNOWN",appData:null==n?void 0:n.appData}}),o.producerCreationStatus.set(t,"NOT_INITIALIZED"),o.producers.delete(t)})),i.on("trackended",(function(){Dv.info("producer::trackended",{producer:{id:null==i?void 0:i.id,kind:t,status:"UNKNOWN",appData:null==n?void 0:n.appData}}),[wf.MIC,wf.WEBCAM].includes(t)||r()})),(a=i).score=10,this.producers.set(t,a),e.next=17,this.reconfigureWebcamLayers();case 17:return e.next=19,this.reconfigureSafariScreenshareLayers();case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"removeProducer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(i.length>1&&void 0!==i[1])||i[1],r=this.producers.get(t),e.t0=!r||r.closed,e.t0){e.next=13;break}return Dv.info("SFUHandler::remove_producer",{producer:{id:null==r?void 0:r.id,kind:t,status:"UNKNOWN",appData:null==r?void 0:r.appData},debuggingHint:"stopTrack was ".concat(n)}),n&&r.track.stop(),r.close(),e.next=9,this.socketClient.sendMessage({type:"closeProducer",payload:{producerId:r.id}});case 9:return this.producerCreationStatus.set(t,"NOT_INITIALIZED"),this.producers.delete(t),e.next=13,this.reconfigureWebcamLayers();case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"stopAllProducers",value:function(){var e=this;
2Array.from(this.producers.keys()).forEach((function(t){e.removeProducer(t)}))}},{key:"stopAllTransports",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.sendTransport){try{this.sendTransport.close()}catch(t){Dv.error("stopAllTransports",{error:t})}this.sendTransport=void 0}if(this.recvTransport){try{this.recvTransport.close()}catch(t){Dv.error("SFUHandler::stopAllTransports::error",t)}this.recvTransport=void 0}case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"reconfigureWebcamLayers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(jc.hasFeature(Jf)){e.next=2;break}return e.abrupt("return");case 2:if(t=this.producers.get(wf.WEBCAM),e.t0=t,!e.t0){e.next=7;break}return e.next=7,t.setMaxSpatialLayer(this.producers.get(wf.SCREENSHARE_VIDEO)?0:1);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"reconfigureSafariScreenshareLayers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(jc.hasFeature(Wf)&&ff.isSafari()){e.next=2;break}return e.abrupt("return");case 2:if(t=this.producers.get(wf.SCREENSHARE_VIDEO)){e.next=5;break}return e.abrupt("return");case 5:(n=t.rtpSender.getParameters()).encodings=bf,t.rtpSender.setParameters(n);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restartIceTillSuccess",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=a.length>1&&void 0!==a[1]?a[1]:3,r=!1,i=0;case 2:if(r||!(i<n)){e.next=15;break}return e.prev=3,Dv.info("SFUHandler.restartIceTillSuccess.AttemptRestart",{iceRestart:{currentAttempt:i,isSendTransport:"send"===t.direction,isRecvTransport:"recv"===t.direction}}),e.next=7,this.restartIce(t);case 7:r=!0,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),i+=1;case 13:e.next=2;break;case 15:if(r){e.next=17;break}throw new Bv("Failed to restart Ice");case 17:case"end":return e.stop()}}),e,this,[[3,10]])})));return function(t){return e.apply(this,arguments)}}()}]),n}(Ns);Yb([Lv.trace("SFUHandler.setupTransports")],Xb.prototype,"setupTransports",1),Yb([Lv.trace("SFUHandler.loadRouter")],Xb.prototype,"loadRouter",1),Yb([Lv.trace("SFUHandler.createRecvTransport")],Xb.prototype,"createRecvTransport",1),Yb([Lv.trace("SFUHandler.createSendTransport")],Xb.prototype,"createSendTransport",1),Yb([Lv.trace("SFUHandler.restartIce")],Xb.prototype,"restartIce",1),Yb([Lv.trace("SFUHandler.createConsumer")],Xb.prototype,"createConsumer",1),Yb([Lv.trace("SFUHandler.closeConsumer")],Xb.prototype,"closeConsumer",1),Yb([Lv.trace("SFUHandler.cleanupConsumers")],Xb.prototype,"cleanupConsumers",1),Yb([Lv.trace("SFUHandler.pauseConsumer")],Xb.prototype,"pauseConsumer",1),Yb([Lv.trace("SFUHandler.resumeConsumer")],Xb.prototype,"resumeConsumer",1),Yb([Lv.trace("SFUHandler.createProducer")],Xb.prototype,"createProducer",1),Yb([Lv.trace("SFUHandler.removeProducer")],Xb.prototype,"removeProducer",1),Yb([Lv.trace("SFUHandler.stopAllProducers")],Xb.prototype,"stopAllProducers",1),Yb([Lv.trace("SFUHandler.stopAllTransports")],Xb.prototype,"stopAllTransports",1);var ek=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"emit",value:function(e){for(var t,r,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return(t=l((0,u.Z)(n.prototype),"emit",this)).call.apply(t,[this,"*",e].concat(a)),(r=l((0,u.Z)(n.prototype),"emit",this)).call.apply(r,[this,e].concat(a))}},{key:"on",value:function(e,t){return l((0,u.Z)(n.prototype),"on",this).call(this,e,t)}},{key:"addListener",value:function(e,t){return l((0,u.Z)(n.prototype),"addListener",this).call(this,e,t)}},{key:"off",value:function(e,t){return l((0,u.Z)(n.prototype),"off",this).call(this,e,t)}},{key:"once",value:function(e,t){return l((0,u.Z)(n.prototype),"once",this).call(this,e,t)}},{key:"prependListener",value:function(e,t){return l((0,u.Z)(n.prototype),"prependListener",this).call(this,e,t)}},{key:"prependOnceListener",value:function(e,t){return l((0,u.Z)(n.prototype),"prependOnceListener",this).call(this,e,t)}},{key:"removeListener",value:function(e,t){return l((0,u.Z)(n.prototype),"removeListener",this).call(this,e,t)}},{key:"removeAllListeners",value:function(e){return l((0,u.Z)(n.prototype),"removeAllListeners",this).call(this,e)}},{key:"listeners",value:function(e){return l((0,u.Z)(n.prototype),"listeners",this).call(this,e)}},{key:"listenerCount",value:function(e){return l((0,u.Z)(n.prototype),"listenerCount",this).call(this,e)}}]),n}(Ns.EventEmitter),tk=Object.defineProperty,nk=Object.getOwnPropertyDescriptor,rk=function(e){return e.REQUEST="REQUEST",e.ACCEPT="ACCEPT",e.REJECT="REJECT",e.END="END",e.EVENT="EVENT",e}(rk||{}),ik=function(e){return e.PENDING="PENDING",e.ACCEPTED="ACCEPTED",e.REJECTED="REJECTED",e.ENDED="ENDED",e}(ik||{}),ak=function(e){return e.KEYBOARD="KEYBOARD",e.MOUSE="MOUSE",e}(ak||{}),ok=function(e){return e.LEFT_CLICK="click",e.RIGHT_CLICK="contextmenu",e.MOVE="mousemove",e}(ok||{}),sk=function(e){return e.REQUEST_RECEIVED="REQUEST_RECEIVED",e.REQUEST_SENT="REQUEST_SENT",e.INCOMING_REQUEST_ACCEPTED="INCOMING_REQUEST_ACCEPTED",e.OUTGOING_REQUEST_ACCEPTED="OUTGOING_REQUEST_ACCEPTED",e.INCOMING_REQUEST_ENDED="INCOMING_REQUEST_ENDED",e.OUTGOING_REQUEST_ENDED="OUTGOING_REQUEST_ENDED",e}(sk||{}),ck=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"id"),Cs((0,f.Z)(r),"remotePeerId"),Cs((0,f.Z)(r),"hostPeerId"),Cs((0,f.Z)(r),"state");var i=e.remotePeerId,a=e.requestId,o=e.hostPeerId,s=e.state;return r.id=a,r.remotePeerId=i,r.hostPeerId=o,r.state=s,r}return(0,y.Z)(n)}(ek);ck=function(e,t,n,r){for(var i,a=r>1?void 0:r?nk(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&tk(t,n,a),a}([zv((function(e){throw new Bv(e.message,"1400")}))],ck);var uk,lk,dk,pk,hk=Object.defineProperty,fk=Object.getOwnPropertyDescriptor,vk=function(e,t,n,r){for(var i,a=r>1?void 0:r?fk(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&hk(t,n,a),a},mk=(dk=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),uk,void 0),Cs((0,f.Z)(r),"isV2AuthToken"),Ms((0,f.Z)(r),lk,void 0),Cs((0,f.Z)(r),"legacyMode"),Cs((0,f.Z)(r),"roomNodeUrl"),Cs((0,f.Z)(r),"peerDisplayName");var i=e.roomName,a=e.roomNodeUrl,o=e.peerId,s=e.authToken,c=e.legacyMode,u=e.socketClient,l=e.meetingTitle;return r.roomName=i,r.roomNodeUrl=a,r.peerId=o,r.authToken=s,r.legacyMode=c,As((0,f.Z)(r),uk,u),r.roomJoined=!1,r.meetingTitle=l,r.isV2AuthToken=Wv.isV2AuthToken,As((0,f.Z)(r),lk,new Xb(u,e.device)),Ic.legacySwitch(c),r}return(0,y.Z)(n,[{key:"sfuHandler",get:function(){return Zs(this,lk)}},{key:"reconnect",value:function(){Zs(this,uk).reconnect()}},{key:"setupTransports",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.setupTransports();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"handleSocketCallbacks",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.type,e.next=e.t0===cm.NEW_CONSUMER?3:4;break;case 3:return e.abrupt("return",this.sfuHandler.createConsumer(t.payload));case 4:return e.abrupt("return",null);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"handleSockets",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=17;break}
2e.t0=((!Lv.logExclusionList.includes(null==t?void 0:t.type)||jc.hasFeature(zf))&&Dv.info("RoomNodeClient::handleSockets::".concat(null==t?void 0:t.type)),t.type),e.next=e.t0===cm.CONSUMER_CLOSED?4:e.t0===cm.CONSUMER_PAUSED?6:e.t0===cm.CONSUMER_RESUMED?8:e.t0===cm.CONSUMER_SCORE?10:e.t0===cm.PRODUCER_SCORE?12:e.t0===cm.PRODUCER_CLOSED?14:16;break;case 4:return this.sfuHandler.closeConsumer(t.payload),e.abrupt("break",16);case 6:return this.sfuHandler.pauseConsumer(t.payload),e.abrupt("break",16);case 8:return this.sfuHandler.resumeConsumer(t.payload),e.abrupt("break",16);case 10:return this.handleConsumerScore(t.payload),e.abrupt("break",16);case 12:return this.handleProducerScore(t.payload),e.abrupt("break",16);case 14:return this.handleProducerClosed(t.payload),e.abrupt("break",16);case 16:"function"==typeof n&&n();case 17:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i){var a,o,c,u,l,d,f=this,v=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=v.length>4&&void 0!==v[4]?v[4]:{},this.peerDisplayName=t,this.roomUUID=r,e.next=4,Zs(this,uk).sendMessage({type:"joinRoom",payload:{device:ff.getDeviceInfo(),displayName:t,rtpCapabilities:this.sfuHandler.getRTPCapabilities(),isLegacy:this.legacyMode,audioMuted:n}});case 4:if(l=e.sent,null==(o=l.payload)||!o.waitlisted){e.next=7;break}return e.abrupt("return",(sm.emit(cm.WAITLISTED),{roomJoined:!1}));case 7:if(null==(u=null==(c=l.payload)?void 0:c.waitlistedPeers)||u.forEach((function(e){sm.emit(cm.WAITLIST_PEER_ADDED,e)})),this.legacyMode=l.payload.legacyMode||this.legacyMode,e.t0=i&&""!==i,!e.t0){e.next=13;break}return e.next=13,this.changeRoomDisplayTitle(i);case 13:return this.maxPreferredStreams=l.payload.maxPreferredStreams,this.roomJoined=!0,d=Xy(),Dv.info("RoomNodeClient::joinRoom::pre emitasync room_joined"),e.prev=17,e.next=20,sm.emitAsync(cm.ROOM_JOINED,l.payload);case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(17),Dv.error("RoomNodeClient::joinRoom::emitAsync",{error:e.t1});case 25:return e.abrupt("return",(Dv.info("RoomNodeClient::joinRoom::post emitasync room_joined"),sm.emit(cm.SELF_ROOM_JOINED),jc.hasFeature(Pf)&&"ReactNative"!==navigator.product&&setTimeout((0,h.Z)((0,p.Z)().mark((function e(){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.getUserDetails();case 2:n=e.sent,r={userId:Wv.isV2AuthToken?n.participant.id:n.id,peerId:f.peerId,displayName:t,roomUUID:f.roomUUID,roomViewType:"groupCall",roomName:f.roomName,deviceInfo:(0,s.Z)((0,s.Z)({},ff.getDeviceInfo()),{},{userAgent:navigator.userAgent,memory:navigator.deviceMemory,cpus:navigator.hardwareConcurrency}),metaData:{},permissions:{}},Ic.roomJoined(r),null!=a&&a.audio?Ic.audioOn():Ic.audioOff(),null!=a&&a.video?Ic.videoOn():Ic.videoOff();case 5:case"end":return e.stop()}}),e)})))),{roomJoined:!0}));case 26:case"end":return e.stop()}}),e,this,[[17,22]])})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"leaveRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sfuHandler.stopAllProducers(),e.next=3,this.sfuHandler.stopAllTransports();case 3:Zs(this,uk).disconnect(),Ic.callEnded(),Lv.destruct();case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"handleProducerClosed",value:function(e){var t=this,n=e.id;this.sfuHandler.producers.forEach((function(e,r){e.id===n&&t.sfuHandler.removeProducer(r)}))}},{key:"getConsumers",value:function(){return this.sfuHandler.consumers}},{key:"handleConsumerScore",value:function(e){var t,n=e.id,r=e.score,i=Zs(this,lk).consumers.get(n);i&&(i.score=r&&void 0!==r.producerScore&&r.producerScore>=0?r.producerScore:null!=(t=null==r?void 0:r.score)?t:10,sm.emit(cm.CONSUMER_SCORE_UPDATE,{id:i.id,kind:i.kind,peerId:i.peerId,score:i.score}))}},{key:"handleProducerScore",value:function(e){var t=e.id,n=e.score,r=(0,o.Z)(Zs(this,lk).producers.values()).find((function(e){return e.id===t}));if(r){if(r){var i=mk.getComputedScore(n);void 0!==i&&i!==r.score&&(r.score=i,sm.emit(cm.PRODUCER_SCORE_UPDATE,{id:r.id,kind:r.kind,appData:r.appData,score:r.score}))}}else Dv.error("RoomNodeClient::producer_not_found. ProducerId: ".concat(t))}},{key:"shareWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return");case 2:if(!this.sfuHandler.producers.has(wf.WEBCAM)){e.next=12;break}if((n=this.sfuHandler.producers.get(wf.WEBCAM)).closed){e.next=10;break}return e.next=7,n.replaceTrack({track:t});case 7:return e.next=9,this.resumeWebcam();case 9:return e.abrupt("return");case 10:return e.next=12,this.sfuHandler.removeProducer(wf.WEBCAM,!1);case 12:if(r=gf,i=this.sfuHandler.getRTPCapabilities().codecs.find((function(e){return"video/vp9"===e.mimeType.toLowerCase()}))||void 0,a=this.sfuHandler.getRTPCapabilities().codecs.find((function(e){return"video/vp8"===e.mimeType.toLowerCase()}))||void 0,o=jc.getValue(Xf),i&&!this.legacyMode)r=_f;else if(void 0!==o)try{r=JSON.parse(o)}catch(n){Dv.error("Failed to parse flagsmith simulcast")}return s=function(){return l.legacyMode?a:i},c={track:t,encodings:jc.hasFeature(Yf)?void 0:r,codecOptions:{videoGoogleStartBitrate:1e3},codec:s(),appData:{screenShare:!1},stopTracks:!1},u=function(){l.disableWebcam()},e.next=18,this.sfuHandler.createProducer(wf.WEBCAM,c,u);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"shareScreen",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.video,a=t.audio,void 0!==i){e.next=3;break}return e.abrupt("return");
2case 3:return jc.hasFeature(Wf)&&(o=yf),s={track:i,appData:{screenShare:!0,supportsRemoteControl:ff.isElectron()},encodings:o,stopTracks:!1},c=function(){d.disableScreenShare()},Ic.screenShareRequested(),e.next=9,this.sfuHandler.createProducer(wf.SCREENSHARE_VIDEO,s,c);case 9:if(u={opusDtx:!1,opusStereo:!1,opusFec:!0,forceGoogConference:!1},jc.hasFeature($f)&&(u.forceGoogConference=!0),!a){e.next=15;break}return l={track:a,codecOptions:u,appData:{screenShare:!0,supportsRemoteControl:ff.isElectron()},stopTracks:!1},c=function(){},e.next=15,this.sfuHandler.createProducer(wf.SCREENSHARE_AUDIO,l,c);case 15:Ic.screenShareStart(null==(r=null==(n=this.sfuHandler.producers.get(wf.SCREENSHARE_VIDEO))?void 0:n.rtpParameters.encodings[0])?void 0:r.ssrc);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"shareMic",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==t){e.next=2;break}return e.abrupt("return");case 2:if(!this.sfuHandler.producers.has(wf.MIC)){e.next=12;break}if((n=this.sfuHandler.producers.get(wf.MIC)).closed){e.next=10;break}return e.next=7,n.replaceTrack({track:t});case 7:return e.next=9,this.resumeMic();case 9:return e.abrupt("return");case 10:return e.next=12,this.sfuHandler.removeProducer(wf.MIC,!1);case 12:return r={track:t,codecOptions:{opusDtx:!1,opusStereo:!1,opusFec:!0,opusMaxAverageBitrate:16e3},stopTracks:!1},i=function(){a.disableMic()},e.next=15,this.sfuHandler.createProducer(wf.MIC,r,i);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pauseMic",value:function(){var e=this.sfuHandler.producers.get(wf.MIC);e?(e.pause(),Zs(this,uk).sendMessage({type:"pauseProducer",payload:{producerId:e.id}})):Dv.error("pauseMic::could_not_find_mic_producer")}},{key:"pauseWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.sfuHandler.producers.get(wf.WEBCAM)){e.next=4;break}return Dv.error("pauseWebcam::could_not_find_webcam_producer"),e.abrupt("return");case 4:return t.pause(),e.next=7,Zs(this,uk).sendMessage({type:"pauseProducer",payload:{producerId:t.id}});case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resumeMic",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.sfuHandler.producers.get(wf.MIC)){e.next=4;break}return Dv.error("resumeMic::could_not_find_mic_producer"),e.abrupt("return");case 4:return t.resume(),e.next=7,Zs(this,uk).sendMessage({type:"resumeProducer",payload:{producerId:t.id}});case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resumeWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.sfuHandler.producers.get(wf.WEBCAM)){e.next=4;break}return Dv.error("resumeWebcam::could_not_find_webcam_producer"),e.abrupt("return");case 4:return t.resume(),e.next=7,Zs(this,uk).sendMessage({type:"resumeProducer",payload:{producerId:t.id}});case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableWebcam",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.removeProducer(wf.WEBCAM);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableMic",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sfuHandler.removeProducer(wf.MIC);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Dv.info("screen_sharing_stopped"),Ic.screenShareStop(null==(n=null==(t=this.sfuHandler.producers.get(wf.SCREENSHARE_VIDEO))?void 0:t.rtpParameters.encodings[0])?void 0:n.ssrc),e.next=4,this.sfuHandler.removeProducer(wf.SCREENSHARE_VIDEO);case 4:return e.next=6,this.sfuHandler.removeProducer(wf.SCREENSHARE_AUDIO);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resetVideoProducers",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t,!e.t0){e.next=5;break}return e.next=4,this.sfuHandler.removeProducer(wf.WEBCAM,!1);case 4:this.shareWebcam(t);case 5:if(e.t1=n,!e.t1){e.next=10;break}return e.next=9,this.sfuHandler.removeProducer(wf.SCREENSHARE_VIDEO,!1);case 9:this.shareScreen({video:n});case 10:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getRoomState",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"getRoomState"}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"changeRoomDisplayTitle",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"changeDisplayTitle",payload:{dis
2playTitle:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"broadcastMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={payload:n,type:t},e.abrupt("return",Zs(this,uk).sendMessage({type:"roomMessage",payload:r}));case 2:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendChatMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"chatMessage",payload:t});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getChatMessages",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"getChatMessages"}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pinChatMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"pinChatMessage",payload:t}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unpinChatMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"unpinChatMessage",payload:t}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPolls",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"getPolls"}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"newPoll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"newPoll",payload:t});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"votePoll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"votePoll",payload:t});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"acceptWaitingRequest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"acceptWaitingRequest",payload:{id:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rejectWaitingRequest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"rejectWaitingRequest",payload:{id:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"muteAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"muteAllNew",payload:{allowUnMute:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"muteAllVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"muteAllVideo"});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pinPeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"pinPeer",payload:{id:t}}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unpinPeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"unpinPeer",payload:{id:t}}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"disableAudioPeerNew",payload:{id:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"disableVideoPeer",payload:{id:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"kickAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"kickAll"});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"kick",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,uk).sendMessage({type:"kick",payload:{id:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"getPage",payload:{pageNum:t}}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"muteSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.pauseMic(),e.next=3,Zs(this,uk).sendMessage({type:"muteSelf"});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"unmuteSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.resumeMic();case 2:return e.next=4,Zs(this,uk).sendMessage({type:"unmuteSelf"});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"addRoomPlugin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"addPlugin",payload:t}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeRoomPlugin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"removePlugin",payload:t}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"remoteControlMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:"message",payload:t}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"requestRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.remoteControlMessage({peerId:t.hostPeerId,remoteRequestId:t.id,hostPeerId:t.hostPeerId,remotePeerId:t.remotePeerId,remoteRequestType:rk.REQUEST}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"acceptRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.remoteControlMessage({peerId:t.remotePeerId,remoteRequestId:t.id,hostPeerId:t.hostPeerId,remotePeerId:t.remotePeerId,remoteRequestType:rk.ACCEPT}));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"terminateRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.remoteControlMessage({peerId:t,remoteRequestId:n.id,hostPeerId:n.hostPeerId,remotePeerId:n.remotePeerId,remoteRequestType:rk.END}));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendEventRemoteControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.remoteControlMessage({peerId:t,remoteRequestId:n,remoteEvent:r,hostPeerId:this.peerId,remotePeerId:t,remoteRequestType:rk.EVENT}));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"assertSpotlight",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,uk).sendMessage({type:t,payload:(0,s.Z)((0,s.Z)({},n),{},{roomMessageType:"spotlight"})}));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"assertSpotlightToRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.assertSpotlight("roomMessage",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"assertSpotlightToPeer",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.assertSpotlight("message",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"requestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendMessage({type:"requestToJoinStage",payload:t});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"withdrawRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendMessage({type:"withdrawRequestToJoinStage"});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"acceptAllRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendMessage({type:"acceptAllRequestToJoinStage",payload:t.map((function(e){return(0,s.Z)((0,s.Z)({},e),{},{type:nm.REQUESTED_BY_MODERATOR})}))});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removePeerFromStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendMessage({type:"removePeerFromStage",payload:{id:t,type:n}});case 2:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"stopAllProducers",value:function(){Zs(this,lk).stopAllProducers()}},{key:"startPresenting",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendMessage({type:"startPresenting"});case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"stopPresenting",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.stopAllProducers(),e.next=3,this.sendMessage({type:"stopPresenting"});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"rejectRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendMessage({type:"rejectRequestToJoinStage",payload:{id:t}});case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.legacyMode,r=void 0===n||n,i=t.roomName,a=t.peerId,o=t.authToken,s=t.meetingTitle,c=t.device,l="".concat(t.roomNodeUrl,"?roomURL=").concat(i,"&peerId=").concat(a,"&authToken=").concat(o,"&version=0.5.0"),d=new $b({callbackHandler:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.handleSocketCallbacks(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),e.abrupt("return",(d.on(Hb.SOCKET_MESSAGE,function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.handleSockets(t,n);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),d.connect(l),u=new mk({legacyMode:r,authToken:o,peerId:a,roomName:i,roomNodeUrl:l,socketClient:d,meetingTitle:s,device:c}),d.on(Hb.SOCKET_DISCONNECTED,(function(e){var t,n;u.isDisconnected=!0,null==(t=u.sfuHandler)||t.cleanupConsumers(),null==(n=u.sfuHandler)||n.stopAllTransports(),sm.emit(cm.ROOM_NODE_DISCONNECTED,e),u.roomJoined=!1,Dv.info("ROOM_NODE_DISCONNECTED")})),d.on(Hb.SOCKET_CONNECTED,function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:sm.emit(cm.ROOM_NODE_CONNECTED,t),u.isDisconnected,u.isDisconnected=!1,Dv.info("ROOM_NODE_CONNECTED");case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),d.on(Hb.SOCKET_CONNECTION_ERROR,function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.err,u.isDisconnected=!0,null==(r=u.sfuHandler)||r.cleanupConsumers(),sm.emit(cm.ROOM_NODE_CONNECTION_ERROR,n),u.roomJoined=!1;case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),u));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getComputedScore",value:function(e){var t,n,r=0;try{r=Array.isArray(e)?1===e.length?e[0].score:e.map((function(e){var t=e.score;return null!=t?t:10})).filter((function(e){return e>0})).reduce((function(e,t){return e+t}),0)/e.length:null!=(t=null==e?void 0:e.score)?t:10}catch(i){r=null!=(n=null==e?void 0:e.score)?n:10}return r}}]),n}(sb),uk=new WeakMap,lk=new WeakMap,dk),gk=mk;function yk(e){return bk.apply(this,arguments)}function bk(){retur
2n bk=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!pk){e.next=2;break}throw new Error("Room Node Client already setup");case 2:return e.next=4,zb.init(t);case 4:pk=e.sent;case 5:case"end":return e.stop()}}),e)}))),bk.apply(this,arguments)}function kk(e){return _k.apply(this,arguments)}function _k(){return _k=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==pk||!pk.roomJoined){e.next=2;break}throw new Error("Room Node Client already setup");case 2:return pk&&(pk=void 0),e.next=5,gk.init(t);case 5:pk=e.sent;case 6:case"end":return e.stop()}}),e)}))),_k.apply(this,arguments)}function wk(){return xk.apply(this,arguments)}function xk(){return(xk=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:pk=void 0;case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sk(){return pk}function Ek(e){var t,n,r,i,a,o,s,c,u,l,d,p,h;return e?{media:{audio:{enabled:e.audioEnabled,trackId:null==(t=e.audioTrack)?void 0:t.id,permission:"mediaPermissions"in e?null==(n=e.mediaPermissions)?void 0:n.audio:null},video:{enabled:e.videoEnabled,trackId:null==(r=e.videoTrack)?void 0:r.id,permission:"mediaPermissions"in e?null==(i=e.mediaPermissions)?void 0:i.video:null},screenshare:{enabled:e.screenShareEnabled,permission:"mediaPermissions"in e?null==(a=e.mediaPermissions)?void 0:a.screenshare:null,audio:{enabled:null==(s=null==(o=e.screenShareTracks)?void 0:o.audio)?void 0:s.enabled,trackId:null==(u=null==(c=e.screenShareTracks)?void 0:c.audio)?void 0:u.id},video:{enabled:null==(d=null==(l=e.screenShareTracks)?void 0:l.video)?void 0:d.enabled,trackId:null==(h=null==(p=e.screenShareTracks)?void 0:p.video)?void 0:h.id}}}}:{}}vk([Lv.trace("RoomNodeClient.reconnect")],gk.prototype,"reconnect",1),vk([Lv.trace("RoomNodeClient.joinRoom")],gk.prototype,"joinRoom",1),vk([Lv.trace("RoomNodeClient.leaveRoom")],gk.prototype,"leaveRoom",1),vk([Lv.trace("RoomNodeClient.shareWebcam")],gk.prototype,"shareWebcam",1),vk([Lv.trace("RoomNodeClient.shareScreen")],gk.prototype,"shareScreen",1),vk([Lv.trace("RoomNodeClient.shareMic")],gk.prototype,"shareMic",1),vk([Lv.trace("RoomNodeClient.pauseMic")],gk.prototype,"pauseMic",1),vk([Lv.trace("RoomNodeClient.pauseWebcam")],gk.prototype,"pauseWebcam",1),vk([Lv.trace("RoomNodeClient.resumeMic")],gk.prototype,"resumeMic",1),vk([Lv.trace("RoomNodeClient.resumeWebcam")],gk.prototype,"resumeWebcam",1),vk([Lv.trace("RoomNodeClient.disableWebcam")],gk.prototype,"disableWebcam",1),vk([Lv.trace("RoomNodeClient.disableMic")],gk.prototype,"disableMic",1),vk([Lv.trace("RoomNodeClient.disableScreenShare")],gk.prototype,"disableScreenShare",1),vk([Lv.trace("RoomNodeClient.resetVideoProducers")],gk.prototype,"resetVideoProducers",1);var Tk=function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o,s,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.length){e.next=2;break}return e.abrupt("return",n);case 2:return r=new AudioContext,e.next=5,Promise.all(null==t?void 0:t.map((function(e){return e(r)})));case 5:for(i=e.sent,a=r.createMediaStreamSource(new MediaStream([n])),o=r.createMediaStreamDestination(),e.prev=8,s=a,c=0;c<i.length;c+=1)s.connect(i[c]),s=i[c];s.connect(o),e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(8),e.abrupt("return",(Dv.error("getTransformedAudioTrack::middleware_execution_failed",{error:e.t0}),n));case 17:return e.abrupt("return",o.stream.getAudioTracks()[0]);case 18:case"end":return e.stop()}}),e,null,[[8,14]])})));return function(t,n){return e.apply(this,arguments)}}(),Pk=Object.defineProperty,Ck=Object.getOwnPropertyDescriptor,Rk=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this),Cs((0,f.Z)(i),"constructorName",i.constructor.name),Cs((0,f.Z)(i),"userSelectedDevice"),Cs((0,f.Z)(i),"mediaInterface"),Cs((0,f.Z)(i),"_mediaTrack"),Cs((0,f.Z)(i),"transformedMediaTrack"),Cs((0,f.Z)(i),"middlewares",[]),Cs((0,f.Z)(i),"currentDevice"),i.mediaInterface=e,r&&i.setMediaTrack(r),i.userSelectedDevice=void 0,i.onTrackEnded=i.onTrackEnded.bind((0,f.Z)(i)),i.onTrackMuted=i.onTrackMuted.bind((0,f.Z)(i)),i}return(0,y.Z)(n,[{key:"disableTrack",value:function(){var e,t;this.removeMediaTrackListeners(),null==(e=this._mediaTrack)||e.stop(),this._mediaTrack=void 0,null==(t=this.transformedMediaTrack)||t.stop(),this.transformedMediaTrack=void 0}},{key:"mediaTrack",get:function(){return this._mediaTrack}},{key:"setMediaTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){Dv.error("".concat(r.constructorName,".setMediaTrack.error"),{error:e})};try{this.disableTrack()}catch(i){n(i)}return this._mediaTrack=t,e.next=5,this.setTransformedTrack();case 5:return e.prev=5,this.addMediaTrackListeners(),e.next=9,this.setCurrentDevice();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),n(e.t0);case 14:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t){return e.apply(this,arguments)}}()},{key:"trackEnabled",get:function(){return!!this.mediaTrack&&"live"===this.mediaTrack.readyState&&this.mediaTrack.enabled}},{key:"muteTrack",value:function(){this.mediaTrack?(this.transformedMediaTrack&&(this.transformedMediaTrack.enabled=!1),this.mediaTrack.enabled=!1):Dv.warn("BaseMediaHandler.muteTrack Tried muting with no track present")}},{key:"unmuteTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.mediaTrack){e.next=5;break}this.mediaTrack.enabled=!0,e.next=7;break;case 5:return e.next=7,this.enableTrack(!1);case 7:e.next=12;break;case 9:throw e.prev=9,e.t0=e.catch(0),Dv.error("".concat(this.constructorName,".unmuteTrack.error"),{error:e.t0}),this.disableTrack(),new Bv("Failed to unmute track");case 12:case"end":return e.stop()}}),e,this,[[0,9]])})));return function(){return e.apply(this,arguments)}}()},{key:"setCurrentDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mediaTrack){e.next=3;break}return this.currentDevice=void 0,e.abrupt("return");case 3:if(e.t0=(null==(t=this.currentDevice)?void 0:t.deviceId)!==this.mediaTrack.getSettings().deviceId,!e.t0){e.next=8;break}return e.next=7,this.mediaInterface.getDevice(this.mediaTrack.getSettings().deviceId);case 7:this.currentDevice=e.sent;case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"addMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ff.isSafari()){e.next=2;break}return e.abrupt("return",{success:!1,message:"Middlewares are not yet supported in Safari."});case 2:if(!this.middlewares.includes(t)){e.next=4;break}return e.abrupt("return",{success:!1,message:"This middleware has been applied, already. Skipping."});case 4:if(e.prev=4,e.t0=this.trackEnabled,!e.t0){e.next=9;break}return e.next=9,this.setTransformedTrack();case 9:return this.middlewares.push(t),e.abrupt("return",{success:!0,message:"Successfully added the middleware."});case 13:return e.prev=13,e.t1=e.catch(4),e.abrupt("return",(Dv.error("While adding middleware",{error:e.t1}),{success:!1,message:null==e.t1?void 0:e.t1.message}));case 16:case"end":return e.stop()}}
2),e,this,[[4,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"removeMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=this.middlewares.indexOf(t,0))>-1)){e.next=12;break}return e.prev=2,e.next=5,this.setTransformedTrack();case 5:return this.middlewares.splice(n,1),e.abrupt("return",{success:!0,message:"Successfully removed the middleware."});case 9:return e.prev=9,e.t0=e.catch(2),e.abrupt("return",(Dv.error("While removing middleware",{error:e.t0}),{success:!1,message:null==e.t0?void 0:e.t0.message}));case 12:return e.abrupt("return",{success:!1,message:"No such middleware was found. Skipping."});case 13:case"end":return e.stop()}}),e,this,[[2,9]])})));return function(t){return e.apply(this,arguments)}}()},{key:"addMediaTrackListeners",value:function(){var e,t,n;this.mediaTrack&&(Dv.info("".concat(this.constructorName,".addMediaTrackListeners for deviceId ").concat(null==(t=null==(e=this.mediaTrack)?void 0:e.getSettings())?void 0:t.deviceId," of type ").concat(null==(n=this.mediaTrack)?void 0:n.kind)),this.mediaTrack.addEventListener("ended",this.onTrackEnded),this.mediaTrack.addEventListener("mute",this.onTrackMuted))}},{key:"removeMediaTrackListeners",value:function(){var e,t,n;this.mediaTrack&&(Dv.info("".concat(this.constructorName,".removeMediaTrackListeners for deviceId ").concat(null==(t=null==(e=this.mediaTrack)?void 0:e.getSettings())?void 0:t.deviceId," of type ").concat(null==(n=this.mediaTrack)?void 0:n.kind)),Dv.info("".concat(this.constructorName,".removeMediaTrackListeners")),this.mediaTrack.removeEventListener("ended",this.onTrackEnded),this.mediaTrack.removeEventListener("mute",this.onTrackMuted))}}]),n}(ek);Rk=function(e,t,n,r){for(var i,a=r>1?void 0:r?Ck(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Pk(t,n,a),a}([zv((function(e){throw new Bv(e.message,"1600")}))],Rk);var Zk=Rk,Mk=Object.defineProperty,Ak=Object.getOwnPropertyDescriptor,Ik=function(e,t,n,r){for(var i,a=r>1?void 0:r?Ak(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Mk(t,n,a),a},Ok=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"setDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw Dv.warn("AudioMediaHandler.setDevice No device received"),new Bv("No device received!","1603");case 2:if("audioinput"===t.kind){e.next=4;break}throw Dv.warn("AudioMediaHandler.setDevice Received non audio device"),new Bv("Non audio device received while setting device!","1603");case 4:return e.prev=4,n=this.trackEnabled,this.userSelectedDevice=t.deviceId,e.t0=this,e.next=10,this.mediaInterface.getAudioTrack(!n,t.deviceId);case 10:return e.t1=e.sent,e.next=13,e.t0.setMediaTrack.call(e.t0,e.t1);case 13:e.next=18;break;case 15:throw e.prev=15,e.t2=e.catch(4),Dv.error("AudioMediaHandler.setDevice.error",{error:e.t2}),this.disableTrack(),new Bv(e.t2.message,"1604");case 18:case"end":return e.stop()}}),e,this,[[4,15]])})));return function(t){return e.apply(this,arguments)}}()},{key:"enableTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.trackEnabled){e.next=3;break}return Dv.warn("AudioMediaHandler.enableTrack Track already enabled!"),e.abrupt("return");case 3:return e.next=5,this.mediaInterface.getAudioTrack(t,this.userSelectedDevice);case 5:return n=e.sent,e.next=8,this.setMediaTrack(n);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setTransformedTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(t=this.middlewares)&&t.length){e.next=3;break}return this.transformedMediaTrack=this.mediaTrack,e.abrupt("return");case 3:return e.prev=3,e.next=6,Tk(this.middlewares,this.mediaTrack);
2case 6:this.transformedMediaTrack=e.sent,this.emit("trackChanged"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),Dv.error("AudioMediaHandler.setTransformedTrack",{error:e.t0}),this.transformedMediaTrack=this.mediaTrack;case 13:case"end":return e.stop()}}),e,this,[[3,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"onTrackEnded",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Dv.info("AudioMediaHandler.TrackEnded"),this.emit("trackEnded"),t=this.mediaTrack.enabled,this.disableTrack(),e.next=5,this.enableTrack(!t);case 5:return e.next=7,this.setTransformedTrack();case 7:this.emit("trackChanged");case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onTrackMuted",value:function(){Dv.info("AudioMediaHandler.TrackMuted"),this.emit("trackMuted")}}]),n}(Zk);Ik([Lv.trace("AudioMediaHandler.setTransformedTrack")],Ok.prototype,"setTransformedTrack",1),Ik([Lv.trace("AudioMediaHandler.onTrackEnded")],Ok.prototype,"onTrackEnded",1);var Lk=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i){var a;return(0,g.Z)(this,n),a=t.call(this,r),Cs((0,f.Z)(a),"constraints"),Cs((0,f.Z)(a),"name"),a.name=e,a.constraints=i,a}return(0,y.Z)(n)}((0,a.Z)(Error));function Dk(e,t){if(ff.isChromiumBased()){if("NotAllowedError"===e)return t.indexOf("by system")>0?"SYSTEM_DENIED":"DENIED";if("NotReadableError"===e)return"COULD_NOT_START"}else if(ff.isSafari()){if("NotAllowedError"===e)return"DENIED"}else if(ff.isFirefox()){if("NotFoundError"===e||"NotReadableError"===e)return"SYSTEM_DENIED";if("NotAllowedError"===e)return"DENIED";if("AbortError"===e)return"COULD_NOT_START"}return"COULD_NOT_START"}function Nk(e){return e===2..toString()?Gs.DENIED:e===3..toString()?Gs.SYS_DENIED:e===1..toString()?Gs.ACCEPTED:Gs.FAILED}var jk,Bk,Uk=function(){function e(){(0,g.Z)(this,e),Cs(this,"permissions"),this.permissions={audio:"NOT_REQUESTED",video:"NOT_REQUESTED",screenshare:"NOT_REQUESTED"}}return(0,y.Z)(e,[{key:"getAudioInputDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAvailableDevices();case 2:return e.abrupt("return",e.sent.filter((function(e){return"audioinput"===e.kind})));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVideoInputDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAvailableDevices();case 2:return e.abrupt("return",e.sent.filter((function(e){return"videoinput"===e.kind})));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAudioOutputDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAvailableDevices();case 2:return e.abrupt("return",e.sent.filter((function(e){return"audiooutput"===e.kind})));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),Vk=Object.defineProperty,Fk=Object.getOwnPropertyDescriptor,zk=(Bk=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),jk,void 0),As((0,f.Z)(r),jk,new vv(e)),r}return(0,y.Z)(n,[{key:"handlePermissionErrors",value:function(e,t){var n=Dk(t.name,t.message);this.permissions[e]=n,sm.emit(cm.MEDIA_PERMISSION_ERROR,{message:n,constraints:t.constraints,kind:e})}},{key:"getAudioAndVideoTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={audio:Zs(this,jk).getAudioConstraints().audio,video:Zs(this,jk).getVideoConstraints().video},e.prev=1,e.next=4,navigator.mediaDevices.getUserMedia(t);case 4:return n=e.sent,r=n.getAudioTracks()[0],i=n.getVideoTracks()[0],e.abrupt("return",(this.permissions.audio="ACCEPTED",this.permissions.video="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.audio,
2kind:"audio"}),sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.video,kind:"video"}),{audioTrack:r,videoTrack:i}));case 10:if(e.prev=10,e.t0=e.catch(1),"NotAllowedError"!==e.t0.name){e.next=20;break}return e.next=15,this.getAudioTrack(!1);case 15:return a=e.sent,e.next=18,this.getVideoTrack();case 18:return o=e.sent,e.abrupt("return",{audioTrack:a,videoTrack:o});case 20:throw Dv.error("WebMediaInterface.getAudioAndVideoTrack",{error:e.t0}),new Bv("Couldnt fetch audio and video track");case 21:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"getAudioTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Zs(this,jk).getAudioConstraints(n),e.prev=1,e.next=4,navigator.mediaDevices.getUserMedia(r);case 4:return i=e.sent.getAudioTracks()[0],e.abrupt("return",(i.enabled=!t,this.permissions.audio="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.audio,kind:"audio"}),i));case 8:throw e.prev=8,e.t0=e.catch(1),this.handlePermissionErrors("audio",new Lk(e.t0.name,e.t0.message,r)),new Bv(e.t0.message,"1601");case 11:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getScreenShareTracks",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Zs(this,jk).getScreenShareConstraints(),e.prev=1,e.next=4,navigator.mediaDevices.getDisplayMedia(t);case 4:return n=e.sent,e.abrupt("return",(this.permissions.screenshare="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.screenshare,kind:"screenshare"}),{audioTrack:n.getAudioTracks()[0],videoTrack:n.getVideoTracks()[0]}));case 8:throw e.prev=8,e.t0=e.catch(1),this.handlePermissionErrors("screenshare",new Lk(e.t0.name,e.t0.message,t)),Dv.error("WebMediaInterface.getScreenShareTracks Error while fetching screenshare tracks",{error:e.t0}),new Bv("Couldnt fetch screen share tracks");case 11:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(){return e.apply(this,arguments)}}()},{key:"getVideoTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Zs(this,jk).getVideoConstraints(t),e.prev=1,e.next=4,navigator.mediaDevices.getUserMedia(n);case 4:return r=e.sent.getVideoTracks()[0],e.abrupt("return",(this.permissions.video="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.video,kind:"audio"}),r));case 8:throw e.prev=8,e.t0=e.catch(1),this.handlePermissionErrors("video",new Lk(e.t0.name,e.t0.message,n)),Dv.error("WebMediaInterface.getVideoTrack Error while fetching video track",{error:e.t0}),new Bv("Couldnt fetch video track");case 11:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getAvailableDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",navigator.mediaDevices.enumerateDevices());case 4:throw e.prev=4,e.t0=e.catch(0),Dv.error("enumerate_devices_failed",{error:e.t0}),new Bv("Failed to get available devices");case 7:case"end":return e.stop()}}),e,null,[[0,4]])})));return function(){return e.apply(this,arguments)}}()},{key:"getAvailableDevicesByKind",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.mediaDevices.enumerateDevices();case 3:return e.abrupt("return",e.sent.filter((function(e){var n=e.kind;return t===n})));case 6:throw e.prev=6,e.t0=e.catch(0),Dv.error("enumerate_devices_failed",{error:e.t0}),new Bv("Failed to get available devices by kind");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.mediaDevices.enumerateDevices();case 3:return e.abrupt("return",e.sent.filter((function(e){return e.deviceId===t}))[0]);case 6:throw e.prev=6,e.t0=e.catch(0),Dv.error("enumerate_devices_failed",{error:e.t0}),new Bv("Failed to get device");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}()}]),n}(Uk),jk=new WeakMap,Bk);zk=function(e,t,n,r){for(var i,a=r>1?void 0:r?Fk(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Vk(t,n,a),a}([zv((function(e){throw new Bv(e.message,"1600")}))],zk);var Hk,qk=zk,Gk=function(){function e(t){(0,g.Z)(this,e),Ms(this,Hk,void 0),Cs(this,"currentDevice"),As(this,Hk,t)}return(0,y.Z)(e,[{key:"setupSpeaker",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,Hk)instanceof qk){e.next=2;break}return e.abrupt("return");case 2:if(a=t,e.t0=t,e.t0){e.next=11;break}return e.next=7,Zs(this,Hk).getAvailableDevicesByKind("audiooutput");case 7:n=e.sent,r=(0,d.Z)(n,1),a=r[0];case 11:if(a){e.next=13;break}throw new Bv("No speaker found");case 13:(null==(i=this.currentDevice)?void 0:i.deviceId)!==a.deviceId&&(null!=this.currentDevice||(this.currentDevice=a),document.querySelectorAll("audio").forEach(function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof t.sinkId||!o.currentDevice.deviceId||t.sinkId===o.currentDevice.deviceId){e.next=8;break}return e.prev=1,e.next=4,t.setSinkId(o.currentDevice.deviceId);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()));case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();Hk=new WeakMap;var Wk,Jk=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Cs((0,f.Z)(r),"mediaInterface"),Cs((0,f.Z)(r),"audioMediaTrack"),Cs((0,f.Z)(r),"videoMediaTrack"),r.mediaInterface=e,r}return(0,y.Z)(n,[{key:"trackEnabled",get:function(){return!!this.videoMediaTrack}},{key:"enableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.mediaInterface.getScreenShareTracks();case 2:r=e.sent,i=r.audioTrack,a=r.videoTrack,this.audioMediaTrack=i,this.videoMediaTrack=a,this.addMediaTrackListeners(),"ACCEPTED"!==(null==(n=null==(t=this.mediaInterface)?void 0:t.permissions)?void 0:n.screenshare)&&this.mediaInterface.permissions&&(this.mediaInterface.permissions.screenshare="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.mediaInterface.permissions.screenshare,kind:"screenshare"}));case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableScreenShare",value:function(){var e,t;this.removeMediaTrackListeners(),null==(e=this.audioMediaTrack)||e.stop(),null==(t=this.videoMediaTrack)||t.stop(),this.videoMediaTrack=void 0,this.audioMediaTrack=void 0}},{key:"addMediaTrackListeners",value:function(){var e;null==(e=this.videoMediaTrack)||e.addEventListener("ended",this.onTrackEnded.bind(this))}},{key:"removeMediaTrackListeners",value:function(){var e;null==(e=this.videoMediaTrack)||e.removeEventListener("ended",this.onTrackEnded)}}
2,{key:"onTrackEnded",value:function(){this.emit("trackEnded")}}]),n}(ek),$k=function(){function e(){(0,g.Z)(this,e),Ms(this,Wk,void 0)}return(0,y.Z)(e,[{key:"terminateMiddlewareWebWorker",value:function(){if(Zs(this,Wk))try{ws(Zs(this,Wk)),As(this,Wk,void 0)}catch(e){Dv.debug("WorkerTimers::terminateMiddlewareWebWorker::failed")}}},{key:"getTransformedVideoTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o,s,c,u=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.length){e.next=2;break}return e.abrupt("return",n);case 2:return e.next=4,Promise.all(null==t?void 0:t.map((function(e){return e()})));case 4:r=e.sent,(i=new MediaStream).addTrack(n),a=document.createElement("canvas"),o=a.getContext("2d"),(s=document.createElement("video")).srcObject=i,s.autoplay=!0,this.terminateMiddlewareWebWorker(),c=function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==n.enabled&&"ended"!==n.readyState){e.next=3;break}return u.terminateMiddlewareWebWorker(),s.remove(),a.remove(),e.abrupt("return");case 3:e.prev=3,o.drawImage(s,0,0),t=0;case 6:if(!(t<r.length)){e.next=12;break}return e.next=9,r[t](a,o);case 9:t+=1,e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),Dv.error("getTransformedVideoTrack::middleware_execution_failed",{error:e.t0});case 17:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}();try{s.play()}catch(l){}return e.abrupt("return",(s.addEventListener("play",(function(){a.width=s.width||n.getSettings().width,a.height=s.width||n.getSettings().height,As(u,Wk,xs(c,50))}),!1),a.captureStream().getVideoTracks()[0]));case 12:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();Wk=new WeakMap;var Kk,Qk=Object.defineProperty,Yk=Object.getOwnPropertyDescriptor,Xk=function(e,t,n,r){for(var i,a=r>1?void 0:r?Yk(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Qk(t,n,a),a},e_=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this,e,r),Ms((0,f.Z)(i),Kk,void 0),As((0,f.Z)(i),Kk,new $k),i}return(0,y.Z)(n,[{key:"setDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw Dv.warn("VideoMediaHandler.setDevice No device received"),new Bv("No device received!");case 2:if("videoinput"===t.kind){e.next=4;break}throw Dv.warn("VideoMediaHandler.setDevice Received non video device",{devices:[t]}),new Bv("Non video device received while setting video device!");case 4:if(this.userSelectedDevice=t.deviceId,this.mediaTrack&&this.mediaTrack.enabled){e.next=7;break}return Dv.warn("VideoMediaHandler.setDevice Tried switching device with video disabled",{devices:[t]}),this.currentDevice=t,e.abrupt("return");case 7:return e.prev=7,e.t0=this,e.next=11,this.mediaInterface.getVideoTrack(this.userSelectedDevice);case 11:return e.t1=e.sent,e.next=14,e.t0.setMediaTrack.call(e.t0,e.t1);case 14:e.next=19;break;case 16:throw e.prev=16,e.t2=e.catch(7),Dv.error("VideoMediaHandler.setDevice.error",{error:e.t2}),this.disableTrack(),new Bv("Failed to change device");case 19:case"end":return e.stop()}}),e,this,[[7,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"enableTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.trackEnabled){e.next=3;break}return Dv.warn("VideoMediaHandler.enableTrack Track already enabled!"),e.abrupt("return");case 3:return e.t0=this,e.next=6,this.mediaInterface.getVideoTrack(this.userSelectedDevice);case 6:return e.t1=e.sent,e.next=9,e.t0.setMediaTrack.call(e.t0,e.t1);case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setTransformedTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(t=this.middlewares)&&t.length){e.next=3;break}return this.transformedMediaTrack=this.mediaTrack,e.abrupt("return");case 3:return e.prev=3,e.next=6,Zs(this,Kk).getTransformedVideoTrack(this.middlewares,this.mediaTrack);
2case 6:this.transformedMediaTrack=e.sent,this.emit("trackChanged"),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),Dv.error("VideoMediaHandler.setTransformedTrack",{error:e.t0}),this.transformedMediaTrack=this.mediaTrack;case 13:case"end":return e.stop()}}),e,this,[[3,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"terminateMiddlewareWebWorker",value:function(){Zs(this,Kk).terminateMiddlewareWebWorker()}},{key:"onTrackEnded",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Dv.info("VideoMediaHandler.TrackEnded"),this.disableTrack(),this.emit("trackEnded");case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onTrackMuted",value:function(){Dv.info("VideoMediaHandler.TrackMuted"),this.emit("trackMuted")}}]),n}(Zk);Kk=new WeakMap,Xk([Lv.trace("VideoMediaHandler.setTransformedTrack")],e_.prototype,"setTransformedTrack",1),Xk([Lv.trace("VideoMediaHandler.onTrackEnded")],e_.prototype,"onTrackEnded",1);var t_,n_,r_,i_,a_,o_=Object.defineProperty,s_=Object.getOwnPropertyDescriptor,c_=function(e,t,n,r){for(var i,a=r>1?void 0:r?s_(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&o_(t,n,a),a},u_=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),t_,void 0),Ms((0,f.Z)(r),n_,void 0),Ms((0,f.Z)(r),r_,void 0),Ms((0,f.Z)(r),i_,void 0),Ms((0,f.Z)(r),a_,void 0),As((0,f.Z)(r),t_,new qk(e)),As((0,f.Z)(r),n_,new Ok(Zs((0,f.Z)(r),t_))),As((0,f.Z)(r),r_,new e_(Zs((0,f.Z)(r),t_))),As((0,f.Z)(r),a_,new Jk(Zs((0,f.Z)(r),t_))),As((0,f.Z)(r),i_,new Gk(Zs((0,f.Z)(r),t_))),Zs((0,f.Z)(r),n_).on("trackMuted",r.onAudioTrackMuted.bind((0,f.Z)(r))),Zs((0,f.Z)(r),n_).on("trackChanged",r.onAudioTrackChanged.bind((0,f.Z)(r))),Zs((0,f.Z)(r),r_).on("trackChanged",r.onVideoTrackChanged.bind((0,f.Z)(r))),Zs((0,f.Z)(r),r_).on("trackEnded",r.onVideoTrackEnded.bind((0,f.Z)(r))),Zs((0,f.Z)(r),a_).on("trackEnded",r.onScreenShareEnded.bind((0,f.Z)(r))),r.updatePermissions(),r}return(0,y.Z)(n,[{key:"updatePermissions",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("firefox"!==ff.getName()){e.next=2;break}return e.abrupt("return");case 2:return"microphone",r="camera",e.next=6,null==(t=null==navigator?void 0:navigator.permissions)?void 0:t.query({name:"microphone"});case 6:return i=e.sent,e.next=9,null==(n=null==navigator?void 0:navigator.permissions)?void 0:n.query({name:r});case 9:a=e.sent,o=function(e,t){c.permissions[e]=t;var n={message:c.permissions[e],kind:e};"DENIED"===t?sm.emit(cm.MEDIA_PERMISSION_ERROR,n):sm.emit(cm.MEDIA_PERMISSION_UPDATE,n)},s=function(e,t){switch(t){case"granted":o(e,"ACCEPTED");break;case"denied":o(e,"DENIED")}},i&&(i.onchange=function(){return s("audio",i.state)}),a&&(a.onchange=function(){return s("video",a.state)});case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setupStreams",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.audio,r=t.video,!n||!r){e.next=12;break}return e.prev=2,e.next=5,Zs(this,t_).getAudioAndVideoTrack();case 5:o=e.sent,i=o.audioTrack,a=o.videoTrack,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),Dv.error("LocalMediaHandler::init::Failed to get audio video tracks",{error:e.t0});case 12:if(i||!n){e.next=22;break}return e.prev=13,e.next=16,Zs(this,t_).getAudioTrack(!1);case 16:i=e.sent,e.next=22;break;case 19:e.prev=19,e.t1=e.catch(13),Dv.error("LocalMediaHandler::init::Failed to get audio track",{error:e.t1});case 22:if(a||!r){e.next=32;break}return e.prev=23,e.next=26,Zs(this,t_).getVideoTrack();case 26:a=e.sent,e.next=32;break;case 29:e.prev=29,e.t2=e.catch(23),Dv.error("LocalMediaHandler::init::Failed to get video track",{error:e.t2});case 32:return e.next=34,Zs(this,n_).setMediaTrack(i);case 34:return e.next=36,Zs(this,r_).setMediaTrack(a);case 36:return e.prev=36,e.next=39,Zs(this,i_).setupSpeaker();case 39:e.next=43;break;case 41:e.prev=41,e.t3=e.catch(36);case 43:case"end":return e.stop()}}),e,this,[[2,9],[13,19],[23,29],[36,41]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getCurrentDevices",value:function(){return{audio:Zs(this,n_).currentDevice,video:Zs(this,r_).currentDevice,speaker:Zs(this,i_).currentDevice}}},{key:"permissions",get:function(){return Zs(this,t_).permissions}},{key:"getAllDevices",value:function(){return Zs(this,t_).getAvailableDevices()}},{key:"getDeviceById",value:function(e,t){return Zs(this,t_).getDevice(e)}}
2,{key:"onAudioTrackMuted",value:function(){this.emit("AUDIO_TRACK_SILENT")}},{key:"onAudioTrackChanged",value:function(){this.emit("AUDIO_TRACK_CHANGE")}},{key:"rawAudioTrack",get:function(){return Zs(this,n_).mediaTrack}},{key:"audioTrack",get:function(){return Zs(this,n_).transformedMediaTrack}},{key:"audioEnabled",get:function(){return Zs(this,n_).trackEnabled}},{key:"enableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,n_).unmuteTrack();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableAudio",value:function(){Zs(this,n_).muteTrack()}},{key:"getAudioDevices",value:function(){return Zs(this,t_).getAudioInputDevices()}},{key:"setAudioDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,n_).setDevice(t);case 2:this.emit("AUDIO_TRACK_CHANGE");case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupSpeaker",value:function(){return Zs(this,i_).setupSpeaker()}},{key:"setSpeakerDevice",value:function(e){return Zs(this,i_).setupSpeaker(e)}},{key:"onVideoTrackChanged",value:function(){this.emit("VIDEO_TRACK_CHANGE")}},{key:"onVideoTrackEnded",value:function(){this.emit("VIDEO_TRACK_CHANGE")}},{key:"rawVideoTrack",get:function(){return Zs(this,r_).mediaTrack}},{key:"videoTrack",get:function(){return Zs(this,r_).transformedMediaTrack}},{key:"videoEnabled",get:function(){return Zs(this,r_).trackEnabled}},{key:"enableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,r_).unmuteTrack();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){Zs(this,r_).disableTrack()}},{key:"getVideoDevices",value:function(){return Zs(this,t_).getVideoInputDevices()}},{key:"setVideoDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,r_).setDevice(t);
2case 2:this.emit("VIDEO_TRACK_CHANGE");case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onScreenShareEnded",value:function(){this.emit("SCREENSHARE_ENDED")}},{key:"screenShareTracks",get:function(){return{audio:Zs(this,a_).audioMediaTrack,video:Zs(this,a_).videoMediaTrack}}},{key:"screenShareEnabled",get:function(){return Zs(this,a_).trackEnabled}},{key:"enableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,a_).enableScreenShare();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Zs(this,a_).disableScreenShare();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getSpeakerDevices",value:function(){return Zs(this,t_).getAudioOutputDevices()}},{key:"addAudioMiddleware",value:function(e){return Zs(this,n_).addMiddleware(e)}},{key:"removeAudioMiddleware",value:function(e){return Zs(this,n_).removeMiddleware(e)}},{key:"addVideoMiddleware",value:function(e){return Zs(this,r_).addMiddleware(e)}},{key:"removeVideoMiddleware",value:function(e){return Zs(this,r_).removeMiddleware(e)}},{key:"destruct",value:function(){Zs(this,n_).disableTrack(),Zs(this,r_).disableTrack(),Zs(this,r_).terminateMiddlewareWebWorker(),Zs(this,a_).disableScreenShare()}},{key:"removeAllTracks",value:function(){this.destruct()}},{key:"removeDocumentEventListeners",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]),n}(ek);t_=new WeakMap,n_=new WeakMap,r_=new WeakMap,i_=new WeakMap,a_=new WeakMap,c_([Lv.trace("MediaHandler.setupStreams")],u_.prototype,"setupStreams",1),c_([Lv.trace("MediaHandler.enableAudio")],u_.prototype,"enableAudio",1),c_([Lv.trace("MediaHandler.disableAudio")],u_.prototype,"disableAudio",1),c_([Lv.trace("MediaHandler.setAudioDevice")],u_.prototype,"setAudioDevice",1),c_([Lv.trace("MediaHandler.enableVideo")],u_.prototype,"enableVideo",1),c_([Lv.trace("MediaHandler.disableVideo")],u_.prototype,"disableVideo",1),c_([Lv.trace("MediaHandler.setVideoDevice")],u_.prototype,"setVideoDevice",1),c_([Lv.trace("MediaHandler.enableScreenShare")],u_.prototype,"enableScreenShare",1),c_([Lv.trace("MediaHandler.disableScreenShare")],u_.prototype,"disableScreenShare",1),c_([Lv.trace("MediaHandler.destruct")],u_.prototype,"destruct",1);var l_,d_,p_,h_=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this,e),Cs((0,f.Z)(i),"code"),i.code=r,i}return(0,y.Z)(n)}((0,a.Z)(Error)),f_=Object.defineProperty,v_=Object.getOwnPropertyDescriptor,m_=function(e,t,n,r){for(var i,a=r>1?void 0:r?v_(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&f_(t,n,a),a},g_={port:void 0},y_=["virtual","emulator","krisp","solstice conference","teams","manycam","blackHole"];function b_(e){var t=e.label.toLowerCase();return"macOS"===ff._bowser.getOSName()&&t.includes("iphone")?(Dv.log("isVirtualDevice::ignore_macos_continuity"),!0):y_.some((function(e){return t.includes(e)}))}var k_=(p_=function(){function e(t){(0,g.Z)(this,e),Ms(this,l_,void 0),Ms(this,d_,void 0),As(this,l_,t),As(this,d_,new AbortController)}return(0,y.Z)(e,[{key:"destruct",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==(t=Zs(this,d_))||t.abort();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onDeviceChange",value:function(e){var t=this;ff.supportsDeviceChangeEvent()&&navigator.mediaDevices.addEventListener("devicechange",Cv(function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r){var i,a,o,s,c;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=t.availableDevices,a=new Set(i.map((function(e){return e.deviceId}))),n.next=3,t.repopulateAvailableDevices();case 3:o=t.availableDevices,s=new Set(o.map((function(e){return e.deviceId}))),c={added:o.filter((function(e){return!a.has(e.deviceId)})),removed:i.filter((function(e){return!s.has(e.deviceId)}))},t.repopulateAvailableDevices().then((function(){return e(r,c)}));case 5:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),100),{signal:Zs(this,d_).signal})}},{key:"repopulateAvailableDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k_.enumerateDevices();case 2:t=e.sent,As(this,l_,t),Ic.devices("AUDIO",this.getAudioDevices()),Ic.devices("VIDEO",this.getVideoDevices()),Ic.devices("SPEAKER",this.get
2SpeakerDevices()),Dv.info("repopulated_full_device_list",{devices:JSON.stringify(t)});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"availableDevices",get:function(){return Zs(this,l_)}},{key:"getAvailableDevicesByKind",value:function(e){return Zs(this,l_).filter((function(t){return t.kind===e}))}},{key:"getDeviceById",value:function(e,t){return Zs(this,l_).find((function(n){return n.deviceId===e&&n.kind===t}))}},{key:"getAudioDevices",value:function(){return this.getAvailableDevicesByKind("audioinput").sort((function(e,t){var n=b_(e)?0:1;return(b_(t)?0:1)-n}))}},{key:"getVideoDevices",value:function(){return this.getAvailableDevicesByKind("videoinput").sort((function(e,t){var n=b_(e)?0:1;return(b_(t)?0:1)-n}))}},{key:"getSpeakerDevices",value:function(){return this.getAvailableDevicesByKind("audiooutput").sort((function(e,t){var n=b_(e)?0:1;return(b_(t)?0:1)-n}))}}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=[],!k_.isDeviceListAvailable()){e.next=8;break}return e.next=4,k_.enumerateDevices();case 4:t=e.sent,Dv.info("initial_full_device_list",{devices:JSON.stringify(t)}),e.next=9;break;case 8:Dv.error("UnsupportedMediaAPI::navigator.mediaDevices.enumerateDevices",{debuggingHint:"Try checking meetingMetadata.visitedUrl. It should be running on localhost/127.0.0.1 or HTTPS, if not, there would be issues."});case 9:return e.abrupt("return",new k_(t));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"isDeviceListAvailable",value:function(){return!(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)}},{key:"enumerateDevices",value:function(){try{return navigator.mediaDevices.enumerateDevices()}catch(Es){return Dv.error("enumerate_devices_failed",{error:Es}),Promise.resolve([])}}},{key:"getAudioConstraints",value:function(e){var t={},n=e.audioOptions||{},r=n.disableAP,i=void 0!==r&&r,a=n.disableAEC,o=void 0!==a&&a,s=n.disableNS,c=void 0!==s&&s,u=n.disableAGC,l=void 0!==u&&u,d=n.disableHPF,p=void 0!==d&&d;if(ff.isFirefox()||ff.isWebKitBased())t.audio={deviceId:e.audioDeviceId,autoGainControl:!l&&!i,echoCancellation:!o&&!i,noiseSuppression:!c&&!i};else{if("boolean"==typeof t.audio)return t;t.audio={},t.audio.optional=[e.audioDeviceId?{sourceId:e.audioDeviceId}:{sourceId:"default"},{echoCancellation:!o&&!i},{googEchoCancellation:!o&&!i},{googAutoGainControl:!l&&!i},{googNoiseSuppression:!c&&!i},{googHighpassFilter:!p&&!i},{googNoiseSuppression2:!c&&!i},{googEchoCancellation2:!o&&!i},{googAutoGainControl2:!l&&!i}]}return t}},{key:"getVideoConstraints",value:function(e){var t={},n=e.videoDeviceId,r=e.videoTrackConstraints,i=e.facingMode,a=void 0===i?"user":i,o=e.frameRate,s=void 0===o?{ideal:24,max:30}:o;return t.video=r||vf.vga,"boolean"==typeof t.video||(n&&(t.video.deviceId={exact:n}),t.video.facingMode=a,t.video.frameRate=s),t}},{key:"getUserMediaWithTimeout",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},n=a.length>1&&void 0!==a[1]?a[1]:0,e.prev=2,Dv.info("getUserMediaWithTimeout::requesting_user_media",{timeout:n,constraints:JSON.stringify(t)}),n){e.next=8;break}return e.next=6,navigator.mediaDevices.getUserMedia(t);case 6:return r=e.sent,e.abrupt("return",(Dv.info("getUserMediaWithTimeout::received_user_media",{timeout:n,constraints:JSON.stringify(t)}),r));case 8:return e.next=10,Promise.race([navigator.mediaDevices.getUserMedia(t),new Promise((function(e,t){setTimeout((function(){return t(new h_("Get user media timed out","ERR_GUM_TIMEOUT"))}),n)}))]);case 10:return i=e.sent,e.abrupt("return",(Dv.info("getUserMediaWithTimeout::received_user_media",{timeout:n,constraints:JSON.stringify(t)}),i));case 14:throw e.prev=14,e.t0=e.catch(2),Dv.error("getUserMediaWithTimeout::failed_to_access_local_media",{error:e.t0,constraints:JSON.stringify(t)}),Dv.error("Failed to get access to local media.",{error:e.t0,constraints:JSON.stringify(t)}),new Lk(e.t0.name,e.t0.message,t);case 17:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(){return e.apply(this,arguments)}}()},{key:"getAudioTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k_.getUserMediaWithTimeout(t);case 2:return e.abrupt("return",e.sent.getAudioTracks()[0]);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getVideoTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k_.getUserMediaWithTimeout(t);case 2:return e.abrupt("return",e.sent.getVideoTracks()[0]);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getScreenShareTracks",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=jc.hasFeature(rv),a=null,i)try{g_.port=window.chrome.runtime.connect("nkeimhogjdpnpccoofpliimaahmaaome",{name:"chooseDesktopMedia"})}catch(s){Lv.addLogInCurrentSpan("error","Extension connect error"),i=!1}if(e.t0=i,!e.t0){e.next=7;break}return e.next=6,new Promise((function(e){var t=setTimeout((function(){return e(void 0)}),12e3);g_.port.onMessage.addListener(function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r){var i;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r.value.streamId&&(i=r.value.streamId,clearTimeout(t),e(i));case 1:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()),g_.port.postMessage({method:"chooseDesktopMedia",sources:["screen"]})}));case 6:a=e.sent;case 7:if(!a){e.next=15;break}return Lv.addLogInCurrentSpan("error","Acquiring extension screenshare track"),e.next=11,navigator.mediaDevices.getUserMedia({audio:!1,video:{mandatory:{maxWidth:1920,maxHeight:1080,chromeMediaSource:"desktop",chromeMediaSourceId:a},optional:[{maxFrameRate:parseInt(null!=(n=jc.getValue(iv))?n:"12",10)},{minFrameRate:parseInt(null!=(r=jc.getValue(av))?r:"8",10)}]}});case 11:o=e.sent,Lv.addLogInCurrentSpan("error","Acquired extension screenshare track"),e.next=18;break;case 15:return e.next=17,navigator.mediaDevices.getDisplayMedia(t);case 17:o=e.sent;case 18:return e.abrupt("return",{video:o.getVideoTracks()[0],audio:o.getAudioTracks()[0]});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getAudioAndVideoTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k_.getUserMediaWithTimeout(t);case 2:return n=e.sent,e.abrupt("return",{audioTrack:n.getAudioTracks()[0],videoTrack:n.getVideoTracks()[0]});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),l_=new WeakMap,d_=new WeakMap,p_),__=k_;m_([Lv.trace("LocalMediaUtils.onDeviceChange")],__.prototype,"onDeviceChange",1),m_([Lv.trace("LocalMediaUtils.repopulateAvailableDevices")],__.prototype,"repopulateAvailableDevices",1),m_([Lv.trace("LocalMediaUtils.isDeviceListAvailable")],__,"isDeviceListAvailable",1),m_([Lv.trace("LocalMediaUtils.enumerateDevices")],__,"enumerateDevices",1),m_([Lv.trace("LocalMediaUtils.getUserMediaWithTimeout")],__,"getUserMediaWithTimeout",1),m_([Lv.trace("LocalMediaUtils.getAudioTrack")],__,"getAudioTrack",1),m_([Lv.trace("LocalMediaUtils.getVideoTrack")],__,"getVideoTrack",1),m_([Lv.trace("LocalMediaUtils.getScreenShareTracks")],__,"getScreenShareTracks",1),m_([Lv.trace("LocalMediaUtils.getAudioAndVideoTrack")],__,"getAudioAndVideoTrack",1);var w_,x_,S_=Object.defineProperty,E_=Object.getOwnPropertyDescriptor,T_=function(e,t,n,r){for(var i,a=r>1?void 0:r?E_(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&S_(t,n,a),a},P_=function(){function e(t){(0,g.Z)(this,e),Ms(this,w_,void 0),Cs(this,"audioMiddlewares",[]),Cs(this,"videoMiddlewares",[]),Ms(this,x_,void 0),As(this,w_,t)}return(0,y.Z)(e,[{key:"terminateMiddlewareWebWorker",value:function(){if(Zs(this,x_))try{ws(Zs(this,x_)),As(this,x_,void 0)}catch(e){Dv.debug("WorkerTimers::terminateMiddlewareWebWorker::failed")}}},{key:"getTransformedVideoTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.videoMiddlewares)&&n.length){e.next=2;break}return e.abrupt("return",t);case 2:return e.next=4,Promise.all(null==(r=this.videoMiddlewares)?void 0:r.map((function(e){return e()})));case 4:i=e.sent,(a=new MediaStream).addTrack(t),o=document.createElement("canvas"),s=o.getContext("2d"),(c=document.createElement("video")).srcObject=a,c.autoplay=!0,this.terminateMiddlewareWebWorker(),u=function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(l,w_).videoEnabled&&"ended"!==t.readyState){e.next=3;break}return l.terminateMiddlewareWebWorker(),c.remove(),o.remove(),e.abrupt("return");case 3:e.prev=3,s.drawImage(c,0,0),n=0;case 6:if(!(n<i.length)){e.next=12;break}return e.next=9,i[n](o,s);case 9:n+=1,e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),Dv.error("getTransformedVideoTrack::middleware_execution_failed",{error:e.t0});case 17:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}();try{c.play()}catch(d){}return e.abrupt("return",(c.addEventListener("play",(function(){o.width=c.width||t.getSettings().width,o.height=c.width||t.getSettings().height,As(l,x_,xs(u,50))}),!1),o.captureStream().getVideoTracks()[0]));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"addVideoMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ff.isSafari()){e.next=4;break}e.t0={success:!1,message:"Video middlewares are not yet supported in Safari."},e.next=22;break;case 4:if(!this.videoMiddlewares.includes(t)){e.next=8;break}e.t1={success:!0,message:"This video middleware has been applied, already. Skipping."},e.next=21;break;case 8:if(this.videoMiddlewares.push(t),!Zs(this,w_).videoEnabled){e.next=19;break}return e.t3=Zs(this,w_),e.next=13,this.getTransformedVideoTrack(Zs(this,w_).rawVideoTrack);case 13:e.t4=e.sent,e.t3.setVideoTrack.call(e.t3,e.t4),Zs(this,w_).emit("VIDEO_TRACK_CHANGE"),e.t2={success:!0,message:"Successfully applied the video middleware."},e.next=20;break;case 19:e.t2={success:!0,message:"Successfully added the video middleware. It will be applied automatically once webcam is turned on."};case 20:e.t1=e.t2;case 21:e.t0=e.t1;case 22:return e.abrupt("return",e.t0);case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeVideoMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=this.videoMiddlewares.indexOf(t,0))>
2-1)){e.next=14;break}if(this.videoMiddlewares.splice(n,1),e.t1=Zs(this,w_).videoEnabled,!e.t1){e.next=11;break}return e.t2=Zs(this,w_),e.next=8,this.getTransformedVideoTrack(Zs(this,w_).rawVideoTrack);case 8:e.t3=e.sent,e.t2.setVideoTrack.call(e.t2,e.t3),Zs(this,w_).emit("VIDEO_TRACK_CHANGE");case 11:e.t0={success:!0,message:"Successfully removed the video middleware."},e.next=15;break;case 14:e.t0={success:!0,message:"No such video middleware was found. Skipping."};case 15:return e.abrupt("return",e.t0);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getTransformedAudioTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.audioMiddlewares)&&n.length){e.next=2;break}return e.abrupt("return",t);case 2:return i=new AudioContext,e.next=5,Promise.all(null==(r=this.audioMiddlewares)?void 0:r.map((function(e){return e(i)})));case 5:for(a=e.sent,o=i.createMediaStreamSource(new MediaStream([t])),s=i.createMediaStreamDestination(),e.prev=8,c=o,u=0;u<a.length;u+=1)c.connect(a[u]),c=a[u];c.connect(s),e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(8),e.abrupt("return",(Dv.error("getTransformedAudioTrack::middleware_execution_failed",{error:e.t0}),t));case 17:return e.abrupt("return",s.stream.getAudioTracks()[0]);case 18:case"end":return e.stop()}}),e,this,[[8,14]])})));return function(t){return e.apply(this,arguments)}}()},{key:"addAudioMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ff.isSafari()){e.next=4;break}e.t0={success:!1,message:"Audio middlewares are not yet supported in Safari."},e.next=22;break;case 4:if(!this.audioMiddlewares.includes(t)){e.next=8;break}e.t1={success:!0,message:"This audio middleware has been applied, already. Skipping."},e.next=21;break;case 8:if(this.audioMiddlewares.push(t),!Zs(this,w_).audioEnabled){e.next=19;break}return e.t3=Zs(this,w_),e.next=13,this.getTransformedAudioTrack(Zs(this,w_).rawAudioTrack);case 13:e.t4=e.sent,e.t3.setAudioTrack.call(e.t3,e.t4),Zs(this,w_).emit("AUDIO_TRACK_CHANGE"),e.t2={success:!0,message:"Successfully applied the audio middleware."},e.next=20;break;case 19:e.t2={success:!0,message:"Successfully added the audio middleware. It will be applied automatically once mic is turned on."};case 20:e.t1=e.t2;case 21:e.t0=e.t1;case 22:return e.abrupt("return",e.t0);case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeAudioMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=this.audioMiddlewares.indexOf(t,0))>-1)){e.next=14;break}if(this.audioMiddlewares.splice(n,1),e.t1=Zs(this,w_).audioEnabled,!e.t1){e.next=11;break}return e.t2=Zs(this,w_),e.next=8,this.getTransformedAudioTrack(Zs(this,w_).rawAudioTrack);case 8:e.t3=e.sent,e.t2.setAudioTrack.call(e.t2,e.t3),Zs(this,w_).emit("AUDIO_TRACK_CHANGE");case 11:e.t0={success:!0,message:"Successfully removed the audio middleware."},e.next=15;break;case 14:e.t0={success:!0,message:"No such audio middleware was found. Skipping."};case 15:return e.abrupt("return",e.t0);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();w_=new WeakMap,x_=new WeakMap,T_([Lv.trace("MediaMiddlewareUtils.getTransformedVideoTrack")],P_.prototype,"getTransformedVideoTrack",1),T_([Lv.trace("MediaMiddlewareUtils.addVideoMiddleware")],P_.prototype,"addVideoMiddleware",1),T_([Lv.trace("MediaMiddlewareUtils.removeVideoMiddleware")],P_.prototype,"removeVideoMiddleware",1),T_([Lv.trace("MediaMiddlewareUtils.getTransformedAudioTrack")],P_.prototype,"getTransformedAudioTrack",1),T_([Lv.trace("MediaMiddlewareUtils.addAudioMiddleware")],P_.prototype,"addAudioMiddleware",1),T_([Lv.trace("MediaMiddlewareUtils.removeAudioMiddleware")],P_.prototype,"removeAudioMiddleware",1);var C_=function(e,t,n){var r="number"==typeof n?n:250,i=e.createMediaStreamSource(t),a=e.createAnalyser();a.fftSize=2048,i.connect(a);var o=new Uint8Array(a.fftSize),s=!1;return setTimeout((function(){s=!0}),r),function e(){return s?Promise.resolve(!0):(a.getByteTimeDomainData(o),o.some((function(e){return 128!==e&&0!==e}))?Promise.resolve(!1):function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}().then(e))}().then((function(e){return i.disconnect(),e}),(function(e){throw i.disconnect(),e}))},R_="undefined"!=typeof AudioContext?AudioContext:null,Z_=new(function(){function e(t){(0,g.Z)(this,e),Cs(this,"_AudioContext"),Cs(this,"audioContext"),Cs(this,"_audioContextRefContainers");var n=(0,s.Z)({AudioContext:R_},t);Object.defineProperties(this,{_AudioContext:{value:n.AudioContext},audioContext:{value:null,writable:!0},_audioContextRefContainers:{value:new Set},AudioContextProvider:{enumerable:!0,value:e}})}return(0,y.Z)(e,[{key:"getOrCreate",value:function(e){if(!this._audioContextRefContainers.has(e)&&(this._audioContextRefContainers.add(e),this._AudioContext&&!this.audioContext))try{this.audioContext=new this._AudioContext}catch(t){}return this.audioContext}},{key:"release",value:function(e){this._audioContextRefContainers.has(e)&&(this._audioContextRefContainers.delete(e),!this._audioContextRefContainers.size&&this.audioContext&&(this.audioContext.close(),this.audioContext=null))}}]),e}()),M_=3,A_=250;function I_(e){var t={},n=Z_.getOrCreate(t),r=M_;return function t(){return r-=1,C_(n,e.srcObject,A_).then((function(e){return!!e&&(!(r>0)||t())})).catch((function(){return!0}))}().finally((function(){Z_.release(t)}))}function O_(e){return L_.apply(this,arguments)}function L_(){return L_=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new Audio,(r=new MediaStream).addTrack(t),n.srcObject=r,i=!1,e.prev=3,a=n.play(),e.t0=a,!e.t0){e.next=9;break}return e.next=9,a;case 9:return e.next=11,I_(n);case 11:(i=e.sent)&&Dv.info("checkIfAudioTrackIsSilent::silence_detected"),e.next=18;break;case 15:e.prev=15,e.t1=e.catch(3),Dv.error("checkIfAudioTrackIsSilent::failed_to_detect_silence",{error:e.t1});case 18:return e.prev=18,n.pause(),n.remove(),e.finish(18);case 21:return e.abrupt("return",i);case 22:case"end":return e.stop()}}),e,null,[[3,15,18,21]])}))),L_.apply(this,arguments)}var D_=function(){function e(){(0,g.Z)(this,e),Cs(this,"mediaPermissionEvent"),this.mediaPermissionEvent=!0}return(0,y.Z)(e,[{key:"shouldEmitMediaPermissionEvent",get:function(){return this.mediaPermissionEvent}},{key:"setEmitMediaPermissionEvent",value:function(e){this.mediaPermissionEvent=e}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();Cs(D_,"instance");var N_,j_,B_,U_=D_.getInstance(),V_=function(e,t){try{localStorage.setItem(e,t)}catch(n){Dv.error("LocalStorage::setItem::crashed",{error:n,localStorage:{key:e,value:t}})}},F_=function(e){try{return localStorage.getItem(e)}catch(t){Dv.error("LocalStorage::getItem::crashed",{error:t,localStorage:{key:e}})}return null},z_=Object.defineProperty,H_=Object.getOwnPropertyDescriptor,q_=function(e,t,n,r){for(var i,a=r>1?void 0:r?H_(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&z_(t,n,a),a},G_=(B_=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this),Ms((0,f.Z)(i),N_,void 0),Ms((0,f.Z)(i),j_,void 0),Cs((0,f.Z)(i),"mediaMiddlewareUtils"),Cs((0,f.Z)(i),"audioTrack"),Cs((0,f.Z)(i),"rawAudioTrack"),Cs((0,f.Z)(i),"videoTrack"),Cs((0,f.Z)(i),"rawVideoTrack"),Cs((0,f.Z)(i),"screenShareTracks"),Cs((0,f.Z)(i),"audioEnabled"),Cs((0,f.Z)(i),"videoEnabled"),Cs((0,f.Z)(i),"screenShareEnabled"),Cs((0,f.Z)(i),"currentDevices"),Cs((0,f.Z)(i),"permissions"),Cs((0,f.Z)(i),"audioUpdateInProgress"),Cs((0,f.Z)(i),"videoUpdateInProgress"),Cs((0,f.Z)(i),"screenShareUpdateInProgress"),As((0,f.Z)(i),N_,e),As((0,f.Z)(i),j_,new vv(r)),i.audioEnabled=!0,i.videoEnabled=!0,i.audioUpdateInProgress=!1,i.videoUp
2dateInProgress=!1,i.screenShareUpdateInProgress=!1,i.screenShareEnabled=!1,i.permissions={audio:"NOT_REQUESTED",video:"NOT_REQUESTED",screenshare:"NOT_REQUESTED"},i.screenShareTracks={audio:void 0,video:void 0},i.currentDevices={audio:void 0,video:void 0,speaker:void 0},Zs((0,f.Z)(i),N_).onDeviceChange((function(e,t){return i.onDeviceChange(t,!1)})),i.updateDevices(),i.conditionallyRestartAudio=i.conditionallyRestartAudio.bind((0,f.Z)(i)),i.conditionallyRestartVideo=i.conditionallyRestartVideo.bind((0,f.Z)(i)),i.onVisibilityChange=i.onVisibilityChange.bind((0,f.Z)(i)),document.addEventListener("visibilitychange",i.onVisibilityChange),i.on("AUDIO_TRACK_CHANGE",(function(){i.notifyIfTrackSilent()})),i}return(0,y.Z)(n,[{key:"handlePermissionErrors",value:function(e,t){var n=Dk(t.name,t.message);this.permissions[e]=n,sm.emit(cm.MEDIA_PERMISSION_ERROR,{message:n,constraints:t.constraints,kind:e})}},{key:"onVisibilityChange",value:function(e){"visible"===document.visibilityState&&(ff.isMobile()&&this.conditionallyRestartAudio(),this.conditionallyRestartVideo()),Ic.tabChanged("visible"===document.visibilityState),"visible"!==document.visibilityState?Ic.browserBackgrounded():Ic.browserForegrounded()}},{key:"conditionallyRestartAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.currentDevices)&&n.audio&&this.audioEnabled){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,Promise.race([new Promise((function(e){var t;return null==(t=a.rawAudioTrack)?void 0:t.addEventListener("unmute",(function(t){e(t)}))})),new Promise((function(e){return setTimeout(e,50)}))]);case 4:return Dv.info("performingCheck::shouldReacquireAudioTrack",{actions:{trackRobustness:{eventType:null==t?void 0:t.type}}}),e.next=7,this.shouldReacquireTrack("audio");case 7:if(i=e.sent,Dv.info("performedCheck::shouldReacquireAudioTrack",{actions:{trackRobustness:{reacquireTrack:i}}}),e.t0=i,!e.t0){e.next=21;break}if(Dv.info("reacquiring_audio_track"),this.removeMediaStreamTrackListeners(this.rawAudioTrack),e.t1=ff.isChromiumBased(),!e.t1){e.next=17;break}return e.next=17,Zs(this,N_).repopulateAvailableDevices();case 17:return e.next=19,this.setupAudioStream(null==(r=this.currentDevices.audio)?void 0:r.deviceId);case 19:this.addMediaStreamTrackListeners(this.rawAudioTrack),this.emit("AUDIO_TRACK_CHANGE");case 21:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"conditionallyRestartVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.currentDevices)&&n.video&&this.videoEnabled){e.next=2;break}return e.abrupt("return");case 2:return Dv.info("performingCheck::shouldReacquireVideoTrack",{actions:{trackRobustness:{eventType:null==t?void 0:t.type}}}),e.next=5,Promise.race([new Promise((function(e){var t;return null==(t=i.rawVideoTrack)?void 0:t.addEventListener("unmute",e)})),new Promise((function(e){return setTimeout(e,50)}))]);case 5:return e.next=7,this.shouldReacquireTrack("video");case 7:if(r=e.sent,Dv.info("performedCheck::shouldReacquireVideoTrack",{actions:{trackRobustness:{reacquireTrack:r}}}),e.t0=r,!e.t0){e.next=19;break}return Dv.info("reacquiring_video_track"),this.removeMediaStreamTrackListeners(this.rawVideoTrack),e.next=15,Zs(this,N_).repopulateAvailableDevices();case 15:return e.next=17,this.setupVideoStream(this.currentDevices.video.deviceId);case 17:this.addMediaStreamTrackListeners(this.rawVideoTrack),this.emit("VIDEO_TRACK_CHANGE");case 19:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"shouldReacquireTrack",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!1,"audio"===t?(n=this.rawAudioTrack,r=this.audioEnabled):"video"===t&&(n=this.rawVideoTrack,r=this.videoEnabled),n){e.next=3;break}return e.abrupt("return",!1);case 3:if(i="ended"===n.readyState&&r&&!0,a=!1,e.t0="audio"===t,!e.t0){e.next=10;break}return e.next=9,O_(this.rawAudioTrack);case 9:a=e.sent;case 10:return e.abrupt("return","visible"===document.visibilityState&&(n.muted||i||a));case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onAudioUnmute",value:function(e){Dv.info("audio_track_unmuted",{actions:{trackRobustness:{eventType:null==e?void 0:e.type}}})}},{key:"onVideoUnmute",value:function(e){Dv.info("video_track_unmuted",{actions:{trackRobustness:{eventType:null==e?void 0:e.type}}})}},{key:"removeMediaStreamTrackListeners",value:function(e){if(Dv.info("Removing ".concat(e.kind," listerners")),e){var t="audio"===e.kind?this.conditionallyRestartAudio:this.conditionallyRestartVideo;return e.removeEventListener("ended",t),e.removeEventListener("mute",t),e.removeEventListener("unmute","audio"===e.kind?this.onAudioUnmute:this.onVideoUnmute),e}}},{key:"addMediaStreamTrackListeners",value:function(e){var t=this;if(!e)return null;Dv.info("adding_".concat(e.kind,"_stream_listerners"));var n="audio"===e.kind,r=n?this.conditionallyRestartAudio:this.conditionallyRestartVideo;return e.addEventListener("ended",(0,h.Z)((0,p.Z)().mark((function i(){var a,o,s;return(0,p.Z)().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r();case 2:a=n?t.audioEnabled:t.videoEnabled,o=n?t.audioTrack:t.videoTrack,s=n?"FORCE_MUTE_AUDIO":"FORCE_MUTE_VIDEO",a&&(!o||"live"!==o.readyState||!o.enabled)&&(Dv.info("LocalMediaHandler::trackEnded::Failed to restart ".concat(e.kind," track")),t.emit(s));case 4:case"end":return i.stop()}}),i)})))),e.addEventListener("mute",r),e.addEventListener("unmute",n?this.onAudioUnmute:this.onVideoUnmute),e}},{key:"notifyIfTrackSilent",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.audioEnabled&&this.audioTrack&&"ended"!==this.audioTrack.readyState&&this.audioTrack.enabled,!e.t0){e.next=7;break}return e.next=4,O_(this.audioTrack);case 4:e.t1=e.sent,e.t2=!0,e.t0=e.t1===e.t2;case 7:if(e.t3=e.t0,!e.t3){e.next=10;break}Dv.info("LocalMediaHandler:notifyIfTrackSilent:TrackSilent",{media:{audio:{enabled:this.audioEnabled,deviceId:null==(n=null==(t=this.audioTrack)?void 0:t.getSettings())?void 0:n.deviceId,permission:null==(r=this.permissions)?void 0:r.audio,deviceName:null==(a=null==(i=this.currentDevices)?void 0:i.audio)?void 0:a.label,trackId:null==(o=this.audioTrack)?void 0:o.id}}}
2),this.emit("AUDIO_TRACK_SILENT");case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setupAudioStream",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(u.length>1&&void 0!==u[1])||u[1],this.audioUpdateInProgress){e.next=43;break}if(e.prev=2,this.audioUpdateInProgress=!0,(o=Zs(this,N_).getAudioDevices()).length){e.next=7;break}return e.abrupt("return");case 7:if(s=t,e.t0=!s||!o.find((function(e){return e.deviceId===s})),!e.t0){e.next=14;break}return e.next=12,this.getPreferredDeviceId("AUDIO");case 12:s=e.sent,Dv.debug("setupAudioStream::AUDIO::getPreferredDeviceId",{preferredDevice:{preferredDeviceId:s,kind:"audio"}});case 14:return c=__.getAudioConstraints({audioDeviceId:s}),n&&(null==(r=this.rawAudioTrack)||r.stop(),null==(i=this.audioTrack)||i.stop()),e.next=18,__.getAudioTrack(c);case 18:return this.rawAudioTrack=e.sent,s=this.rawAudioTrack.getSettings().deviceId,(null==(a=this.currentDevices.audio)?void 0:a.deviceId)!==s&&(this.currentDevices.audio=Zs(this,N_).getDeviceById(s,"audioinput"),this.emit("DEVICE_CHANGE",{device:this.currentDevices.audio})),this.rawAudioTrack.enabled=this.audioEnabled,e.t1=this,e.next=25,this.mediaMiddlewareUtils.getTransformedAudioTrack(this.rawAudioTrack);case 25:return e.t2=e.sent,e.t1.setAudioTrack.call(e.t1,e.t2),this.addMediaStreamTrackListeners(this.rawAudioTrack),e.next=30,Zs(this,N_).repopulateAvailableDevices();case 30:this.permissions.audio="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.audio,kind:"audio"}),Ic.mediaPermission("AUDIO",Gs.ACCEPTED),Ic.selectedDevice("AUDIO",this.currentDevices.audio),s&&V_("lastUsedAudioDeviceId",s),e.next=40;break;case 37:e.prev=37,e.t3=e.catch(2),this.handlePermissionErrors("audio",e.t3);case 40:return e.prev=40,this.audioUpdateInProgress=!1,e.finish(40);case 43:case"end":return e.stop()}}),e,this,[[2,37,40,43]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getPreferredDeviceId",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("AUDIO"!==t){e.next=14;break}if(a=Zs(this,N_).getAudioDevices(),o=F_("lastUsedAudioDeviceId"),Dv.debug("getPreferredDeviceId::lastUsedAudioDeviceId",{preferredDevice:{lastUsedPreferredDeviceId:o,kind:"audio"}}),o&&(s=a.find((function(e){return e.deviceId===o}))),!s){e.next=8;break}i=o,e.next=13;break;case 8:if(e.t0=jc.hasFeature(Df),e.t0){e.next=13;break}return e.next=12,this.getOperationalMicDeviceId();case 12:i=e.sent.deviceId;case 13:i||(i=null==(n=a[0])?void 0:n.deviceId);case 14:if("VIDEO"!==t){e.next=27;break}if(c=F_("lastUsedVideoDeviceId"),Dv.debug("getPreferredDeviceId::lastUsedVideoDeviceId",{preferredDevice:{kind:"video",lastUsedPreferredDeviceId:c}}),u=Zs(this,N_).getVideoDevices(),c&&(l=u.find((function(e){return e.deviceId===c}))),!l){e.next=23;break}i=c,e.next=26;break;case 23:return e.next=25,this.getOperationalWebcamDeviceId();case 25:i=e.sent.deviceId;case 26:i||(i=null==(r=u[0])?void 0:r.deviceId);case 27:return e.abrupt("return",i);case 28:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setupVideoStream",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!(c.length>1&&void 0!==c[1])||c[1],this.videoUpdateInProgress){e.next=43;break}if(e.prev=2,this.videoUpdateInProgress=!0,(a=Zs(this,N_).getVideoDevices()).length){e.next=7;break}return e.abrupt("return");case 7:if(o=t,e.t0=!o||!a.find((function(e){return e.deviceId===o})),!e.t0){e.next=14;break}return e.next=12,this.getPreferredDeviceId("VIDEO");case 12:o=e.sent,Dv.debug("setupVideoStream::VIDEO::getPreferredDeviceId",{preferredDevice:{preferredDeviceId:o,kind:"video"}});case 14:if(n&&(null==(r=this.videoTrack)||r.stop()),!this.videoEnabled){e.next=27;break}return s=Zs(this,j_).getVideoConstraints(o),e.next=19,__.getVideoTrack(s);case 19:return this.rawVideoTrack=e.sent,o=this.rawVideoTrack.getSettings().deviceId,e.t1=this,e.next=24,this.mediaMiddlewareUtils.getTransformedVideoTrack(this.rawVideoTrack);case 24:e.t2=e.sent,e.t1.setVideoTrack.call(e.t1,e.t2),this.addMediaStreamTrackListeners(this.rawVideoTrack);case 27:return e.next=29,Zs(this,N_).repopulateAvailableDevices();case 29:(null==(i=this.currentDevices.video)?void 0:i.deviceId)!==o&&(this.currentDevices.video=Zs(this,N_).getDeviceById(o,"videoinput"),this.emit
2("DEVICE_CHANGE",{device:this.currentDevices.video})),this.permissions.video="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.video,kind:"video"}),Ic.mediaPermission("VIDEO",Gs.ACCEPTED),Ic.selectedDevice("VIDEO",this.currentDevices.video),o&&V_("lastUsedVideoDeviceId",o),e.next=40;break;case 37:e.prev=37,e.t3=e.catch(2),this.handlePermissionErrors("video",e.t3);case 40:return e.prev=40,this.videoUpdateInProgress=!1,e.finish(40);case 43:case"end":return e.stop()}}),e,this,[[2,37,40,43]])})));return function(t){return e.apply(this,arguments)}}()},{key:"setupScreenShareStreams",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.screenShareUpdateInProgress){e.next=2;break}return e.abrupt("return");case 2:return t=Zs(this,j_).getScreenShareConstraints(),jc.hasFeature(Gf)&&(t.video.width.max=window.screen.width,t.video.height.max=window.screen.height),e.prev=4,this.screenShareUpdateInProgress=!0,e.next=8,__.getScreenShareTracks(t);case 8:n=e.sent,this.setScreenShareTracks(n),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(4),this.handlePermissionErrors("screenshare",new Lk(e.t0.name,e.t0.message,t)),new Bv(e.t0.message);case 15:return e.prev=15,this.screenShareUpdateInProgress=!1,e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[4,12,15,18]])})));return function(){return e.apply(this,arguments)}}()},{key:"setupSpeaker",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=Zs(this,N_).getSpeakerDevices()).length){e.next=3;break}return e.abrupt("return");case 3:i=null!=t?t:r[0].deviceId,(null==(n=this.currentDevices.speaker)?void 0:n.deviceId)!==i&&(this.currentDevices.speaker=Zs(this,N_).getDeviceById(i,"audiooutput"),Ic.selectedDevice("SPEAKER",this.currentDevices.speaker),this.emit("DEVICE_CHANGE",{device:this.currentDevices.speaker})),document.querySelectorAll("audio").forEach(function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof t.sinkId||!a.currentDevices.speaker.deviceId||t.sinkId===a.currentDevices.speaker.deviceId){e.next=8;break}return e.prev=1,e.next=4,t.setSinkId(a.currentDevices.speaker.deviceId);case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}());case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getOperationalWebcamDeviceId",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=Zs(this,N_).getVideoDevices()).length){e.next=3;break}return e.abrupt("return",{isOperational:!1,deviceId:null});case 3:return U_.setEmitMediaPermissionEvent(!1),n=[],e.next=7,t.reduce(function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,r){var i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(null===(i=e.sent)){e.next=5;break}return e.abrupt("return",i);case 5:return a=Zs(s,j_).getVideoConstraints(r.deviceId),e.prev=6,e.next=9,__.getVideoTrack(a);case 9:return e.sent.stop(),e.abrupt("return",r.deviceId);case 13:e.prev=13,e.t0=e.catch(6),Dv.error("getOperationalWebcamDeviceId::could_not_acquire_video_device",{error:e.t0,constraints:a}),n.push({exception:e.t0,constraints:a});case 16:return e.abrupt("return",i);case 17:case"end":return e.stop()}}),e,null,[[6,13]])})));return function(t,n){return e.apply(this,arguments)}}(),Promise.resolve(null));case 7:if(r=e.sent,U_.setEmitMediaPermissionEvent(!0),r||!(n.length>0)||n.length!==t.length){e.next=11;break}throw i=n[0],a=i.exception,o=i.constraints,new Lk(a.name,a.message,o);case 11:return e.abrupt("return",r?{isOperational:!0,deviceId:r}:{isOperational:!1,deviceId:t[0].deviceId});case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getOperationalMicDeviceId",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=Zs(this,N_).getAudioDevices()).length){e.next=3;break}return e.abrupt("return",{isOperational:!1,deviceId:null});case 3:return n=[],U_.setEmitMediaPermissionEvent(!1),e.next=7,t.reduce(function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,r){var i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:if(null===(i=e.sent)){e.next=5;break}return e.abrupt("return",i);case 5:return a=__.getAudioConstraints({audioDeviceId:r.deviceId}),e.prev=6,e.next=9,__.getAudioTrack(a);case 9:return o=e.sent,e.next=12,O_(o);case 12:if(s=e.sent,null==o||o.stop(),s){e.next=15;break}return e.abrupt("return",r);case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(6),Dv.error("getOperationalMicDeviceId::could_not_acquire_audio_device",{error:e.t0,constraints:a}),n.push({exception:e.t0,constraints:a});case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,null,[[6,17]])})));return function(t,n){return e.apply(this,arguments)}}(),Promise.resolve(null));case 7:if(r=e.sent,U_.setEmitMediaPermissionEvent(!0),r||!(n.length>0)||n.length!==t.length){e.next=11;break}throw i=n[0],a=i.exception,o=i.constraints,new Lk(a.name,a.message,o);case 11:return e.abrupt("return",r?{isOperational:!0,deviceId:r.deviceId}:{isOperational:!1,deviceId:t[0].deviceId});case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setupStreams",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s,c,u,l,d,h;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.audio,r=t.video,a={},this.currentDevices||(this.currentDevices={audio:void 0,video:void 0,speaker:void 0}),e.prev=3,!n||this.audioUpdateInProgress||0===Zs(this,N_).getAudioDevices().length){e.next=11;break}return e.next=7,this.getPreferredDeviceId("AUDIO");case 7:o=e.sent,Dv.info("setupStreams::AUDIO::getPreferredDeviceId",{preferredDevice:{preferredDeviceId:o,kind:"audio"}}),s=__.getAudioConstraints({audioDeviceId:o}),a.audio=s.audio;
2case 11:if(!r||this.videoUpdateInProgress||0===Zs(this,N_).getVideoDevices().length){e.next=18;break}return e.next=14,this.getPreferredDeviceId("VIDEO");case 14:c=e.sent,Dv.info("setupStreams::VIDEO::getPreferredDeviceId",{preferredDevice:{preferredDeviceId:c,kind:"video"}}),u=Zs(this,j_).getVideoConstraints(c),a.video=u.video;case 18:if(0!==(null==(i=Object.keys(a))?void 0:i.length)){e.next=21;break}return this.audioEnabled=null!=n?n:this.audioEnabled,this.videoEnabled=null!=r?r:this.videoEnabled,this.audioUpdateInProgress=!1,this.videoUpdateInProgress=!1,e.abrupt("return");case 21:return e.next=23,__.getAudioAndVideoTrack(a);case 23:return l=e.sent,d=l.audioTrack,h=l.videoTrack,n&&d&&(this.audioTrack=d,this.rawAudioTrack=d,this.permissions.audio="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.audio,kind:"audio"}),this.currentDevices.audio=Zs(this,N_).getDeviceById(d.getSettings().deviceId,"audioinput"),V_("lastUsedAudioDeviceId",d.getSettings().deviceId)),r&&h&&(this.videoTrack=h,this.rawVideoTrack=h,this.permissions.video="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.video,kind:"video"}),this.currentDevices.video=Zs(this,N_).getDeviceById(h.getSettings().deviceId,"videoinput"),V_("lastUsedVideoDeviceId",h.getSettings().deviceId)),e.next=30,Zs(this,N_).repopulateAvailableDevices();case 30:e.next=44;break;case 32:if(e.prev=32,e.t0=e.catch(3),e.t1="NotAllowedError"===e.t0.name,!e.t1){e.next=44;break}if(e.t2=n,!e.t2){e.next=40;break}return e.next=40,this.setupAudioStream();case 40:if(e.t3=r,!e.t3){e.next=44;break}return e.next=44,this.setupVideoStream();case 44:return this.audioEnabled=!!this.audioTrack,this.videoEnabled=!!this.videoTrack,this.screenShareEnabled=!1,this.audioUpdateInProgress=!1,this.videoUpdateInProgress=!1,e.next=51,this.setupSpeaker();case 51:case"end":return e.stop()}}),e,this,[[3,32]])})));return function(t){return e.apply(this,arguments)}}()},{key:"stopAudioTrack",value:function(){var e,t;this.audioUpdateInProgress||(this.audioUpdateInProgress=!0,null==(e=this.audioTrack)||e.stop(),null==(t=this.rawAudioTrack)||t.stop(),this.audioEnabled=!1,this.audioUpdateInProgress=!1)}},{key:"stopVideoTrack",value:function(){var e,t;this.videoUpdateInProgress||(this.videoUpdateInProgress=!0,null==(e=this.videoTrack)||e.stop(),null==(t=this.rawVideoTrack)||t.stop(),this.videoEnabled=!1,this.videoUpdateInProgress=!1)}},{key:"stopScreenShareTracks",value:function(){var e,t,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.screenShareUpdateInProgress){this.screenShareUpdateInProgress=!0;var a=i.audio,o=void 0===a||a,s=i.video,c=void 0===s||s;o&&(null==(t=null==(e=this.screenShareTracks)?void 0:e.audio)||t.stop()),c&&(null==(r=null==(n=this.screenShareTracks)?void 0:n.video)||r.stop()),this.screenShareEnabled=!1,this.screenShareUpdateInProgress=!1}}},{key:"removeAudioTrack",value:function(){this.stopAudioTrack(),this.audioTrack=void 0,this.rawAudioTrack=void 0}},{key:"removeVideoTrack",value:function(){this.stopVideoTrack(),this.videoTrack=void 0,this.rawVideoTrack=void 0}},{key:"removeScreenShareTracks",value:function(e){var t;null==(t=this.screenShareTracks.video)||t.removeEventListener("ended",this.onScreenShareEnded),this.stopScreenShareTracks(e),this.screenShareTracks={audio:void 0,video:void 0}}},{key:"removeAllTracks",value:function(){this.removeAudioTrack(),this.removeVideoTrack(),this.removeScreenShareTracks({audio:!!this.screenShareTracks.audio,video:!!this.screenShareTracks.video})}},{key:"setAudioTrack",value:function(e){e!==this.audioTrack&&(void 0===e&&this.stopAudioTrack(),this.audioTrack=e,this.audioTrack&&(this.audioTrack.enabled=this.audioEnabled))}},{key:"setVideoTrack",value:function(e){e!==this.videoTrack&&(void 0===e&&this.stopVideoTrack(),this.videoTrack=e)}},{key:"setScreenShareTracks",value:function(e){var t,n=e.audio,r=e.video;(!n||!r)&&this.stopScreenShareTracks({audio:!!n,video:!!r}),this.screenShareTracks=e,null==(t=this.screenShareTracks.video)||t.addEventListener("ended",this.onScreenShareEnded.bind(this))}}
2,{key:"onScreenShareEnded",value:function(){this.emit("SCREENSHARE_ENDED")}},{key:"disableAudio",value:function(){this.audioEnabled=!1,this.audioTrack&&(this.audioTrack.enabled=this.audioEnabled),this.rawAudioTrack&&(this.rawAudioTrack.enabled=this.audioEnabled)}},{key:"enableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("DENIED"!==this.permissions.audio){e.next=3;break}return this.audioEnabled=!1,e.abrupt("return");case 3:if(e.prev=3,e.t0=!this.audioTrack||"ended"===this.audioTrack.readyState,!e.t0){e.next=8;break}return e.next=8,this.setupAudioStream(null==(t=this.currentDevices.audio)?void 0:t.deviceId);case 8:if(this.audioTrack&&this.rawAudioTrack){e.next=11;break}return this.audioEnabled=!1,Dv.error("LocalMediaHandler::enableAudio:Setting up audio stream failed while enabling audio",{debuggingHint:"Refer to SelfController::mediaPermissionError log."}),e.abrupt("return");case 11:this.audioEnabled=!0,e.next=17;break;case 14:e.prev=14,e.t1=e.catch(3),this.audioEnabled=!1,this.audioTrack=void 0,this.rawAudioTrack=void 0,Dv.error("LocalMediaHandler::enableAudio",{error:e.t1},!0);case 17:this.audioTrack&&(this.audioTrack.enabled=!0),this.rawAudioTrack&&(this.rawAudioTrack.enabled=!0),"ACCEPTED"!==this.permissions.audio&&this.audioEnabled&&(this.permissions.audio="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.audio,kind:"audio"}));case 18:case"end":return e.stop()}}),e,this,[[3,14]])})));return function(){return e.apply(this,arguments)}}()},{key:"toggleAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("DENIED"!==this.permissions.audio){e.next=3;break}return this.audioEnabled=!1,e.abrupt("return");case 3:if(e.prev=3,e.t0=!this.audioTrack||"ended"===this.audioTrack.readyState,!e.t0){e.next=8;break}return e.next=8,this.setupAudioStream(null==(t=this.currentDevices.audio)?void 0:t.deviceId);case 8:if(this.audioTrack&&this.rawAudioTrack){e.next=11;break}return this.audioEnabled=!1,e.abrupt("return");case 11:this.audioEnabled=!this.audioEnabled,e.next=17;break;case 14:e.prev=14,e.t1=e.catch(3),this.audioEnabled=!1,Dv.error("LocalMediaHandler::toggleAudio",{error:e.t1},!0);case 17:this.audioTrack&&(this.audioTrack.enabled=this.audioEnabled),this.rawAudioTrack&&(this.rawAudioTrack.enabled=this.audioEnabled);case 18:case"end":return e.stop()}}),e,this,[[3,14]])})));return function(){return e.apply(this,arguments)}}()},{key:"toggleVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("DENIED"!==this.permissions.video){e.next=3;break}return this.videoEnabled=!1,e.abrupt("return");case 3:if(!this.videoEnabled){e.next=6;break}return this.removeVideoTrack(),e.abrupt("return");case 6:return this.videoEnabled=!0,e.prev=7,e.next=10,this.setupVideoStream(null==(t=this.currentDevices.video)?void 0:t.deviceId);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),this.videoEnabled=!1;case 15:this.videoTrack&&(this.videoTrack.enabled=this.videoEnabled),this.rawVideoTrack&&(this.rawVideoTrack.enabled=this.videoEnabled),"ACCEPTED"!==this.permissions.video&&this.videoEnabled&&(this.permissions.video="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.video,kind:"video"}));case 16:case"end":return e.stop()}}),e,this,[[7,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"toggleScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.screenShareEnabled){e.next=3;break}return this.removeScreenShareTracks({audio:!!this.screenShareTracks.audio,video:!!this.screenShareTracks.video}),e.abrupt("return");case 3:return e.prev=3,e.next=6,this.setupScreenShareStreams();case 6:if(this.screenShareEnabled=!0,"ACCEPTED"!==this.permissions.screenshare){e.next=9;break}return e.abrupt("return");case 9:this.permissions.screenshare="ACCEPTED",sm.emit(cm.MEDIA_PERMISSION_UPDATE,{message:this.permissions.screenshare,kind:"screenshare"}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),this.screenShareEnabled=!1;case 15:case"end":return e.stop()}}
2),e,this,[[3,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"getAllDevices",value:function(){return Zs(this,N_).availableDevices}},{key:"getDeviceById",value:function(e,t){return Zs(this,N_).getDeviceById(e,t)}},{key:"getAudioDevices",value:function(){return Zs(this,N_).getAudioDevices()}},{key:"getVideoDevices",value:function(){return Zs(this,N_).getVideoDevices()}},{key:"getSpeakerDevices",value:function(){return Zs(this,N_).getSpeakerDevices()}},{key:"onDeviceChange",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==(r=null==t?void 0:t.added)||r.forEach(function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t&&(n||!b_(t)),!e.t0){e.next=18;break}if("audioinput"!==t.kind){e.next=8;break}return e.next=5,a.setupAudioStream(t.deviceId);case 5:a.emit("AUDIO_TRACK_CHANGE"),e.next=18;break;case 8:if("videoinput"!==t.kind){e.next=14;break}return e.next=11,a.setupVideoStream(t.deviceId);case 11:a.emit("VIDEO_TRACK_CHANGE"),e.next=18;break;case 14:if(e.t1="audiooutput"===t.kind,!e.t1){e.next=18;break}return e.next=18,a.setupSpeaker(t.deviceId);case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),null==(i=null==t?void 0:t.removed)||i.forEach(function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=t,!e.t0){e.next=19;break}if(e.t1=jc.hasFeature(Qf)||!ff.isChromiumBased(),!e.t1){e.next=15;break}if("audioinput"!==t.kind||t.deviceId!==(null==(n=a.currentDevices.audio)?void 0:n.deviceId)){e.next=10;break}return e.next=7,a.setupAudioStream();case 7:a.emit("AUDIO_TRACK_CHANGE"),e.next=15;break;case 10:if(e.t2="videoinput"===t.kind&&t.deviceId===(null==(r=a.currentDevices.video)?void 0:r.deviceId),!e.t2){e.next=15;break}return e.next=14,a.setupVideoStream();case 14:a.emit("VIDEO_TRACK_CHANGE");case 15:if(e.t3="audiooutput"===t.kind&&t.deviceId===(null==(i=a.currentDevices.speaker)?void 0:i.deviceId),!e.t3){e.next=19;break}return e.next=19,a.setupSpeaker();case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"updateDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("firefox"!==ff.getName()){e.next=2;break}return e.abrupt("return");case 2:return"microphone",r="camera",e.next=6,null==(t=null==navigator?void 0:navigator.permissions)?void 0:t.query({name:"microphone"});case 6:return i=e.sent,e.next=9,null==(n=null==navigator?void 0:navigator.permissions)?void 0:n.query({name:r});case 9:a=e.sent,o=function(e,t){c.permissions[e]=t;var n={message:c.permissions[e],kind:e};"DENIED"===t?sm.emit(cm.MEDIA_PERMISSION_ERROR,n):sm.emit(cm.MEDIA_PERMISSION_UPDATE,n)},s=function(e,t){switch(t){case"granted":o(e,"ACCEPTED");break;case"denied":o(e,"DENIED")}Zs(c,N_).repopulateAvailableDevices()},i&&(i.onchange=function(){return s("audio",i.state)}),a&&(a.onchange=function(){return s("video",a.state)});case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"emit",value:function(e){for(var t,r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return(t=l((0,u.Z)(n.prototype),"emit",this)).call.apply(t,[this,e].concat(i))}},{key:"on",value:function(e,t){return l((0,u.Z)(n.prototype),"on",this).call(this,e,t)}},{key:"removeDocumentEventListeners",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:document.removeEventListener("visibilitychange",this.onVisibilityChange);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"addAudioMiddleware",value:function(e){return this.mediaMiddlewareUtils.addAudioMiddleware(e)}},{key:"removeAudioMiddleware",value:function(e){return this.mediaMiddlewareUtils.removeAudioMiddleware(e)}},{key:"addVideoMiddleware",value:function(e){return this.mediaMiddlewareUtils.addVideoMiddleware(e)}},{key:"removeVideoMiddleware",value:function(e){return this.mediaMiddlewareUtils.removeVideoMiddleware(e)}},{key:"enableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.toggleVideo();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.toggleVideo();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"enableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.toggleScreenShare();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.toggleScreenShare();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getCurrentDevices",value:function(){return this.currentDevices}},{key:"destruct",value:function(){this.mediaMiddlewareUtils.terminateMiddlewareWebWorker(),Zs(this,N_).destruct(),this.removeAllTracks(),this.removeAllListeners()}}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;
2)switch(e.prev=e.next){case 0:return e.next=2,__.init();case 2:return n=e.sent,r=new G_(n,t),i=new P_(r),e.abrupt("return",(r.mediaMiddlewareUtils=i,r));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(Ns.EventEmitter),N_=new WeakMap,j_=new WeakMap,B_),W_=G_;q_([Lv.trace("OldMediaHandler.shouldReacquireTrack")],W_.prototype,"shouldReacquireTrack",1),q_([Lv.trace("OldMediaHandler.removeMediaStreamTrackListeners")],W_.prototype,"removeMediaStreamTrackListeners",1),q_([Lv.trace("OldMediaHandler.addMediaStreamTrackListeners")],W_.prototype,"addMediaStreamTrackListeners",1),q_([Lv.trace("OldMediaHandler.setupAudioStream")],W_.prototype,"setupAudioStream",1),q_([Lv.trace("OldMediaHandler.getPreferredDeviceId")],W_.prototype,"getPreferredDeviceId",1),q_([Lv.trace("OldMediaHandler.setupVideoStream")],W_.prototype,"setupVideoStream",1),q_([Lv.trace("OldMediaHandler.setupScreenShareStreams")],W_.prototype,"setupScreenShareStreams",1),q_([Lv.trace("OldMediaHandler.setupSpeaker")],W_.prototype,"setupSpeaker",1),q_([Lv.trace("OldMediaHandler.getOperationalWebcamDeviceId")],W_.prototype,"getOperationalWebcamDeviceId",1),q_([Lv.trace("OldMediaHandler.getOperationalMicDeviceId")],W_.prototype,"getOperationalMicDeviceId",1),q_([Lv.trace("OldMediaHandler.setupStreams")],W_.prototype,"setupStreams",1),q_([Lv.trace("OldMediaHandler.stopAudioTrack")],W_.prototype,"stopAudioTrack",1),q_([Lv.trace("OldMediaHandler.stopVideoTrack")],W_.prototype,"stopVideoTrack",1),q_([Lv.trace("OldMediaHandler.stopScreenShareTracks")],W_.prototype,"stopScreenShareTracks",1),q_([Lv.trace("OldMediaHandler.removeAudioTrack")],W_.prototype,"removeAudioTrack",1),q_([Lv.trace("OldMediaHandler.removeVideoTrack")],W_.prototype,"removeVideoTrack",1),q_([Lv.trace("OldMediaHandler.removeScreenShareTracks")],W_.prototype,"removeScreenShareTracks",1),q_([Lv.trace("OldMediaHandler.removeAllTracks")],W_.prototype,"removeAllTracks",1),q_([Lv.trace("OldMediaHandler.setAudioTrack")],W_.prototype,"setAudioTrack",1),q_([Lv.trace("OldMediaHandler.setVideoTrack")],W_.prototype,"setVideoTrack",1),q_([Lv.trace("OldMediaHandler.setScreenShareTracks")],W_.prototype,"setScreenShareTracks",1),q_([Lv.trace("OldMediaHandler::disableAudio")],W_.prototype,"disableAudio",1),q_([Lv.trace("OldMediaHandler::enableAudio")],W_.prototype,"enableAudio",1),q_([Lv.trace("OldMediaHandler.toggleAudio")],W_.prototype,"toggleAudio",1),q_([Lv.trace("OldMediaHandler.toggleVideo")],W_.prototype,"toggleVideo",1),q_([Lv.trace("OldMediaHandler.toggleScreenShare")],W_.prototype,"toggleScreenShare",1);var J_,$_,K_,Q_,Y_,X_,ew,tw,nw=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;return(0,g.Z)(this,n),e=t.apply(this,arguments),Cs((0,f.Z)(e),"localMediaHandler"),e}return(0,y.Z)(n,[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},ff.init(),this.localMediaHandler){e.next=32;break}if(e.prev=2,i=!0,a=t.constraints||fv,!lv.defaults.mediaHandler){e.next=9;break}i=!1,this.localMediaHandler=lv.defaults.mediaHandler.localMediaHandler,e.next=23;break;case 9:if(!navigator.RNLocalMediaHandlerImpl){e.next=16;break}return o=navigator,s=o.RNLocalMediaHandlerImpl,e.next=13,s.init();case 13:this.localMediaHandler=e.sent,e.next=23;break;case 16:if(!jc.hasFeature(jf)){e.next=20;break}this.localMediaHandler=new u_(a),e.next=23;break;case 20:return e.next=22,W_.init(a);case 22:this.localMediaHandler=e.sent;case 23:if(e.t0=i,!e.t0){e.next=27;break}return e.next=27,this.localMediaHandler.setupStreams({video:null==(n=null==t?void 0:t.video)||n,audio:null==(r=null==t?void 0:t.audio)||r});case 27:e.next=32;break;case 29:e.prev=29,e.t1=e.catch(2),Dv.error("DyteSelf::init::Failed To Setup Streams",{error:{name:e.t1.name,message:e.t1.message}});case 32:case"end":return e.stop()}}),e,this,[[2,29]])})));return function(){return e.apply(this,arguments)}}()},{key:"audioTrack",get:function(){return this.localMediaHandler.audioTrack}},{key:"rawAudioTrack",get:function(){return this.localMediaHandler.rawAudioTrack}},{key:"addAudioMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.localMediaHandler.addAudioMiddleware(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeAudioMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.localMediaHandler.removeAudioMiddleware(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"videoTrack",get:function(){return this.localMediaHandler.videoTrack}},{key:"rawVideoTrack",get:function(){return this.localMediaHandler.rawVideoTrack}},{key:"addVideoMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.localMediaHandler.addVideoMiddleware(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeVideoMiddleware",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.localMediaHandler.removeVideoMiddleware(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"screenShareTracks",get:function(){return this.localMediaHandler.screenShareTracks}},{key:"audioEnabled",get:function(){return this.localMediaHandler.audioEnabled}},{key:"videoEnabled",get:function(){return this.localMediaHandler.videoEnabled}},{key:"screenShareEnabled",get:function(){return this.localMediaHandler.screenShareEnabled}},{key:"enableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localMediaHandler.enableAudio();
2case 2:this.emit("audioUpdate",{audioEnabled:this.audioEnabled,audioTrack:this.audioTrack});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"enableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localMediaHandler.enableVideo();case 2:this.emit("videoUpdate",{videoEnabled:this.videoEnabled,videoTrack:this.videoTrack});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localMediaHandler.disableAudio();case 2:this.emit("audioUpdate",{audioEnabled:this.audioEnabled,audioTrack:this.audioTrack});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localMediaHandler.disableVideo();
2case 2:this.emit("videoUpdate",{videoEnabled:this.videoEnabled,videoTrack:this.videoTrack});case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getCurrentDevices",value:function(){return this.localMediaHandler.getCurrentDevices()}},{key:"getAudioDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localMediaHandler.getAudioDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVideoDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localMediaHandler.getVideoDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getSpeakerDevices",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.localMediaHandler.getSpeakerDevices();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getDeviceById",value:function(e,t){var n;return"audio"===t?n="audioinput":"video"===t?n="videoinput":"speaker"===t&&(n="audiooutput"),this.localMediaHandler.getDeviceById(e,n)}},{key:"setDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={added:[t],removed:[]},!("onDeviceChange"in this.localMediaHandler)){e.next=5;break}return e.next=4,this.localMediaHandler.onDeviceChange(n,!0);case 4:return e.abrupt("return");case 5:e.t0=t.kind,e.next="audioinput"===e.t0?8:"audiooutput"===e.t0?19:"videoinput"===e.t0?22:33;break;case 8:return e.prev=8,e.next=11,this.localMediaHandler.setAudioDevice(t);case 11:e.next=15;break;case 13:e.prev=13,e.t1=e.catch(8);case 15:return e.prev=15,this.emit("audioUpdate",{audioEnabled:this.audioEnabled,audioTrack:this.audioTrack}),e.finish(15);case 18:return e.abrupt("break",33);case 19:return e.next=21,this.localMediaHandler.setSpeakerDevice(t);case 21:return e.abrupt("break",33);case 22:return e.prev=22,e.next=25,this.localMediaHandler.setVideoDevice(t);case 25:e.next=29;break;case 27:e.prev=27,e.t2=e.catch(22);case 29:return e.prev=29,this.emit("videoUpdate",{videoEnabled:this.videoEnabled,videoTrack:this.videoTrack}),e.finish(29);case 32:return e.abrupt("break",33);case 33:this.emit("deviceUpdate",{device:t});case 34:case"end":return e.stop()}}),e,this,[[8,13,15,18],[22,27,29,32]])})));return function(t){return e.apply(this,arguments)}}()}]),n}(ek),rw=Object.defineProperty,iw=Object.getOwnPropertyDescriptor,aw=function(e,t,n,r){for(var i,a=r>1?void 0:r?iw(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&rw(t,n,a),a},ow=function(e){return e.OFF_STAGE="OFF_STAGE",e.REQUESTED_TO_JOIN_STAGE="REQUESTED_TO_JOIN_STAGE",e.ACCEPTED_TO_JOIN_STAGE="ACCEPTED_TO_JOIN_STAGE",e.ON_STAGE="ON_STAGE",e}(ow||{}),sw=(tw=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i,a,o){var s,c;return(0,g.Z)(this,n),s=t.call(this),Ms((0,f.Z)(s),X_),Cs((0,f.Z)(s),"id"),Cs((0,f.Z)(s),"name"),Cs((0,f.Z)(s),"picture"),Cs((0,f.Z)(s),"clientSpecificId"),Cs((0,f.Z)(s),"waitlistStatus"),Ms((0,f.Z)(s),J_,void 0),Ms((0,f.Z)(s),$_,void 0),Ms((0,f.Z)(s),K_,void 0),Ms((0,f.Z)(s),Q_,void 0),Cs((0,f.Z)(s),"role"),Cs((0,f.Z)(s),"userId"),Cs((0,f.Z)(s),"organizationId"),Cs((0,f.Z)(s),"supportsRemoteControl",!1),Cs((0,f.Z)(s),"device"),Ms((0,f.Z)(s),Y_,"OFF_STAGE"),Cs((0,f.Z)(s),"stageStatus"),Cs((0,f.Z)(s),"presetName"),Cs((0,f.Z)(s),"roomState","init"),s.id=e,s.userId=r.id,s.name=r.name,s.picture=r.picture,s.clientSpecificId=null!=(c=r.customParticipantId)?c:r.clientSpecificId,s.waitlistStatus="none",As((0,f.Z)(s),K_,i),As((0,f.Z)(s),$_,a),As((0,f.Z)(s),Q_,!1),s.organizationId=r.organizationId,s.supportsRemoteControl=ff.isElectron(),s.device=ff.getDeviceInfo(),s.presetName=o,As((0,f.Z)(s),J_,Wv.isV2AuthToken?a.viewT
2ype:i.viewType),s}return(0,y.Z)(n,[{key:"setupEvents",value:function(){var e=this;sm.on(cm.ROOM_NODE_CONNECTED,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=Zs(e,X_,ew).isDisconnected,!t.t0){t.next=4;break}return t.next=4,e.resetSelf();case 4:Zs(e,X_,ew).isDisconnected=!1,Dv.info("DyteSelf::ROOM_NODE_CONNECTED");case 6:case"end":return t.stop()}}),t)})))),sm.on(cm.RESET_PRODUCER_STATE,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.roomJoined&&Zs(e,X_,ew)instanceof zb,!t.t0){t.next=14;break}if(t.t1=e.localMediaHandler.videoEnabled,!t.t1){t.next=6;break}return t.next=6,Zs(e,X_,ew).shareWebcam(e.localMediaHandler.videoTrack);case 6:if(t.t2=e.localMediaHandler.audioEnabled,!t.t2){t.next=10;break}return t.next=10,Zs(e,X_,ew).shareMic(e.localMediaHandler.audioTrack);case 10:if(t.t3=e.localMediaHandler.screenShareEnabled,!t.t3){t.next=14;break}return t.next=14,Zs(e,X_,ew).shareScreen({video:e.localMediaHandler.screenShareTracks.video,audio:e.localMediaHandler.screenShareTracks.audio});case 14:case"end":return t.stop()}}),t)})))),this.localMediaHandler.on("AUDIO_TRACK_CHANGE",(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Dv.info("DyteSelf::setupEvents::AUDIO_TRACK_CHANGE",(0,s.Z)({},Ek(e))),!e.roomJoined||!e.audioEnabled){t.next=9;break}return t.prev=1,t.next=4,Zs(e,X_,ew).shareMic(e.audioTrack);case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),Dv.error("DyteSelf::setupEvents::Error while sharing mic",{error:t.t0}),e.localMediaHandler.disableAudio();case 9:e.emit("audioUpdate",{audioEnabled:e.audioEnabled,audioTrack:e.audioTrack});case 10:case"end":return t.stop()}}),t,null,[[1,6]])})))),this.localMediaHandler.on("VIDEO_TRACK_CHANGE",(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Dv.info("DyteSelf::setupEvents::VIDEO_TRACK_CHANGE",(0,s.Z)({},Ek(e))),!e.videoEnabled||!e.roomJoined){t.next=13;break}return t.prev=1,t.next=4,Zs(e,X_,ew).shareWebcam(e.videoTrack);case 4:t.next=13;break;case 6:if(t.prev=6,t.t0=t.catch(1),Dv.error("DyteSelf::setupEvents::failed shareWebcam",{error:t.t0}),t.t1=e.videoEnabled,!t.t1){t.next=13;break}return t.next=13,e.localMediaHandler.disableVideo();case 13:e.emit("videoUpdate",{videoEnabled:e.videoEnabled,videoTrack:e.videoTrack});case 14:case"end":return t.stop()}}),t,null,[[1,6]])})))),this.localMediaHandler.on("DEVICE_CHANGE",function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.device,e.emit("deviceUpdate",{device:r});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.localMediaHandler.on("SCREENSHARE_TRACK_CHANGE",(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.roomJoined){t.next=3;break}return Dv.error("DyteSelf.SCREENSHARE_TRACK_CHANGE.LocalMediaInitialized_WithoutRoomNode"),t.abrupt("return");case 3:if(!e.screenShareEnabled){t.next=16;break}return t.prev=4,t.next=7,Zs(e,X_,ew).shareScreen(e.screenShareTracks);case 7:t.next=16;break;case 9:if(t.prev=9,t.t0=t.catch(4),Dv.error("DyteSelf::setupEvents::Error while sharing screen",{error:t.t0}),t.t1=e.screenShareEnabled,!t.t1){t.next=16;break}return t.next=16,e.localMediaHandler.disableScreenShare();case 16:Dv.info("DyteSelf::setupEvents::SCREENSHARE_TRACK_CHANGE",(0,s.Z)({},Ek(e))),e.emit("screenShareUpdate",{screenShareEnabled:e.screenShareEnabled,screenShareTracks:e.screenShareTracks});case 17:case"end":return t.stop()}}),t,null,[[4,9]])})))),this.localMediaHandler.on("SCREENSHARE_ENDED",(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.disableScreenShare();case 2:Dv.info("DyteSelf::setupEvents::SCREENSHARE_ENDED",(0,s.Z)({},Ek(e)));case 3:case"end":return t.stop()}}),t)})))),this.localMediaHandler.on("AUDIO_TRACK_SILENT",(function(){e.emit("audioTrackSilent"),Ic.mediaTrackMuted("AUDIO")})),this.localMediaHandler.on("FORCE_MUTE_AUDIO",this.disableAudio),this.localMediaHandler.on("FORCE_MUTE_VIDEO",(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.roomJoined,!t.t0){t.next=4;break}return t.next=4,Zs(e,X_,ew).pauseWebcam();
2case 4:e.emit("videoUpdate",{videoEnabled:e.videoEnabled,videoTrack:e.videoTrack}),Ic.videoOff();case 6:case"end":return t.stop()}}),t)}))))}},{key:"mediaPermissions",get:function(){return this.localMediaHandler.permissions}},{key:"permissions",get:function(){return Zs(this,K_)}},{key:"suggestedTheme",get:function(){return Zs(this,$_)}},{key:"config",get:function(){return Zs(this,$_)}},{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,X_,ew))?void 0:e.roomJoined)}},{key:"setName",value:function(e){if(!e)throw new Bv("Name cannot be empty.");this.name=e}},{key:"setupTracks",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:{},e.abrupt("return",(t.forceReset&&(Zs(this,X_,ew).stopAllProducers(),this.localMediaHandler.removeAllTracks()),this.localMediaHandler.setupStreams({video:null==(n=t.video)||n,audio:null==(r=t.audio)||r})));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"resetSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ic.callEnded(),null==(r=null==(n=null==(t=Zs(this,X_,ew))?void 0:t.sfuHandler)?void 0:n.cleanupConsumers)||r.call(n),e.next=4,null==(o=null==(a=null==(i=Zs(this,X_,ew))?void 0:i.sfuHandler)?void 0:a.setupTransports)?void 0:o.call(a);case 4:return e.next=6,null==(s=Zs(this,X_,ew))?void 0:s.joinRoom(this.name,!this.localMediaHandler.audioEnabled,Zs(this,X_,ew).roomUUID,Zs(this,X_,ew).meetingTitle,{audio:this.localMediaHandler.audioEnabled,video:this.localMediaHandler.videoEnabled,screen:this.localMediaHandler.screenShareEnabled});case 6:if(e.t0=this.localMediaHandler.videoEnabled,!e.t0){e.next=10;break}return e.next=10,null==(c=Zs(this,X_,ew))?void 0:c.shareWebcam(this.localMediaHandler.videoTrack);case 10:if(e.t1=this.localMediaHandler.audioEnabled,!e.t1){e.next=14;break}return e.next=14,null==(u=Zs(this,X_,ew))?void 0:u.shareMic(this.localMediaHandler.audioTrack);case 14:if(e.t2=this.localMediaHandler.screenShareEnabled,!e.t2){e.next=18;break}return e.next=18,null==(l=Zs(this,X_,ew))?void 0:l.shareScreen({video:this.localMediaHandler.screenShareTracks.video,audio:this.localMediaHandler.screenShareTracks.audio});case 18:Dv.info("DyteSelf::resetSelf");case 19:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"destructMediaHandler",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Dv.info("DyteSelf::destructMediaHandler"),this.localMediaHandler.destruct()));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeDocumentEventListeners",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(Dv.info("DyteSelf::removeDocumentEventListeners"),this.localMediaHandler.removeDocumentEventListeners()));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"enableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.permissions.canProduceAudio===Hv.notAllowed||"WEBINAR"===Zs(this,$_).viewType&&Zs(this,K_).canProduceAudio===Hv.canRequest&&("OFF_STAGE"===this.webinarStageStatus||"REQUESTED_TO_JOIN_STAGE"===this.webinarStageStatus)||this.audioEnabled){e.next=17;break}return e.next=3,this.localMediaHandler.enableAudio();case 3:if(!this.roomJoined){e.next=16;break}if(!this.audioTrack){e.next=13;break}return e.prev=5,e.next=8,Zs(this,X_,ew).shareMic(this.audioTrack);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),Dv.error("DyteSelf::enableAudio::Error while sharing mic",{error:e.t0}),this.localMediaHandler.disableAudio();case 13:if(this.audioEnabled){e.next=15;break}return e.abrupt("return");case 15:Zs(this,X_,ew).unmuteSelf();
2case 16:this.emit("audioUpdate",{audioEnabled:this.audioEnabled,audioTrack:this.audioTrack}),Ic.audioOn();case 17:case"end":return e.stop()}}),e,this,[[5,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"enableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,K_).canProduceVideo===Hv.notAllowed||"WEBINAR"===Zs(this,$_).viewType&&Zs(this,K_).canProduceVideo===Hv.canRequest&&("OFF_STAGE"===this.webinarStageStatus||"REQUESTED_TO_JOIN_STAGE"===this.webinarStageStatus)||this.videoEnabled){e.next=17;break}return e.next=3,this.localMediaHandler.enableVideo();case 3:if(!this.roomJoined){e.next=16;break}return e.prev=4,e.next=7,Zs(this,X_,ew).shareWebcam(this.videoTrack);case 7:e.next=16;break;case 9:if(e.prev=9,e.t0=e.catch(4),Dv.error("DyteSelf::enableVideo::Error while sharing video",{error:e.t0}),e.t1=this.videoEnabled,!e.t1){e.next=16;break}return e.next=16,this.localMediaHandler.disableVideo();case 16:this.emit("videoUpdate",{videoEnabled:this.videoEnabled,videoTrack:this.videoTrack}),Dv.info("DyteSelf.enableVideo",(0,s.Z)({},Ek(this))),Ic.videoOn();case 17:case"end":return e.stop()}}),e,this,[[4,9]])})));return function(){return e.apply(this,arguments)}}()},{key:"enableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t enable screenshare without joining room");case 2:if(Zs(this,K_).canProduceScreenshare===Hv.notAllowed||"WEBINAR"===Zs(this,$_).viewType&&Zs(this,K_).canProduceScreenshare===Hv.canRequest&&("OFF_STAGE"===this.webinarStageStatus||"REQUESTED_TO_JOIN_STAGE"===this.webinarStageStatus)||this.screenShareEnabled){e.next=19;break}return e.next=5,this.localMediaHandler.enableScreenShare();case 5:if(!this.screenShareTracks.audio&&!this.screenShareTracks.video){e.next=18;break}return e.prev=6,e.next=9,Zs(this,X_,ew).shareScreen(this.screenShareTracks);case 9:e.next=18;break;case 11:if(e.prev=11,e.t0=e.catch(6),Dv.error("DyteSelf::enableScreenShare::Error while sharing screen",{error:e.t0}),e.t1=this.screenShareEnabled,!e.t1){e.next=18;break}return e.next=18,this.localMediaHandler.disableScreenShare();
2case 18:this.emit("screenShareUpdate",{screenShareEnabled:this.screenShareEnabled,screenShareTracks:this.screenShareTracks});case 19:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(){return e.apply(this,arguments)}}()},{key:"disableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.audioEnabled&&(this.localMediaHandler.disableAudio(),this.roomJoined&&Zs(this,X_,ew).muteSelf(),this.emit("audioUpdate",{audioEnabled:this.audioEnabled,audioTrack:this.audioTrack}),Ic.audioOff());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.videoEnabled,!e.t0){e.next=9;break}return e.next=4,this.localMediaHandler.disableVideo();case 4:if(e.t1=this.roomJoined,!e.t1){e.next=8;break}return e.next=8,Zs(this,X_,ew).pauseWebcam();case 8:"ACCEPTED"===this.mediaPermissions.video&&(this.emit("videoUpdate",{videoEnabled:this.videoEnabled,videoTrack:this.videoTrack}),Ic.videoOff());case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableScreenShare",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.screenShareEnabled,!e.t0){e.next=9;break}return e.next=4,this.localMediaHandler.disableScreenShare();case 4:if(e.t1=this.roomJoined,!e.t1){e.next=8;break}return e.next=8,Zs(this,X_,ew).disableScreenShare();case 8:this.emit("screenShareUpdate",{screenShareEnabled:this.screenShareEnabled,screenShareTracks:this.screenShareTracks});case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAllDevices",value:function(){return this.localMediaHandler.getAllDevices()}},{key:"setIsPinned",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];As(this,Q_,e);var n=e?"pinned":"unpinned";t&&this.emit(n,this)}},{key:"isPinned",get:function(){return Zs(this,Q_)}},{key:"webinarStageStatus",get:function(){return Zs(this,Y_)}},{key:"pin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t pin participants without joining room");case 2:return e.abrupt("return",Zs(this,X_,ew).pinPeer(this.id));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"unpin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t unpin participants without joining room");case 2:return e.abrupt("return",Zs(this,X_,ew).pinPeer(null));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setDevice",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={added:[t],removed:[]},!("onDeviceChange"in this.localMediaHandler)){e.next=5;break}return e.next=4,this.localMediaHandler.onDeviceChange(n,!0);case 4:return e.abrupt("return");case 5:e.t0=t.kind,e.next="audioinput"===e.t0?8:"audiooutput"===e.t0?21:"videoinput"===e.t0?24:37;break;case 8:return e.prev=8,e.next=11,this.localMediaHandler.setAudioDevice(t);case 11:e.next=20;break;case 13:if(e.prev=13,e.t1=e.catch(8),e.t2=this.roomJoined,!e.t2){e.next=19;break}return e.next=19,Zs(this,X_,ew).muteSelf();case 19:this.emit("audioUpdate",{audioEnabled:this.audioEnabled,audioTrack:this.audioTrack});case 20:return e.abrupt("break",37);case 21:return e.next=23,this.localMediaHandler.setSpeakerDevice(t);case 23:return e.abrupt("break",37);case 24:return e.prev=24,e.next=27,this.localMediaHandler.setVideoDevice(t);case 27:e.next=36;break;case 29:if(e.prev=29,e.t3=e.catch(24),e.t4=this.roomJoined,!e.t4){e.next=35;break}return e.next=35,Zs(this,X_,ew).pauseWebcam();
2case 35:this.emit("videoUpdate",{videoEnabled:this.videoEnabled,videoTrack:this.videoTrack});case 36:return e.abrupt("break",37);case 37:this.emit("deviceUpdate",{device:t});case 38:case"end":return e.stop()}}),e,this,[[8,13],[24,29]])})));return function(t){return e.apply(this,arguments)}}()},{key:"cleanUpTracks",value:function(){var e,t,n,r;null==(e=this.audioTrack)||e.stop(),null==(t=this.rawAudioTrack)||t.stop(),null==(n=this.videoTrack)||n.stop(),null==(r=this.rawVideoTrack)||r.stop()}},{key:"requestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t request to join stage without joining room");case 2:if(Zs(this,J_)===Kd.Webinar){e.next=4;break}throw new Bv("Not allowed to go on stage on non webinar meeting");case 4:if(this.permissions.requestProduce){e.next=6;break}throw Dv.error("DyteSelf::requestGoToStage::permission_denied"),new Bv("User does not have permission to go on stage");case 6:return e.next=8,Zs(this,X_,ew).requestToJoinStage(rm.PRESENT);case 8:this.setWebinarStageStatus("REQUESTED_TO_JOIN_STAGE");case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"withdrawRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t request to join stage without joining room");case 2:if(Zs(this,J_)===Kd.Webinar){e.next=4;break}throw new Bv("Not allowed to go on stage on non webinar meeting");case 4:if(e.t0="REQUESTED_TO_JOIN_STAGE"===this.webinarStageStatus,!e.t0){e.next=9;break}return e.next=8,Zs(this,X_,ew).withdrawRequestToJoinStage();case 8:this.setWebinarStageStatus("OFF_STAGE");case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"leaveStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t leave stage without joining room");case 2:if(Zs(this,J_)===Kd.Webinar){e.next=4;break}throw new Bv("Not allowed to leave stage on non webinar meeting");case 4:return e.next=6,this.disableScreenShare();case 6:return e.next=8,this.disableVideo();case 8:return e.next=10,this.disableAudio();case 10:return this.localMediaHandler.destruct(),e.next=13,Zs(this,X_,ew).stopPresenting();case 13:this.setWebinarStageStatus("OFF_STAGE");case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"joinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t join stage without joining room");case 2:if(this.permissions.canPresent||"ACCEPTED_TO_JOIN_STAGE"===this.webinarStageStatus){e.next=4;break}throw Dv.error("DyteSelf::joinStage::permission_denied"),new Bv("User does not have permission to join stage");case 4:return e.next=6,Zs(this,X_,ew).startPresenting();case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWebinarStageStatus",value:function(e){switch(As(this,Y_,e),e){case"REQUESTED_TO_JOIN_STAGE":this.emit("peerRequestToJoinStage");break;case"OFF_STAGE":this.emit("stageLeft")}}},{key:"disablePreview",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this);case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}],[{key:"__init__",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i,a){var o,s,c,u,l,d,h;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=null==(s=null==(o=lv.defaults)?void 0:o.audio)||s,d=null==(u=null==(c=lv.defaults)?void 0:c.video)||u,"ALLOWED"!==r.canProduceAudio&&(l=!1),"ALLOWED"!==r.canProduceVideo&&(d=!1),h=new sw(t,n,r,i,a),e.next=5,h.init({audio:l,video:d});case 5:return h.setupEvents(),e.abrupt("return",h);case 7:case"end":return e.stop()}}),e)})));return function(t,n,r,i,a){return e.apply(this,arguments)}}()}]),n}(nw),J_=new WeakMap,$_=new WeakMap,K_=new WeakMap,Q_=new WeakMap,Y_=new WeakMap,X_=new WeakSet,ew=function(){return Sk()},tw);aw([Lv.trace("DyteSelf.setupEvents")],sw.prototype,"setupEvents",1),aw([Lv.trace("DyteSelf.setupTracks")],sw.prototype,"setupTracks",1),aw([Lv.trace("DyteSelf.resetSelf")],sw.prototype,"resetSelf",1),aw([Lv.trace("DyteSelf.destructMediaHandler")],sw.prototype,"destructMediaHandler",1),aw([Lv.trace("DyteSelf.removeDocumentEventListeners")],sw.prototype,"removeDocumentEventListeners",1),aw([Lv.trace("DyteSelf.enableAudio")],sw.prototype,"enableAudio",1),aw([Lv.trace("DyteSelf.enableVideo")],sw.prototype,"enableVideo",1),aw([Lv.trace("DyteSelf.enableScreenShare")],sw.prototype,"enableScreenShare",1),aw([Lv.trace("DyteSelf.disableAudio")],sw.prototype,"disableAudio",1),aw([Lv.trace("DyteSelf.disableVideo")],sw.prototype,"disableVideo",1),aw([Lv.trace("DyteSelf.disableScreenShare")],sw.prototype,"disableScreenShare",1),aw([Lv.trace("DyteSelf.setDevice")],sw.prototype,"setDevice",1),aw([Lv.trace("DyteSelf.requestToJoinStage")],sw.prototype,"requestToJoinStage",1),aw([Lv.trace("DyteSelf.withdrawRequestToJoinStage")],sw.prototype,"withdrawRequestToJoinStage",1),aw([Lv.trace("DyteSelf.leaveStage")],sw.prototype,"leaveStage",1),aw([Lv.trace("DyteSelf.joinStage")],sw.prototype,"joinStage",1),aw([Lv.trace("DyteSelf.deprecated.disablePreview")],sw.prototype,"disablePreview",1),sw=aw([zv((function(e){throw new Bv(e.message,"1100")}))],sw);var cw=function(){function e(t){(0,g.Z)(this,e),Cs(this,"socket"),this.socket=t}return(0,y.Z)(e,[{key:"onReconnect",set:function(e){this.socket.onStateEvent("reconnected",e)}},{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i){var a,o,s,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={capabilities:[],peer:{displayName:t,peerId:n,userId:r},roomUuid:i},e.t0=Rg,e.next=4,this.socket.sendMessagePromise(nb.joinRoom,Ig.toBinary(a));case 4:return e.t1=e.sent.payload,o=e.t0.fromBinary.call(e.t0,e.t1),e.next=8,sm.emitAsync(cm.SOCKET_SERVICE_ROOM_JOINED,o);case 8:return e.prev=8,e.next=11,this.getRoomState();case 11:s=e.sent,c=s.room,sm.emit(cm.ROOM_STATE,c),e.next=19;break;case 16:e.prev=16,e.t2=e.catch(8),Dv.error("RoomSocketHandler.joinRoom.failedToGetRoomState",{error:e.t2});case 19:case"end":return e.stop()}}),e,this,[[8,16]])})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"getRoomState",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ag.create(),e.prev=1,e.next=4,this.socket.sendMessagePromise(nb.getRoomInfo);case 4:n=e.sent,t=Ag.fromBinary(n.payload),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),Dv.error("getRoomState::binary_decode_error",{error:e.t0});case 11:return e.abrupt("return",t);case 12:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(){return e.apply(this,arguments)}}()},{key:"leaveRoom",value:function(){this.socket.sendMessage(nb.leaveRoom,Og.toBinary({}))}}]),e}();function uw(e){if(!Wv.isV2AuthToken)return!1;var t=e;return[t.canProduceAudio,t.canProduceScreenshare,t.canProduceVideo].includes(Yd.Allowed)}function lw(e){return!jc.hasFeature(Kf)||"LIVESTREAM"!==e.viewType}var dw,pw,hw,fw,vw=Object.defineProperty,mw=Object.getOwnPropertyDescriptor,gw=function(e,t,n,r){for(var i,a=r>1?void 0:r?mw(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&vw(t,n,a),a},yw=(fw=function(){function e(t,n){var r,i,a,o;(0,g.Z)(this,e),Ms(this,pw),Cs(this,"self"),Cs(this,"authToken"),Cs(this,"peerId"),Ms(this,dw,void 0),Cs(this,"roomNodeSetupInProgress",!1),As(this,dw,t),this.authToken=null!=(i=null==(r=Sk())?void 0:r.authToken)?i:t.authToken,this.peerId=null!=(o=null==(a=Sk())?void 0:a.peerId)?o:t.peerId,this.self=n,this.setupEvents()}return(0,y.Z)(e,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,pw,hw))?void 0:e.roomJoined)}},{key:"shareMediaTracks",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.self.videoTrack&&Zs(this,pw,hw).shareWebcam(this.self.videoTrack),this.self.audioTrack&&Zs(this,pw,hw).shareMic(this.self.audioTrack)]);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setupEvents",value:function(){var e=this;sm.on(cm.DISABLE_AUDIO,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.self.audioEnabled,!t.t0){t.next=5;break}return t.next=4,e.self.disableAudio();case 4:Ic.audioOff();case 5:case"end":return t.stop()}}),t)})))),sm.on(cm.DISABLE_VIDEO,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.self.videoEnabled,!t.t0){t.next=5;break}return t.next=4,e.self.disableVideo();case 4:Ic.videoOff();case 5:case"end":return t.stop()}}),t)})))),sm.on(cm.MUTE_ALL,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.self.audioEnabled,!t.t0){t.next=5;break}return t.next=4,e.self.disableAudio();case 4:Ic.audioOff();case 5:case"end":return t.stop()}}),t)})))),sm.on(cm.MUTE_ALL_VIDEO,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.self.videoEnabled,!t.t0){t.next=5;break}return t.next=4,e.self.disableVideo();case 4:Ic.videoOff();case 5:case"end":return t.stop()}}),t)})))),sm.on(cm.WAITLISTED,(function(){e.self.waitlistStatus="waiting",e.self.roomState="waitlisted",e.self.emit("waitlisted")})),sm.on(cm.WAITLIST_ACCEPTED,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("accepted"!==e.self.waitlistStatus){t.next=3;break}return Dv.warn("SelfController.WAITLIST_ACCEPTED.UserAlreadyAccepted"),t.abrupt("return");case 3:e.self.waitlistStatus="accepted",e.joinRoom();case 4:case"end":return t.stop()}}),t)})))),sm.on(cm.WAITLIST_REJECTED,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("rejected"!==e.self.waitlistStatus){t.next=3;break}return Dv.warn("SelfController.WAITLIST_REJECTED.UserAlreadyRejected"),t.abrupt("return");case 3:e.self.waitlistStatus="rejected",e.leaveRoom("rejected");case 4:case"end":return t.stop()}}),t)})))),sm.on(cm.KICKED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r="kicked","kickAll"===(null==n?void 0:n.kickType)&&(r="ended"),e.leaveRoom(r);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.SELF_ROOM_JOINED,(function(){"WEBINAR"===e.self.config.viewType&&e.self.permissions.canPresent&&e.self.joinStage(),e.self.roomState="joined",e.self.emit("roomJoined")})),sm.on(cm.SOCKET_SERVICE_ROOM_JOINED,(function(){e.self.emit("socketServiceRoomJoined")})),sm.on(cm.MEDIA_PERMISSION_UPDATE,(function(t){e.self.emit("mediaPermissionUpdate",t)})),sm.on(cm.MEDIA_PERMISSION_ERROR,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.kind,i=n.message,"audio"===r?(Ic.mediaPermission("AUDIO",Nk(i)),e.self.disableAudio()):"video"===r?(Ic.mediaPermission("VIDEO",Nk(i)),e.self.disableVideo()):"screenshare"===r&&(Ic.mediaPermission("VIDEO",Nk(i)),e.self.disableScreenShare()),Dv.error("SelfController::mediaPermissionError",{error:{message:n.message},constraints:n.constraints,mediaPermissionsErrors:{kind:r,message:i}}),e.self.emit("mediaPermissionError",n),e.self.emit("mediaPermissionUpdate",{message:i,kind:r});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.REQUEST_TO_JOIN_STAGE_ACCEPTED,(function(){e.self.setWebinarStageStatus(ow.ACCEPTED_TO_JOIN_STAGE),e.self.emit("joinStageRequestAccepted")})),sm.on(cm.REQUEST_TO_JOIN_STAGE_REJECTED,(function(){e.self.setWebinarStageStatus(ow.OFF_STAGE),e.self.emit("joinStageRequestRejected")})),sm.on(cm.REMOVED_FROM_STAGE,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.self.setWebinarStageStatus(ow.OFF_STAGE),t.next=3,e.self.disableScreenShare();case 3:return t.next=5,e.self.disableVideo();case 5:return t.next=7,e.self.disableAudio();case 7:e.self.destructMediaHandler(),e.self.emit("removedFromStage");case 9:case"end":return t.stop()}}),t)})))),sm.on(cm.STARTED_PRESENTING,(function(){e.self.setWebinarStageStatus(ow.ON_STAGE),e.self.emit("stageJoined")})),sm.on(cm.STOPPED_PRESENTING,(function(){e.self.setWebinarStageStatus(ow.OFF_STAGE),e.self.emit("stageLeft")})),sm.on(cm.PRODUCER_SCORE_UPDATE,(function(t){var n,r=t.score,i=t.kind,a=t.appData,o="video"===i&&null!=(n=null==a?void 0:a.screenShare)&&n;e.self.emit("mediaScoreUpdate",{kind:i,isScreenshare:o,score:r})})),sm.on(cm.PRODUCER_STATUS_UPDATE,(function(t){var n=t.status;e.self.emit("mediaChannelUpdate",{status:n})})),sm.onAsync(cm.JOIN_MEDIA_ROOM,this.setupRoomNode.bind(this)),sm.onAsync(cm.LEAVE_MEDIA_ROOM,this.leaveMediaRoom.bind(this))}},{key:"setupRoomNode",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,c;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.roomNodeSetupInProgress){e.next=3;break}return Dv.warn("SelfController.roomNodeSetupInProgress"),e.abrupt("return");case 3:if(null==(t=Zs(this,pw,hw))||!t.roomJoined){e.next=6;break}return Dv.warn("SelfController.roomNodeAlreadySetup"),e.abrupt("return");case 6:return this.roomNodeSetupInProgress=!0,i=Wv.roomNodeOptions,e.next=10,kk((0,s.Z)((0,s.Z)({},i),{},{roomName:i.roomName,peerId:i.peerId}));case 10:if(a="",!(Zs(this,pw,hw)instanceof gk)){e.next=18;break}return e.next=14,Zs(this,pw,hw).setupTransports();case 14:return e.next=16,Zs(this,pw,hw).getRoomState();case 16:c=e.sent,o=null!=(r=null==(n=null==c?void 0:c.payload)?void 0:n.roomState)?r:{},a=o.roomUUID,Xy().setRoomUUID(a);
2case 18:return e.next=20,this.joinMediaRoom(a);case 20:this.roomNodeSetupInProgress=!1;case 21:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s,c=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,r=Xy(),i="",!(Zs(this,pw,hw)instanceof gk)){e.next=8;break}return e.next=6,Zs(this,pw,hw).getRoomState();case 6:o=e.sent,a=null!=(n=null==(t=null==o?void 0:o.payload)?void 0:t.roomState)?n:{},i=a.roomUUID,r.setRoomUUID(i);case 8:if(s=new cw(Zs(this,dw)),e.t0=Kv(this.self.config.viewType,Zs(this,dw).capabilities)||"socket-service"===Yv("chat_socket_server"),!e.t0){e.next=15;break}return e.next=13,s.joinRoom(this.self.name,this.self.id,this.self.userId,i);case 13:s.socket.flush(),s.onReconnect=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.joinRoom(c.self.name,c.self.id,c.self.userId,i);case 2:s.socket.flush();case 3:case"end":return e.stop()}}),e)})));case 15:if(e.t1=lw(this.self.config),!e.t1){e.next=19;break}return e.next=19,this.joinMediaRoom(i);case 19:e.next=24;break;case 21:throw e.prev=21,e.t2=e.catch(0),Dv.error("Error in joinRoom",{error:e.t2}),e.t2;case 24:case"end":return e.stop()}}),e,this,[[0,21]])})));return function(){return e.apply(this,arguments)}}()},{key:"leaveRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"left",r=this.roomJoined,e.next=4,this.leaveMediaRoom();case 4:try{null==(n=Zs(this,dw))||n.disconnect()}catch(a){Dv.error("SelfController::leaveRoom::socketDisconnect")}this.self.roomState=t,wk(),("LIVESTREAM"===this.self.config.viewType||r)&&this.self.emit("roomLeft",{state:t});case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"joinMediaRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null!=(n=Zs(this,pw,hw))&&n.isDisconnected&&Zs(this,pw,hw)instanceof gk)){e.next=3;break}return null==(r=Zs(this,pw,hw))||r.reconnect(),e.abrupt("return");case 3:return e.next=5,null==(i=Zs(this,pw,hw))?void 0:i.joinRoom(this.self.name,!this.self.audioEnabled,t,void 0,{audio:this.self.audioEnabled,video:this.self.videoEnabled,screen:this.self.screenShareEnabled});case 5:if(e.t0=a=e.sent,null==e.t0){e.next=10;break}e.t1=a,e.next=11;break;case 10:e.t1={};case 11:if(o=e.t1,s=o.roomJoined,Zs(this,pw,hw)instanceof zb&&(Zs(this,pw,hw).onSocketReconnection=this.joinMediaRoom.bind(this,t)),e.t2=s,!e.t2){e.next=18;break}return e.next=18,this.shareMediaTracks();case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"leaveMediaRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.cleanupSelf();case 2:if(e.t0=Zs(this,pw,hw)&&this.roomJoined,!e.t0){e.next=7;break}return e.next=6,Zs(this,pw,hw).leaveRoom();case 6:Zs(this,pw,hw).roomJoined=!1;case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cleanupSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.self.disableAudio();case 2:return e.next=4,this.self.disableVideo();case 4:return e.next=6,this.self.disableScreenShare();case 6:this.self.cleanUpTracks(),this.self.destructMediaHandler(),this.self.removeDocumentEventListeners();case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i,a){var o,s,c,u,l,d,f;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=Xy(),u=Wv.isV2AuthToken,e.next=4,
2sw.__init__(null!=(s=null==(o=Sk())?void 0:o.peerId)?s:t.peerId,Wv.isV2AuthToken?n.participant:n,r,i,a);case 4:return l=e.sent,d=u?n.participant.organizationId:n.organizationId,Lv.meetingMetadata.organizationId=d,jc.hasFeature(Pf)&&"ReactNative"!==navigator.product&&(jc.getValue(Bf),f="dev",lv.apiBase.indexOf("cluster.dyte")>-1?f="production":lv.apiBase.indexOf("staging.dyte")>-1&&(f="staging"),setTimeout((0,h.Z)((0,p.Z)().mark((function e(){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Ic,e.t1=null!=(r=null==(n=Sk())?void 0:n.peerId)?r:t.peerId,e.t2=ff.getDeviceInfo().engineName,e.t3=f,e.next=6,c.getICEServers();case 6:e.t4=e.sent,e.t5=lv.apiBase,e.t6=jc.getAllFlags(),e.t7=Dv,e.t8={peerId:e.t1,engineName:e.t2,env:e.t3,iceServers:e.t4,apiBase:e.t5,flags:e.t6,logger:e.t7},e.t0.initialize.call(e.t0,e.t8);case 12:case"end":return e.stop()}}),e)}))))),e.abrupt("return",new yw(t,l));case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,i,a){return e.apply(this,arguments)}}()}]),e}(),dw=new WeakMap,pw=new WeakSet,hw=function(){return Sk()},fw),bw=yw;gw([Lv.trace("SelfController.setupEvents")],bw.prototype,"setupEvents",1),gw([Lv.trace("SelfController.joinRoom")],bw.prototype,"joinRoom",1),gw([Lv.trace("SelfController.leaveRoom")],bw.prototype,"leaveRoom",1),gw([Lv.trace("SelfController.joinMediaRoom")],bw.prototype,"joinMediaRoom",1),gw([Lv.trace("SelfController.leaveMediaRoom")],bw.prototype,"leaveMediaRoom",1);var kw,_w,ww,xw,Sw,Ew,Tw,Pw=Object.defineProperty,Cw=Object.getOwnPropertyDescriptor,Rw=function(e,t,n,r){for(var i,a=r>1?void 0:r?Cw(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Pw(t,n,a),a},Zw=(Sw=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;(0,g.Z)(this,n),i=t.call(this),Ms((0,f.Z)(i),_w),Cs((0,f.Z)(i),"id"),Cs((0,f.Z)(i),"userId"),Cs((0,f.Z)(i),"name"),Cs((0,f.Z)(i),"picture"),Cs((0,f.Z)(i),"isHost"),Cs((0,f.Z)(i),"clientSpecificId"),Cs((0,f.Z)(i),"flags"),Cs((0,f.Z)(i),"device"),Cs((0,f.Z)(i),"videoTrack"),Cs((0,f.Z)(i),"audioTrack"),Cs((0,f.Z)(i),"screenShareTracks"),Cs((0,f.Z)(i),"videoEnabled"),Cs((0,f.Z)(i),"audioEnabled"),Cs((0,f.Z)(i),"screenShareEnabled"),Cs((0,f.Z)(i),"producers"),Ms((0,f.Z)(i),kw,void 0),Cs((0,f.Z)(i),"supportsRemoteControl",!1),Cs((0,f.Z)(i),"webinarStageStatus",ow.OFF_STAGE),Cs((0,f.Z)(i),"presetName"),Ms((0,f.Z)(i),xw,void 0);var a=e.id,o=e.userId,s=e.displayName,c=e.device,u=e.picture,l=e.isHost,d=e.flags,p=e.clientSpecificId,h=e.customParticipantId,v=e.audioMuted,m=e.audioTrack,y=e.videoEnabled,b=void 0!==y&&y,k=e.videoTrack,_=e.producers,w=e.metadata;return i.id=a,i.userId=o,i.name=s,i.device=c,i.picture=u,i.isHost=l,i.flags=d,i.clientSpecificId=null!=h?h:p,i.audioEnabled=!v,i.audioTrack=m,i.videoEnabled=b,i.videoTrack=k,i.screenShareTracks={audio:void 0,video:void 0},i.producers=null!=_?_:[],i.presetName=null==w?void 0:w.preset_name,As((0,f.Z)(i),kw,!1),As((0,f.Z)(i),xw,r),i}return(0,y.Z)(n,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,_w,ww))?void 0:e.roomJoined)}},{key:"setVideoEnabled",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.videoEnabled=e,t&&(Dv.info("DyteParticipant::setVideoEnabled::videoUpdate",(0,s.Z)({},Ek(this))),this.emit("videoUpdate",{videoEnabled:this.videoEnabled,videoTrack:this.videoTrack}))}},{key:"setAudioEnabled",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.audioEnabled=e,t&&(Dv.info("DyteParticipant::setAudioEnabled::audioUpdate",(0,s.Z)({},Ek(this))),this.emit("audioUpdate",{audioEnabled:this.audioEnabled,audioTrack:this.audioTrack}))}},{key:"setScreenShareEnabled",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.screenShareEnabled=e,t&&this.emit("screenShareUpdate",{screenShareEnabled:this.screenShareEnabled,screenShareTracks:this.screenShareTracks})}},{key:"pin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t pin participant without joining room");
2case 2:return e.abrupt("return",Zs(this,_w,ww).pinPeer(this.id));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"unpin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t unpin participant without joining room");case 2:return e.abrupt("return",Zs(this,_w,ww).pinPeer(null));case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setIsPinned",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];As(this,kw,e);var n=e?"pinned":"unpinned";t&&this.emit(n,this)}},{key:"disableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.id,Dv.info("DyteParticipant::disable_audio",{dyteParticipant:{id:t}}),this.roomJoined){e.next=3;break}throw new Bv("Can`t disable participant audio without joining room");case 3:if(!Zs(this,xw).permissions.canDisableParticipantAudio){e.next=5;break}return e.abrupt("return",Zs(this,_w,ww).disableAudio(t));case 5:throw Dv.error("DyteParticipant::unauthorized_disable_audio",{dyteParticipant:{id:t}}),new Bv("Unauthorized: User does not have permission to disable participant audio.");case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"kick",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.id,Dv.info("DyteParticipant::kick",{dyteParticipant:{id:t}}),this.roomJoined){e.next=3;break}throw new Bv("Can`t kick participant without joining room");case 3:if(!Zs(this,xw).permissions.kickParticipant){e.next=5;break}return e.abrupt("return",Zs(this,_w,ww).kick(t));case 5:throw Dv.error("DyteParticipant::unauthorized_kick",{dyteParticipant:{id:t}}),new Bv("Unauthorized: User does not have permission to kick participants.");case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.id,Dv.info("DyteParticipant::disable_video",{dyteParticipant:{id:t}}),this.roomJoined){e.next=3;break}throw new Bv("Can`t disable participant video without joining room");case 3:if(!Zs(this,xw).permissions.canDisableParticipantVideo){e.next=5;break}return e.abrupt("return",Zs(this,_w,ww).disableVideo(t));case 5:throw Dv.error("DyteParticipant::unauthorized_disable_video",{dyteParticipant:{id:t}}),new Bv("Unauthorized: User does not have permission to disable participant video.");case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"acceptJoinStageRequest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t acceptJoinStageRequest for participant without joining room");case 2:Zs(this,_w,ww).acceptAllRequestToJoinStage([{id:this.id,requestToJoinType:rm.PRESENT}]);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"rejectRequestToJoinStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t rejectRequestToJoinStage for participant without joining room");
2case 2:Zs(this,_w,ww).rejectRequestToJoinStage(this.id);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"removeFromStage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t removeFromStage participant without joining room");case 2:Zs(this,_w,ww).removePeerFromStage(this.id,nm.REQUESTED_BY_MODERATOR);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setWebinarStageStatus",value:function(e){var t;this.webinarStageStatus=e,e===ow.OFF_STAGE&&(t="peerStoppedPresenting"),e===ow.ON_STAGE&&(t="peerStartedPresenting"),e===ow.ACCEPTED_TO_JOIN_STAGE&&(t="peerAcceptedToJoinStage"),e===ow.REQUESTED_TO_JOIN_STAGE&&(t="peerRequestToJoinStage"),t&&this.emit(t,this)}},{key:"isPinned",get:function(){return Zs(this,kw)}}]),n}(ek),kw=new WeakMap,_w=new WeakSet,ww=function(){return Sk()},xw=new WeakMap,Sw);Rw([Lv.trace("DyteParticipant.disableAudio")],Zw.prototype,"disableAudio",1),Rw([Lv.trace("DyteParticipant.kick")],Zw.prototype,"kick",1),Rw([Lv.trace("DyteParticipant.disableVideo")],Zw.prototype,"disableVideo",1),Rw([Lv.trace("DyteParticipant.acceptJoinStageRequest")],Zw.prototype,"acceptJoinStageRequest",1),Rw([Lv.trace("DyteParticipant.rejectRequestToJoinStage")],Zw.prototype,"rejectRequestToJoinStage",1),Rw([Lv.trace("DyteParticipant.removeFromStage")],Zw.prototype,"removeFromStage",1),Rw([Lv.trace("DyteParticipant.setWebinarStageStatus")],Zw.prototype,"setWebinarStageStatus",1),Zw=Rw([zv((function(e){throw new Bv(e.message,"1200")}))],Zw);var Mw=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;(0,g.Z)(this,n);var i=null!=e?e:{},a=i.onAddEvent,o=void 0===a?"added":a,s=i.onDeleteEvent,c=void 0===s?"deleted":s,u=i.onClearEvent,l=void 0===u?"cleared":u;return r=t.call(this),Ms((0,f.Z)(r),Ew,void 0),Ms((0,f.Z)(r),Tw,void 0),Cs((0,f.Z)(r),"onAddEvent"),Cs((0,f.Z)(r),"onDeleteEvent"),Cs((0,f.Z)(r),"onClearEvent"),As((0,f.Z)(r),Ew,new ek),r.onAddEvent=o,r.onDeleteEvent=c,r.onClearEvent=l,As((0,f.Z)(r),Tw,new Map),r}return(0,y.Z)(n,[{key:"emit",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return(t=Zs(this,Ew)).emit.apply(t,[e].concat(r))}},{key:"on",value:function(e,t){return Zs(this,Ew).on(e,t)}},{key:"addListener",value:function(e,t){return Zs(this,Ew).addListener(e,t)}},{key:"off",value:function(e,t){return Zs(this,Ew).off(e,t)}},{key:"once",value:function(e,t){return Zs(this,Ew).once(e,t)}},{key:"prependListener",value:function(e,t){return Zs(this,Ew).prependListener(e,t)}},{key:"prependOnceListener",value:function(e,t){return Zs(this,Ew).prependOnceListener(e,t)}},{key:"removeListener",value:function(e,t){return Zs(this,Ew).removeListener(e,t)}},{key:"removeAllListeners",value:function(e){return Zs(this,Ew).removeAllListeners(e)}},{key:"listeners",value:function(e){return Zs(this,Ew).listeners(e)}},{key:"listenerCount",value:function(e){return Zs(this,Ew).listenerCount(e)}},{key:"getMaxListeners",value:function(){return Zs(this,Ew).getMaxListeners()}},{key:"setMaxListeners",value:function(e){return Zs(this,Ew).setMaxListeners(e)}},{key:"eventNames",value:function(){return Zs(this,Ew).eventNames()}},{key:"add",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.set(e.id,e,t)}},{key:"set",value:function(e,t){var r=this,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=l((0,u.Z)(n.prototype),"set",this).call(this,e,t),o=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];r.emit.apply(r,[e,t].concat(i))};return Zs(this,Tw).set(e,o),t.on("*",o),i&&Zs(this,Ew).emit(this.onAddEvent,t),a}},{key:"delete",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.get(e);if(!i)return!1;i.removeListener("*",Zs(this,Tw).get(e));var a=l((0,u.Z)(n.prototype),"delete",this).call(this,e);return r&&i.removeAllListeners(),t&&Zs(this,Ew).emit(this.onDeleteEvent,i),a}},{key:"clear",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.forEach((function(t){t.removeListener("*",Zs(e,Tw).get(t.id)),r&&t.removeAllListeners()}));var i=l((0,u.Z)(n.prototype),"clear",this).call(this);return t&&Zs(this,Ew).emit(this.onClearEvent),i}},{key:"toArray",value:function(){return Array.from(this.values())}}]),n}((0,a.Z)(Map));Ew=new WeakMap,Tw=new WeakMap;var Aw,Iw,Ow,Lw,Dw=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){(0,g.Z)(this,n);var r=null!=e?e:{},i=r.onAddEvent,a=void 0===i?"participantJoined":i,o=r.onDeleteEvent,s=void 0===o?"participantLeft":o,c=r.onClearEvent,u=void 0===c?"participantsCleared":c;return t.call(this,{onAddEvent:a,onDeleteEvent:s,onClearEvent:u})}return(0,y.Z)(n,[{key:"add",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l((0,u.Z)(n.prototype),"add",this).call(this,e,t)}},{key:"clear",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l((0,u.Z)(n.prototype),"clear",this).call(this,e,t)}},{key:"delete",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return l((0,u.Z)(n.prototype),"delete",this).call(this,e,t,r)}}]),n}(Mw),Nw=function(e){function t(){(0,g.Z)(this,t),Cs(this,"_orderedArray"),Cs(this,"_map"),this._map=new Map,this._orderedArray=[]}return(0,y.Z)(t,[{key:"add",value:function(e,t){if(!this._map.has(e))return this._map.set(e,{peerId:e,priority:t}),this._orderedArray.splice(Math.max(t-1,0),0,e),this.index(e);var n=this.index(e);this.delete(e);var r=this.add(e,t);return n!==r?(Dv.info("DyteSelectedPeer::add()::new_position_for_active_speaker",{selectedPeer:{oldIndex:n,newIndex:r}}),r):-1}},{key:"delete",value:function(e){if(this._map.has(e)){var t=this.index(e);this._map.delete(e),this._orderedArray.splice(t,1)}}},{key:"index",value:function(e){return this._map.has(e)?this._orderedArray.indexOf(e):-1}},{key:e,value:function(){return this._orderedArray[Symbol.iterator]()}}]),t}(Symbol.iterator),jw=function(){function e(){(0,g.Z)(this,e),Cs(this,"_activeSpeakerPeers"),Cs(this,"_compulsoryPeers"),this._activeSpeakerPeers=new Nw,this._compulsoryPeers=new Set}return(0,y.Z)(e,[{key:"add",value:function(e,t){return t<0?(this._compulsoryPeers.add(e),0):this.compulsoryPeers.includes(e)&&(t>0||246267631===t)&&(Dv.info("DyteSelectedPeer::removing_compulsory_peer",{selectedPeer:{peerId:e}}),this._removeFromCompulsoryPeer(e),246267631===t)?-1:this._activeSpeakerPeers.add(e,t)}},{key:"delete",value:function(e){Dv.info("DyteSelectedPeer::deleting_peer_from_selectedPeer",{selectedPeer:{peerId:e}}),this._removeFromCompulsoryPeer(e),this._activeSpeakerPeers.delete(e)}},{key:"index",value:function(e){return this._activeSpeakerPeers.index(e)}},{key:"peers",get:function(){return(0,o.Z)(new Set(this.compulsoryPeers.concat(this.activeSpeakerPeers)))}},{key:"compulsoryPeers",get:function(){return(0,o.Z)(this._compulsoryPeers.values())}},{key:"peerPriorities",get:function(){return(0,o.Z)(this._activeSpeakerPeers).map((function(e,t){return t}))}},{key:"activeSpeakerPeers",get:function(){return(0,o.Z)(this._activeSpeakerPeers)}},{key:"_removeFromCompulsoryPeer",value:function(e){this._compulsoryPeers.delete(e)}}]),e}(),Bw=Object.defineProperty,Uw=Object.getOwnPropertyDescriptor,Vw=function(e,t,n,r){for(var i,a=r>1?void 0:r?Uw(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Bw(t,n,a),a},Fw=(Lw=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),Aw),Cs((0,f.Z)(r),"waitlisted"),Cs((0,f.Z)(r),"joined"),Cs((0,f.Z)(r),"active"),Cs((0,f.Z)(r),"pinned"),Ms((0,f.Z)(r),Ow,void 0),Cs((0,f.Z)(r),"viewMode"),Cs((0,f.Z)(r),"currentPage"),Cs((0,f.Z)(r),"lastActiveSpeaker"),Cs((0,f.Z)(r),"selectedPeers"),As((0,f.Z)(r),Ow,e),r.w
2aitlisted=new Dw,r.joined=new Dw,r.active=new Dw,r.pinned=new Dw,r.selectedPeers=new jw,r.viewMode="ACTIVE_GRID",r.currentPage=0,r}return(0,y.Z)(n,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,Aw,Iw))?void 0:e.roomJoined)}},{key:"count",get:function(){return this.joined.size}},{key:"maxActiveParticipantsCount",get:function(){var e,t,n;if(Zs(this,Aw,Iw)instanceof gk)return Zs(this,Aw,Iw).maxPreferredStreams;var r=Zs(this,Ow).suggestedTheme;return null!=(n=null==(t=null==(e=null==r?void 0:r.grid)?void 0:e.multi)?void 0:t.maxVideoCount)?n:6}},{key:"pageCount",get:function(){return"PAGINATED"===this.viewMode?Math.ceil(this.joined.size/this.maxActiveParticipantsCount):0}},{key:"acceptWaitingRoomRequest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t accept waiting room request without joining room");case 2:return e.abrupt("return",Zs(this,Aw,Iw).acceptWaitingRequest(t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"rejectWaitingRoomRequest",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t reject waiting room request without joining room");case 2:return e.next=4,Zs(this,Aw,Iw).rejectWaitingRequest(t);case 4:this.waitlisted.delete(t);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setViewMode",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Dv.info("DyteParticipants::set_view_mode",{pageNavigation:{viewM
2ode:t,currentPage:this.currentPage,pageCount:this.pageCount,maxActiveParticipantsCount:this.maxActiveParticipantsCount}}),["ACTIVE_GRID","PAGINATED"].includes(t)){e.next=2;break}throw Dv.error("DyteParticipants::setViewMode::invalid_view_mode",{pageNavigation:{viewMode:t,currentPage:this.currentPage,pageCount:this.pageCount,maxActiveParticipantsCount:this.maxActiveParticipantsCount}}),new Bv("Invalid view mode: ".concat(t,". Try ACTIVE_GRID or PAGINATED."));case 2:if(this.viewMode!==t){e.next=5;break}return Dv.info("DyteParticipants::setViewMode::view_mode_same_as_previous",{pageNavigation:{viewMode:t,currentPage:this.currentPage,pageCount:this.pageCount,maxActiveParticipantsCount:this.maxActiveParticipantsCount}}),e.abrupt("return");case 5:if(this.viewMode=t,"PAGINATED"!==t){e.next=20;break}if(this.currentPage=1,r=[],!(Zs(this,Aw,Iw)instanceof gk)){e.next=16;break}return e.next=11,Zs(this,Aw,Iw).getPage(this.currentPage);case 11:n=e.sent.payload,r=n.peerIds,e.next=17;break;case 16:r=this.getPeerIdsForCurrentPage();case 17:sm.emit(cm.GET_PAGE,{peerIds:r}),e.next=21;break;case 20:"ACTIVE_GRID"===t&&(this.currentPage=0,Zs(this,Aw,Iw)instanceof gk?Zs(this,Aw,Iw).getPage(this.currentPage):sm.emit(cm.REFRESH_GRID));case 21:this.emit("viewModeChanged",{viewMode:t,currentPage:this.currentPage,pageCount:this.pageCount});case 22:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPeerIdsForCurrentPage",value:function(){Dv.info("DyteParticipants::getPeerIdsForCurrentPage()",{pageNavigation:{viewM
2ode:this.viewMode,currentPage:this.currentPage,pageCount:this.pageCount,maxActiveParticipantsCount:this.maxActiveParticipantsCount}});var e=this.selectedPeers.compulsoryPeers,t=(0,o.Z)(this.joined.keys()),n=Math.max((this.currentPage-1)*(this.maxActiveParticipantsCount-e.length)),r=this.currentPage*(this.maxActiveParticipantsCount-e.length);return e.concat(t.slice(n,r))}},{key:"setPage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Dv.info("DyteParticipants::set_page",{pageNavigation:{settingPage:t,viewMode:this.viewMode,currentPage:this.currentPage,pageCount:this.pageCount,maxActiveParticipantsCount:this.maxActiveParticipantsCount}}),"PAGINATED"===this.viewMode){e.next=2;break}return e.abrupt("return");case 2:if(Number.isInteger(t)){e.next=4;break}throw Dv.error("DyteParticipants::invalid_page_number",{pageNavigation:{settingPage:t,viewMode:this.viewMode,currentPage:this.currentPage,pageCount:this.pageCount,maxActiveParticipantsCount:this.maxActiveParticipantsCount}}),new Bv("Invalid page: ".concat(t,". Page must be an integer."));case 4:if(!(t<1||t>this.pageCount)){e.next=6;break}throw Dv.error("DyteParticipants::invalid_page_number",{pageNavigation:{settingPage:t,viewMode:this.viewMode,currentPage:this.currentPage,pageCount:this.pageCount,maxActiveParticipantsCount:this.maxActiveParticipantsCount}}),new Bv("Invalid page: ".concat(t,". Page must be greater than 0 and less than or equal to ").concat(this.pageCount,"."));case 6:if(this.currentPage=t,r=[],!(Zs(this,Aw,Iw)instanceof gk)){e.next=16;break}return e.next=11,Zs(this,Aw,Iw).getPage(t);case 11:n=e.sent.payload,r=n.peerIds,e.next=17;break;case 16:r=this.getPeerIdsForCurrentPage();case 17:sm.emit(cm.GET_PAGE,{peerIds:r}),this.emit("pageChanged",{viewMode:this.viewMode,currentPage:this.currentPage,pageCount:this.pageCount});case 19:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableAllAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Dv.info("DyteParticipants::disable_all_audio",{actions:{disableAllAudio:{allowUnmute:t}}}),this.roomJoined){e.next=2;break}throw new Bv("Can`t disable all audio without joining room");case 2:if(!Zs(this,Ow).permissions.canAllowParticipantAudio){e.next=4;break}return e.abrupt("return",Zs(this,Aw,Iw).muteAll(t));case 4:throw Dv.error("DyteParticipants::unauthorized_disable_all_audio",{actions:{disableAllAudio:{allowUnmute:t}}}),new Bv("Unauthorized: User does not have permission to disable peer audio.");case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableAllVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Dv.info("DyteParticipants::disable_all_video"),this.roomJoined){e.next=2;break}throw new Bv("Can`t disable all video without joining room");case 2:if(!Zs(this,Ow).permissions.canAllowParticipantVideo){e.next=4;break}return e.abrupt("return",Zs(this,Aw,Iw).muteAllVideo());case 4:throw Dv.error("DyteParticipants::unauthorized_disable_all_video"),new Bv("Unauthorized: User does not have permission to disable peer video.");case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disableAudio",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.joined.get(t).disableAudio();case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableVideo",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.joined.get(t).disableVideo();case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"kick",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.joined.get(t).kick();case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"kickAll",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Dv.info("DyteParticipants::kick_all"),this.roomJoined){e.next=2;break}throw new Bv("Can`t kick all without joining room");case 2:if(!Zs(this,Ow).permissions.kickParticipant){e.next=4;break}return e.abrupt("return",Zs(this,Aw,Iw).kickAll());case 4:throw Dv.error("DyteParticipants::unauthorized_kick_all"),new Bv("Unauthorized: User does not have permission to kick peers.");case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"broadcastMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Dv.info("DyteParticipants::broadcastMessage"),this.roomJoined){e.next=2;break}throw new Bv("Can`t broadcast message without joining room");case 2:if(null!=t&&t.trim()){e.next=4;break}throw new Bv("`type` must be a non-empty string.");case 4:Zs(this,Aw,Iw).broadcastMessage(t,n);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"acceptAllRequestToJoinStageRequests",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.roomJoined){e.next=2;break}throw new Bv("Can`t acceptAllRequestToJoinStageRequests without joining room");case 2:Zs(this,Aw,Iw).acceptAllRequestToJoinStage(t);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(ek),Aw=new WeakSet,Iw=function(){return Sk()},Ow=new WeakMap,Lw);
2Vw([Lv.trace("DyteParticipants.setViewMode")],Fw.prototype,"setViewMode",1),Vw([Lv.trace("DyteParticipants.setPage")],Fw.prototype,"setPage",1),Vw([Lv.trace("DyteParticipants.disableAllAudio")],Fw.prototype,"disableAllAudio",1),Vw([Lv.trace("DyteParticipants.disableAllVideo")],Fw.prototype,"disableAllVideo",1),Vw([Lv.trace("DyteParticipants.disablePeerAudio")],Fw.prototype,"disableAudio",1),Vw([Lv.trace("DyteParticipants.disablePeerVideo")],Fw.prototype,"disableVideo",1),Vw([Lv.trace("DyteParticipants.kickPeer")],Fw.prototype,"kick",1),Vw([Lv.trace("DyteParticipants.kickAll")],Fw.prototype,"kickAll",1),Vw([Lv.trace("DyteParticipants.broadcastMessage")],Fw.prototype,"broadcastMessage",1),Vw([Lv.trace("DyteParticipants.acceptAllRequestToJoinStageRequests")],Fw.prototype,"acceptAllRequestToJoinStageRequests",1),Fw=Vw([zv((function(e){throw new Bv(e.message,"1200")}))],Fw);var zw,Hw,qw,Gw,Ww,Jw=Object.defineProperty,$w=Object.getOwnPropertyDescriptor,Kw=function(e,t,n,r){for(var i,a=r>1?void 0:r?$w(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Jw(t,n,a),a},Qw=function(){function e(t){(0,g.Z)(this,e),Ms(this,Gw),Cs(this,"participants"),Ms(this,zw,void 0),Ms(this,Hw,void 0),Ms(this,qw,new Set),this.participants=new Fw(t),As(this,Hw,new Map),As(this,zw,t),this.setupEvents()}return(0,y.Z)(e,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,Gw,Ww))?void 0:e.roomJoined)}},{key:"updatePageParticipants",value:function(e){var t=this,n=new Set(e),r=new Map(this.participants.active);if(this.participants.active.forEach((function(e,r){t.participants.active.delete(r,!n.has(r))})),n.forEach((function(e){t.participants.joined.get(e)?t.participants.active.add(t.participants.joined.get(e),!r.get(e)):Dv.warn("updatePageParticipants::participant_not_in_joined_list",{dyteParticipant:{id:e}})})),Zs(this,Gw,Ww)instanceof zb){Array.from(r.keys()).forEach((function(e){if(!n.has(e)){var r=t.participants.joined.get(e);if(r){var i={producers:r.producers,peerId:r.id};Zs(t,Gw,Ww).deactivatePeers(i)}}}));var i=[];this.participants.active.forEach((function(e){var t={peerId:e.id,producers:e.producers};i.push(t)})),Zs(this,Gw,Ww).activatePeers(i)}}},{key:"updatePinnedParticipants",value:function(){var e=this;this.participants.pinned.forEach((function(t){t.setIsPinned(!1),e.participants.pinned.delete(t.id)}))}},{key:"refreshGridParticipants",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=(0,o.Z)(this.participants.joined.keys()),r=this.participants.selectedPeers.peers;if("ACTIVE_GRID"===this.participants.viewMode){var i=this.participants.maxActiveParticipantsCount-1,a=new Set(r.filter((function(t){return t!==Zs(e,zw).id}))),s=(0,o.Z)(a),c=i-a.size;if(c>=0){var u=n.filter((function(t){return!a.has(t)&&t!==Zs(e,zw).id})).slice(0,c);s=(0,o.Z)(a).concat(u)}else s=s.slice(0,i);this.updateActiveParticipantsHiveNode(s,t)}else Dv.warn("ParticipantController::refreshGridParticipants::not_refreshing_grid_in_not_active_grid_mode")}},{key:"updateActiveParticipantsHiveNode",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.roomJoined){var r=Array.from(this.participants.active.keys()),i=new Map(this.participants.active),a={};e.forEach((function(e){a[e]=!0}));var o=[];r.forEach((function(e,n){(!a[e]||!t.participants.joined.get(e))&&o.push(n)})),e.forEach((function(t){i.get(t)||(r.length<e.length?r.push(t):r[o.shift()]=t)})),r.forEach((function(e,t){a[e]||r.splice(t,1)})),Array.from(this.participants.active.keys()).forEach((function(e){t.participants.active.delete(e,!a[e])})),r.forEach((function(e){t.participants.joined.get(e)?t.participants.active.add(t.participants.joined.get(e),!i.get(e)):Dv.warn("updateActiveParticipants::participant_not_in_joined_list",{dyteParticipant:{id:e}})})),this.updateWebinarStatusForJoinedParticipants(e),this.participants.active.emit("participantsUpdate"),Dv.info("ParticipantController::updateActiveParticipants::updating_current_selected_peers",{debuggingHint:n?"Forcefully updating currentActiveGridParticipants set":null}),n&&As(this,qw,new Set);var s=new Set(e),c=[],u=[];
2if(Zs(this,qw).forEach((function(e){s.has(e)||c.push(e)})),s.forEach((function(e){Zs(t,qw).has(e)||u.push(e)})),As(this,qw,s),0!==u.length||0!==c.length){if(Zs(this,Gw,Ww)instanceof zb){var l=[];c.forEach((function(e){var n=t.participants.joined.get(e);if(n){var r={producers:n.producers,peerId:n.id};l.push(Zs(t,Gw,Ww).deactivatePeers(r))}})),Promise.all(l).then((function(){var e=[];u.forEach((function(n){var r=t.participants.active.get(n);if(r){var i={peerId:r.id,producers:r.producers};e.push(i)}else Dv.warn("peer is not in active map which is going to activate, should not happen",{dyteParticipant:{id:n}})})),Zs(t,Gw,Ww).activatePeers(e)})).catch((function(e){Dv.info("Error on deactivating peers",e)}))}}else Dv.info("ParticipantController::updateActiveParticipants::current_selected_peers_is_same")}else Dv.warn("Skipped::ParticipantController::updateActiveParticipants",{roomJoined:this.roomJoined})}},{key:"updateActiveParticipants",value:function(e){var t=this;if(this.roomJoined){var n=Array.from(this.participants.active.keys()),r=new Map(this.participants.active),i={};e.forEach((function(e){i[e]=!0}));var a=[];n.forEach((function(e,n){(!i[e]||!t.participants.joined.get(e))&&a.push(n)})),e.forEach((function(t){r.get(t)||(n.length<e.length?n.push(t):n[a.shift()]=t)})),n.forEach((function(e,t){i[e]||n.splice(t,1)})),Array.from(this.participants.active.keys()).forEach((function(e){t.participants.active.delete(e,!i[e])})),n.forEach((function(e){t.participants.joined.get(e)?t.participants.active.add(t.participants.joined.get(e),!r.get(e)):Dv.warn("updateActiveParticipants::participant_not_in_joined_list",{dyteParticipant:{id:e}})})),this.updateWebinarStatusForJoinedParticipants(e),this.participants.active.emit("participantsUpdate")}else Dv.warn("Skipped::ParticipantController::updateActiveParticipants",{roomJoined:this.roomJoined})}},{key:"updateActiveParticipantsWithPriorities",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.roomJoined?(e.forEach((function(e){t.participants.joined.get(e.peerId)&&t.participants.selectedPeers.add(e.peerId,e.priority)})),n&&this.refreshGridParticipants()):Dv.warn("Skipped::ParticipantController::updateActiveParticipantsWithPriorities",{roomJoined:this.roomJoined})}},{key:"setupEvents",value:function(){var e=this;sm.on(cm.PEER_JOINED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i,a,o;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=new Zw(n,Zs(e,zw)),t.t0=Zs(e,zw).id!==o.id&&!(null!=(r=n.flags)&&r.recorder)&&!(null!=(i=o.flags)&&i.hidden_participant)&&!(null!=(a=o.flags)&&a.hiddenParticipant),!t.t0){t.next=13;break}if(e.participants.joined.add(o),e.participants.waitlisted.delete(o.id),t.t1=e.participants.currentPage===e.participants.pageCount&&Zs(e,Gw,Ww)instanceof gk,!t.t1){t.next=13;break}return t.t2=sm,t.t3=cm.GET_PAGE,t.next=11,Zs(e,Gw,Ww).getPage(e.participants.currentPage);case 11:t.t4=t.sent.payload,t.t2.emit.call(t.t2,t.t3,t.t4);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.WAITLIST_PEER_ADDED,(function(t){var n=t.id,r=t.name;e.participants.waitlisted.add(new Zw({id:n,displayName:r,audioMuted:!0,videoEnabled:!1,audioTrack:void 0,videoTrack:void 0,userId:void 0,flags:{},isHost:!1},Zs(e,zw)))})),sm.on(cm.WAITLIST_PEER_REMOVED,(function(t){var n=t.id;e.participants.waitlisted.delete(n)})),sm.on(cm.ROOM_JOINED,(function(t){Zs(e,Gw,Ww)instanceof zb&&e.participants.joined.clear(),t.peers.forEach((function(n){var r,i,a;if(!(null!=(r=n.flags)&&r.recorder||null!=(i=n.flags)&&i.hidden_participant||null!=(a=n.flags)&&a.hiddenParticipant)){var o=new Zw(n,Zs(e,zw));o.id===t.pinnedPeerId&&(o.setIsPinned(!0,!1),e.participants.pinned.add(o)),e.participants.joined.add(o)}})),t.requestToJoinPeersList&&t.requestToJoinPeersList.forEach((function(t){var n,r=t.id;null==(n=e.participants.joined.get(r))||n.setWebinarStageStatus(ow.REQUESTED_TO_JOIN_STAGE)})),Zs(e,Gw,Ww)instanceof gk&&Zs(e,Gw,Ww).getPage(e.participants.currentPage)})),sm.on(cm.PEER_CLOSED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i,a,o,s,c,u;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.id,e.participants.joined.delete(r,!0,!0),e.participants.pinned.delete(r,!0,!0),!(Zs(e,Gw,Ww)instanceof zb&&(e.participants.selectedPeers.delete(r),e.participants.active.get(r)&&0===e.participants.currentPage))){t.next=4;break}return e.refreshGridParticipants(),t.abrupt("return");case 4:if(i=e.participants.currentPage,a=Zs(e,zw).config.maxVideoStreams,o=(ff.isMobile()?a.mobile:a.desktop)*(i-1),s=e.participants.active.get(r),0!==o){t.next=9;break}
2e.participants.setViewMode("ACTIVE_GRID"),t.next=25;break;case 9:if(!(e.participants.joined.size<=o)){t.next=13;break}2===i?e.participants.setViewMode("ACTIVE_GRID"):e.participants.setPage(i-1),t.next=25;break;case 13:if(!s){t.next=25;break}if(u=[],!(Zs(e,Gw,Ww)instanceof gk)){t.next=23;break}return t.next=18,Zs(e,Gw,Ww).getPage(i);case 18:c=t.sent.payload,u=c.peerIds,t.next=24;break;case 23:u=e.participants.getPeerIdsForCurrentPage();case 24:sm.emit(cm.GET_PAGE,{peerIds:u});case 25:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.ROOM_NODE_DISCONNECTED,(function(){Array.from(e.participants.joined.keys()).forEach((function(t){e.participants.joined.delete(t)})),Array.from(e.participants.active.keys()).forEach((function(t){e.participants.active.delete(t)})),Array.from(e.participants.pinned.keys()).forEach((function(t){e.participants.pinned.delete(t)})),e.participants.currentPage=0,e.participants.viewMode="ACTIVE_GRID",e.participants.emit("viewModeChanged",{viewMode:"ACTIVE_GRID",currentPage:e.participants.currentPage,pageCount:e.participants.pageCount}),As(e,qw,new Set)})),sm.on(cm.PEER_MUTED,(function(t){var n=t.peerId,r=e.participants.joined.get(n);r&&r.setAudioEnabled(!1)})),sm.on(cm.PEER_UNMUTED,(function(t){var n=t.peerId,r=e.participants.joined.get(n);r&&r.setAudioEnabled(!0)})),sm.on(cm.CONSUMER_PAUSED,(function(t){var n=t.id;e.processConsumerPaused(n)})),sm.on(cm.CONSUMER_RESUMED,(function(t){var n=t.id;e.processConsumerResumed(n)})),sm.on(cm.NEW_CONSUMER,(function(t){var n=t.id;e.processNewConsumer(n)})),sm.on(cm.CONSUMER_CLOSED,(function(t){var n=t.id;e.processConsumerClosed(n)})),sm.on(cm.GET_PAGE,(function(t){var n=t.peerIds;"PAGINATED"===e.participants.viewMode&&e.updatePageParticipants(n)})),sm.on(cm.SELECTED_PEERS,(function(t){var n=t.peerIds,r=t.compulsoryPeers;if("ACTIVE_GRID"===e.participants.viewMode)if(Zs(e,Gw,Ww)instanceof gk)e.updateActiveParticipants(n);else{var i=n.map((function(e,t){return{peerId:e,priority:t+1}})),a=null==r?void 0:r.map((function(e,t){return{peerId:e,priority:-(t+1)}}));i.push.apply(i,(0,o.Z)(null!=a?a:[])),i.length>0&&e.updateActiveParticipantsWithPriorities(i)}})),sm.on(cm.SELECTED_PEERS_DIFF,(function(t){var n=t.entries;"ACTIVE_GRID"===e.participants.viewMode&&e.updateActiveParticipantsWithPriorities(n,!0)})),sm.on(cm.REFRESH_GRID,(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];"ACTIVE_GRID"===e.participants.viewMode&&e.refreshGridParticipants(t)})),sm.on(cm.NEW_PRODUCER,(function(t){var n=t.peerId,r=t.producer,i=e.participants.joined.get(n);i?(i.producers.push(r),Dv.info("ParticipantController::NEW_PRODUCER::producer_added_to_participant",{producer:{id:null==r?void 0:r.producerId,peerId:n,kind:null==r?void 0:r.kind,status:"UNKNOWN",appData:{screenShare:null==r?void 0:r.screenShare}}}),"audio"===(null==r?void 0:r.kind)||null!=r&&r.screenShare||Zs(e,qw).has(n)?Zs(e,Gw,Ww).createConsumer({producingPeerId:n,producerId:r.producerId,screenShare:r.screenShare}):Dv.info("ParticipantController::NEW_PRODUCER::not_consuming_producer",{producer:{id:null==r?void 0:r.producerId,peerId:n,kind:null==r?void 0:r.kind,status:"UNKNOWN",appData:{screenShare:null==r?void 0:r.screenShare}}})):Dv.warn("ParticipantController::NEW_PRODUCER::participant not found",{producer:{id:null==r?void 0:r.producerId,kind:null==r?void 0:r.kind,status:"UNKNOWN",appData:{screenShare:null==r?void 0:r.screenShare}},dyteParticipant:{id:n}})})),sm.on(cm.PRODUCER_CLOSED,(function(t){var n=t.peerId,r=t.producerId,i=e.participants.joined.get(n);i?i.producers=i.producers.filter((function(e){return e.producerId!==r})):Dv.warn("ParticipantController::NEW_PRODUCER::participant not found",{dyteParticipant:{id:n}})})),sm.on(cm.PRODUCER_TOGGLE,(function(t){var n=t.peerId,r=t.producerId,i=t.paused,a=t.kind,o=e.participants.joined.get(n);if(o&&"audio"===a){o.setAudioEnabled(!i);var s=o.producers.find((function(e){return e.producerId===r}));s&&(s.pause=i)}})),sm.on(cm.ACTIVE_SPEAKER,(function(t){var n=t.peerId,r=t.volume;e.participants.lastActiveSpeaker=n,e.participants.emit("activeSpeaker",{peerId:n,volume:r})})),sm.on(cm.ROOM_MESSAGE,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i,a;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.payload,i=n.type,a=n.timestamp,e.participants.emit("broadcastedMessage",{type:i,payload:r,timestamp:a});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.LOW_CONSUMER_SCORE,(function(t){var n=t.peerId,r=t.score,i=t.kind,a=e.participants.joined.get(n);a&&(a.emit("poorConnection",{score:r,kind:i}),e.participants.emit("poorConnection",{participantId:n,score:r,kind:i}))})),sm.on(cm.CONSUMER_SCORE_UPDATE,(function(t){var n,r=t.score,i=t.kind,a=t.appData,o=t.peerId,s="video"===i&&null!=(n=null==a?void 0:a.screenShare)&&n,c=e.participants.joined.get(o);
2c&&(c.emit("mediaScoreUpdate",{kind:i,isScreenshare:s,score:r,participantId:o}),e.participants.emit("mediaScoreUpdate",{kind:i,isScreenshare:s,score:r,participantId:o}))})),sm.on(cm.PEER_PINNED,(function(t){var n=t.peerId;if(!n)return Zs(e,zw).isPinned&&Zs(e,zw).setIsPinned(!1),void(0!==e.participants.pinned.size&&e.updatePinnedParticipants());if(n===Zs(e,zw).id)return 0!==e.participants.pinned.size&&e.updatePinnedParticipants(),void Zs(e,zw).setIsPinned(!0);var r=e.participants.joined.get(n);Zs(e,zw).isPinned&&Zs(e,zw).setIsPinned(!1),e.updatePinnedParticipants(),r.setIsPinned(!0),e.participants.pinned.add(r),Zs(e,Gw,Ww)instanceof zb&&Zs(e,Gw,Ww).activatePeers([{peerId:r.id,producers:r.producers}]).catch((function(e){Dv.error("unable to create consumers",{error:e})}))})),sm.on(cm.PEER_REQUESTED_TO_JOIN_STAGE,(function(t){var n=t.id,r=e.participants.joined.get(n);null==r||r.setWebinarStageStatus(ow.REQUESTED_TO_JOIN_STAGE)})),sm.on(cm.PEER_WITHDRAWN_REQUEST_TO_JOIN_STAGE,(function(t){var n=t.id,r=e.participants.joined.get(n);null==r||r.setWebinarStageStatus(ow.OFF_STAGE)})),sm.on(cm.PEER_REJECTED_TO_JOIN_STAGE,(function(t){var n=t.id,r=e.participants.joined.get(n);null==r||r.setWebinarStageStatus(ow.OFF_STAGE)})),sm.on(cm.PEER_ADDED_TO_STAGE,(function(t){var n=t.id,r=e.participants.joined.get(n);null==r||r.setWebinarStageStatus(ow.ACCEPTED_TO_JOIN_STAGE)})),sm.on(cm.PEER_REMOVED_FROM_STAGE,(function(t){var n=t.id,r=e.participants.joined.get(n);null==r||r.setWebinarStageStatus(ow.OFF_STAGE)})),sm.on(cm.PEER_STARTED_PRESENTING,(function(t){var n=t.id,r=e.participants.joined.get(n);null==r||r.setWebinarStageStatus(ow.ON_STAGE)})),sm.on(cm.PEER_STOPPED_PRESENTING,(function(t){var n=t.id,r=e.participants.joined.get(n);null==r||r.setWebinarStageStatus(ow.OFF_STAGE)}))}},{key:"processMedia",value:function(e){var t,n=null!=(t=Zs(this,Gw,Ww).getConsumers().get(e))?t:{},r=n.peerId,i=n.kind,a=n.appData,o=n.remotelyPaused,s=n.track;if(!r)return Dv.warn("processMedia::Peer ID is undefined",{consumer:{id:e,kind:i,peerId:r,appData:{supportsRemoteControl:null==a?void 0:a.supportsRemoteControl,screenShare:null==a?void 0:a.screenShare},remotelyPaused:o}}),{};var c=a;return Dv.info("ParticipantController::processMedia",{consumer:{id:e,peerId:r,kind:i,appData:c,remotelyPaused:o}}),Zs(this,Hw).set(e,{type:i,peerId:r,appData:c,remotelyPaused:o}),{peerId:r,kind:i,appData:c,remotelyPaused:o,track:s}}},{key:"processConsumerClosed",value:function(e){var t=Zs(this,Hw).get(e)||{},n=t.peerId,r=t.type,i=t.appData,a=t.remotelyPaused,o=this.participants.joined.get(n);if(Dv.info("ParticipantController::processConsumerClosed",{consumer:{id:e,peerId:n,appData:i,kind:r,remotelyPaused:a}}),Zs(this,Hw).delete(e),o){if(i&&i.screenShare)return o.setScreenShareEnabled(!1),Ic.consumerSharedMediaState(e,{screen:!1}),void(o.screenShareTracks={audio:void 0,video:void 0});"audio"===r?(o.setAudioEnabled(!1),Ic.consumerSharedMediaState(e,{audio:!1}),o.audioTrack=void 0):"video"===r&&(o.setVideoEnabled(!1),Ic.consumerSharedMediaState(e,{video:!1}),o.videoTrack=void 0)}}},{key:"processConsumerResumed",value:function(e){var t=this.processMedia(e),n=t.peerId,r=t.kind,i=t.appData,a=t.track,o=t.remotelyPaused;if(n){Dv.info("ParticipantController::processConsumerResumed",{consumer:{id:e,peerId:n,kind:r,appData:i,remotelyPaused:o}});var s=this.participants.joined.get(n);if(s){if(i.screenShare)return"video"===r?s.screenShareTracks.video=a:"audio"===r&&(s.screenShareTracks.audio=a),s.setScreenShareEnabled(!0),void Ic.consumerSharedMediaState(e,{screen:!0});"video"===r?(s.videoTrack=a,s.setVideoEnabled(!0),Ic.consumerSharedMediaState(e,{video:!0})):"audio"===r&&(s.audioTrack=a,s.setAudioEnabled(s.audioEnabled),Ic.consumerSharedMediaState(e,{audio:s.audioEnabled}))}}}},{key:"processConsumerPaused",value:function(e){Dv.info("ParticipantController::processConsumerPaused called for consumerId: ".concat(e));var t=this.processMedia(e),n=t.peerId,r=t.kind,i=t.track,a=t.appData,o=t.remotelyPaused;if(n){Dv.info("ParticipantController::processConsumerPaused",{consumer:{id:e,peerId:n,kind:r,appData:a,remotelyPaused:o}});var s=this.participants.joined.get(n);s&&("video"===r?(s.videoTrack=i,s.setVideoEnabled(!1),Ic.consumerSharedMediaState(e,{video:!1})):"audio"===r&&(s.audioTrack=i,s.setAudioEnabled(s.audioEnabled),Ic.consumerSharedMediaState(e,{audio:s.audioEnabled})))}}},{key:"processNewConsumer",value:function(e){var t=this.processMedia(e),n=t.peerId,r=t.kind,i=t.remotelyPaused,a=t.track,o=t.appData;
2if(n){Dv.info("ParticipantController::processNewConsumer",{consumer:{id:e,peerId:n,kind:r,remotelyPaused:i,appData:o}});var s=this.participants.joined.get(n);if(s){if(o.screenShare)return"video"===r?s.screenShareTracks.video=a:"audio"===r&&(s.screenShareTracks.audio=a),(!i||Zs(this,zw).permissions.isRecorder||jc.hasFeature(ov))&&s.setScreenShareEnabled(!0),void(o.supportsRemoteControl&&(s.supportsRemoteControl=!0));"video"===r?(s.videoTrack=a,i||s.setVideoEnabled(!0),Ic.consumerSharedMediaState(e,{video:!i})):"audio"===r&&Zs(this,Gw,Ww)instanceof zb&&(s.audioTrack=a,i||s.setAudioEnabled(!0),Ic.consumerSharedMediaState(e,{audio:!i}))}}}},{key:"updateWebinarStatusForJoinedParticipants",value:function(e){var t=this;e.forEach((function(e){var n=t.participants.joined.get(e);n&&(n.webinarStageStatus=ow.ON_STAGE)}))}}]),e}();zw=new WeakMap,Hw=new WeakMap,qw=new WeakMap,Gw=new WeakSet,Ww=function(){return Sk()},Kw([Lv.trace("ParticipantController.updatePageParticipants")],Qw.prototype,"updatePageParticipants",1),Kw([Lv.trace("ParticipantController.setupEvents")],Qw.prototype,"setupEvents",1),Kw([Lv.trace("ParticipantController.processMedia")],Qw.prototype,"processMedia",1),Kw([Lv.trace("ParticipantController.processConsumerClosed")],Qw.prototype,"processConsumerClosed",1),Kw([Lv.trace("ParticipantController.processConsumerResumed")],Qw.prototype,"processConsumerResumed",1),Kw([Lv.trace("ParticipantController.processConsumerPaused")],Qw.prototype,"processConsumerPaused",1),Kw([Lv.trace("ParticipantController.processNewConsumer")],Qw.prototype,"processNewConsumer",1);var Yw,Xw,ex,tx,nx,rx=Object.defineProperty,ix=Object.getOwnPropertyDescriptor,ax=(nx=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i,a){var o;return(0,g.Z)(this,n),o=t.call(this),Ms((0,f.Z)(o),Yw),Ms((0,f.Z)(o),ex,void 0),Ms((0,f.Z)(o),tx,void 0),Cs((0,f.Z)(o),"viewType"),Cs((0,f.Z)(o),"meetingStartedTimestamp"),Cs((0,f.Z)(o),"meetingTitle"),As((0,f.Z)(o),ex,e),o.viewType=r,As((0,f.Z)(o),tx,i),o.meetingTitle=a,o}return(0,y.Z)(n,[{key:"joined",get:function(){var e;return null==(e=Zs(this,Yw,Xw))?void 0:e.roomJoined}},{key:"roomName",get:function(){var e;return null==(e=Zs(this,Yw,Xw))?void 0:e.roomName}},{key:"socketConnected",get:function(){return Zs(this,tx).isConnected}}]),n}(ek),Yw=new WeakSet,Xw=function(){return Sk()},ex=new WeakMap,tx=new WeakMap,nx);ax=function(e,t,n,r){for(var i,a=r>1?void 0:r?ix(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&rx(t,n,a),a}([zv((function(e){throw new Bv(e.message,"0800")}))],ax);var ox=Object.defineProperty,sx=Object.getOwnPropertyDescriptor,cx=function(){function e(t,n,r){(0,g.Z)(this,e),Cs(this,"meta"),this.meta=new ax(t,Wv.isV2AuthToken?t.config.viewType:t.permissions.viewType,n,r),this.setupEvents()}return(0,y.Z)(e,[{key:"roomName",get:function(){return this.meta.roomName}},{key:"setupEvents",value:function(){var e=this;sm.on(cm.ROOM_JOINED,(function(t){t.startedAt&&(e.meta.meetingStartedTimestamp=new Date(t.startedAt),e.meta.emit("meetingStartTimeUpdate",{meetingStartedTimestamp:e.meta.meetingStartedTimestamp}))})),sm.on(cm.ROOM_STATE,(function(t){var n=t.createdAt,r=e.meta.meetingStartedTimestamp;if(n&&!r){var i=new Date(1e3*n);e.meta.meetingStartedTimestamp=i,e.meta.emit("meetingStartTimeUpdate",{meetingStartedTimestamp:e.meta.meetingStartedTimestamp})}})),sm.on(cm.ROOM_NODE_CONNECTED,(function(){e.meta.emit("connected")})),sm.on(cm.ROOM_NODE_DISCONNECTED,(function(){e.meta.emit("disconnected")})),sm.on(cm.ICE_CONNECTED,(function(t){var n=t.transport;e.meta.emit("iceConnected",{transport:n})})),sm.on(cm.ICE_DISCONNECTED,(function(t){var n=t.transport;e.meta.emit("iceDisconnected",{transport:n})})),sm.on(cm.ICE_RECONNECTING,(function(t){var n=t.transport;e.meta.emit("iceReconnecting",{transport:n})})),sm.on(cm.ICE_FAILED,(function(t){var n=t.transport;e.meta.emit("iceFailed",{transport:n})})),sm.on(cm.PRODUCER_SCORE_UPDATE,(function(t){var n=t.score;n<5&&e.meta.emit("poorConnection",{score:n})})),sm.on(cm.SOCKET_SERVICE_CONNECTED,(function(){e.meta.emit("socketConnected")})),sm.on(cm.SOCKET_SERVICE_DISCONNECTED,(function(){e.meta.emit("socketDisconnected")})),sm.on(cm.SOCKET_SERVICE_RECONNECTING,(function(){e.meta.emit("socketReconnecting")})),sm.on(cm.SOCKET_SERVICE_RECONNECTION_ATTEMPT,(function(t){var n=t.attempt;e.meta.emit("socketReconnectAttempt",{attempt:n})}
2)),sm.on(cm.SOCKET_SERVICE_RECONNECT_FAILURE,(function(t){var n=t.attempt;e.meta.emit("socketReconnectFailure",{attempt:n})})),sm.on(cm.SOCKET_SERVICE_RECONNECTED,(function(){e.meta.emit("socketReconnected")})),sm.on(cm.SOCKET_SERVICE_FAILED,(function(){e.meta.emit("socketFailure")})),sm.on(cm.ROOM_NODE_CONNECTION_ERROR,(function(t){t.message.match(/room '([a-z0-9-]+)' not found/i)&&e.meta.emit("connectionError",{reason:"ROOM_NOT_FOUND"})}))}}]),e}();!function(e,t,n,r){for(var i,a=r>1?void 0:r?sx(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&ox(t,n,a)}([Lv.trace("MetaController.setupEvents")],cx.prototype,"setupEvents",1);var ux,lx,dx,px,hx,fx,vx,mx,gx,yx=Object.defineProperty,bx=Object.getOwnPropertyDescriptor,kx=14,_x=15,wx=16,xx=17,Sx=18,Ex=19,Tx=20,Px=22,Cx=23,Rx=24,Zx=(gx=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i,a,o,s){var c,u=e.baseURL,l=e.createdAt,d=e.description,p=e.id,h=e.name,v=e.organizationId,m=e.picture,y=e.private,b=e.published,k=e.staggered,_=e.tags,w=e.type,x=e.updatedAt;return(0,g.Z)(this,n),c=t.call(this),Ms((0,f.Z)(c),vx),Ms((0,f.Z)(c),ux,void 0),Ms((0,f.Z)(c),lx,void 0),Cs((0,f.Z)(c),"baseURL"),Cs((0,f.Z)(c),"createdAt"),Cs((0,f.Z)(c),"description"),Cs((0,f.Z)(c),"id"),Cs((0,f.Z)(c),"name"),Ms((0,f.Z)(c),dx,void 0),Ms((0,f.Z)(c),px,void 0),Ms((0,f.Z)(c),hx,void 0),Cs((0,f.Z)(c),"organizationId"),Cs((0,f.Z)(c),"picture"),Cs((0,f.Z)(c),"private"),Cs((0,f.Z)(c),"published"),Cs((0,f.Z)(c),"staggered"),Cs((0,f.Z)(c),"tags"),Cs((0,f.Z)(c),"type"),Cs((0,f.Z)(c),"updatedAt"),Cs((0,f.Z)(c),"config"),Ms((0,f.Z)(c),fx,void 0),Cs((0,f.Z)(c),"active"),Cs((0,f.Z)(c),"iframes"),Cs((0,f.Z)(c),"enabledBy"),c.baseURL=u,c.createdAt=new Date(l),c.description=d,c.id=p,c.name=h,As((0,f.Z)(c),dx,a),c.organizationId=v,c.picture=m,c.private=y,c.published=b,c.staggered=k,c.tags=_,c.type=w,c.updatedAt=new Date(x),c.active=!1,c.iframes=new Map,As((0,f.Z)(c),ux,r),As((0,f.Z)(c),lx,i),As((0,f.Z)(c),px,o),As((0,f.Z)(c),hx,s),c.enabledBy="",c}return(0,y.Z)(n,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,vx,mx))?void 0:e.roomJoined)}},{key:"sendIframeEvent",value:function(e){var t=this;this.iframes.size&&(0,o.Z)(this.iframes.keys()).forEach((function(n){var r=t.iframes.get(n).iframe;r&&r.contentWindow.postMessage(e,"*")}))}},{key:"handleIframeMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,c,u,l,d,h,f,v,m,g,y,b,k,_,w,x,S,E,T,P,C,R,Z,M,A,I,O,L,D=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"!==Zs(this,lx)){e.next=54;break}u=(c=t).payload,l=c.uuid,d=c.type,e.t0=d,e.next=e.t0===ib.customPluginEventToRoom?5:e.t0===ib.customPluginEventToPeers?7:e.t0===ib.enablePluginForRoom?9:e.t0===ib.enablePluginForPeers?11:e.t0===ib.disablePluginForRoom?13:e.t0===ib.disablePluginForPeers?15:e.t0===ib.storeInsertKeys?17:e.t0===ib.storeGetKeys?19:e.t0===ib.storeDeleteKeys?21:e.t0===ib.storeDelete?23:e.t0===wx?25:e.t0===kx?39:e.t0===_x?42:e.t0===Ex?45:e.t0===Sx?47:e.t0===xx?49:e.t0===Tx?51:53;break;case 5:return Zs(this,ux).customPluginEventToRoom(this.id,u,l),e.abrupt("break",53);case 7:return Zs(this,ux).customPluginEventToPeers(this.id,u,u.peerIds,l),e.abrupt("break",53);case 9:return Zs(this,ux).enablePluginForRoom(this.id,l),e.abrupt("break",53);case 11:return Zs(this,ux).enablePluginForPeers(this.id,u.peerIds,l),e.abrupt("break",53);case 13:return Zs(this,ux).disablePluginForRoom(this.id,l),e.abrupt("break",53);case 15:return Zs(this,ux).disablePluginForPeers(this.id,u.peerIds,l),e.abrupt("break",53);case 17:return Zs(this,ux).storeInsertKeys(this.id,u.store,u.insertKeys,l),e.abrupt("break",53);case 19:return Zs(this,ux).storeGetKeys(this.id,u.store,u.getKeys,l),e.abrupt("break",53);case 21:return Zs(this,ux).storeDeleteKeys(this.id,u.store,u.deleteKeys,l),e.abrupt("break",53);case 23:return Zs(this,ux).storeDelete(this.id,u.store,l),e.abrupt("break",53);case 25:if(h=u.messagePayload,f=u.peerIds,Zs(this,hx)){e.next=29;break}return this.sendIframeEvent({type:wx,uuid:c.uuid,payload:{error:"Chat is disabled for this room."}}),e.abrupt("return");case 29:return e.prev=29,e.next=32,Zs(this,hx).sendMessage(h,f);case 32:this.sendIframeEvent({type:wx,uuid:c.uuid,payload:{success:!0}}),e.next=38;break;case 35:e.prev=35,e.t1=e.catch(29),this.sendIframeEvent({type:wx,uuid:c.uuid,payload:{error:e.t1}});case 38:return e.abrupt("break",53);case 39:return m=u.peerId,g=(0,s.Z)((0,s.Z)({},Zs(this,dx)),{},{isRecorder:null==(n=Zs(this,dx).permissions)?void 0:n.isRecorder}),m?(v=Zs(this,px).joined.get(u.peerId),Zs(this,dx).id===m&&(v=g)):v=g,this.sendIframeEvent({type:kx,payload:{peer:v&&Ef(v)},uuid:c.uuid}),e.abrupt("break",53);case 42:return y=Zs(this,px).joined.toArray().map((function(e){return Ef(e)})),this.sendIframeEvent({type:_x,payload:{peers:y},uuid:c.uuid}),e.abrupt("break",53);case 45:return this.sendIframeEvent({type:Ex,payload:{enabledBy:this.enabledBy},uuid:c.uuid}),e.abrupt("break",53);
2case 47:return this.sendIframeEvent({type:Sx,payload:{displayTitle:Zs(this,vx,mx).meetingTitle},uuid:c.uuid}),e.abrupt("break",53);case 49:return this.sendIframeEvent({type:xx,payload:{roomName:Zs(this,vx,mx).roomName},uuid:c.uuid}),e.abrupt("break",53);case 51:return this.emit(c.payload.eventName,c.payload.data),e.abrupt("break",53);case 53:return e.abrupt("return");case 54:b=function(e,t){return Zs(D,dx).userId===e?Zs(D,dx).id:(t.forEach((function(t){t.userId===e&&(n=t.id)})),n);var n},k=t,e.t2=k.type,e.next="pluginEvent"===e.t2||"storePluginData"===e.t2||"getPluginData"===e.t2||"enablePluginForAll"===e.t2||"enablePluginForUser"===e.t2||"disablePluginForUser"===e.t2||"chatMessage"===e.t2?58:"getJoinedPeers"===e.t2?63:"getPeerInfo"===e.t2?68:"getRoomState"===e.t2?73:"getPluginInitiatorId"===e.t2?79:"getPluginInitiatorUserId"===e.t2?85:"pluginEventToParent"===e.t2?91:"toggleViewMode"===e.t2?93:95;break;case 58:return e.next=60,Zs(this,vx,mx).sendMessage(k);case 60:return o=e.sent,this.sendIframeEvent(o),e.abrupt("break",95);case 63:return e.next=65,Zs(this,vx,mx).getRoomState();case 65:return o=e.sent,this.sendIframeEvent({type:"websocket/get-joined-peers",payload:(0,s.Z)((0,s.Z)({},k.payload),{},{peers:o.payload.roomState.peers})}),e.abrupt("break",95);case 68:return e.next=70,Zs(this,vx,mx).sendMessage({type:k.type,payload:(0,s.Z)((0,s.Z)({},k.payload),{},{peerId:null!=(i=null==(r=k.payload)?void 0:r.peerId)?i:Zs(this,dx).id})});case 70:return o=e.sent,this.sendIframeEvent(o),e.abrupt("break",95);case 73:return e.next=75,Zs(this,vx,mx).getRoomState();case 75:return o=e.sent,_=o.payload.roomState,w=_.plugins,x=_.peers,S=w.find((function(e){return e.id===D.id})),E=S.enabledBy,T=b(E,x),this.sendIframeEvent({type:"websocket/get-room-state",payload:(0,s.Z)((0,s.Z)({},k.payload),{},{roomName:o.payload.roomState.roomName,pluginInitiatorPeerId:T,pluginInitiatorUserId:E,peers:o.payload.roomState.peers,displayTitle:o.payload.roomState.displayTitle,roomUUID:o.payload.roomState.roomUUID,currentPeer:Zs(this,dx).id,isRecorder:null==(a=Zs(this,dx).permissions)?void 0:a.isRecorder})}),e.abrupt("break",95);case 79:return e.next=81,Zs(this,vx,mx).getRoomState();case 81:return o=e.sent,P=o.payload.roomState,C=P.plugins,R=P.peers,Z=C.find((function(e){return e.id===D.id})),M=Z.enabledBy,A=b(M,R),this.sendIframeEvent({type:"websocket/get-plugin-initiator-peer-id",payload:(0,s.Z)((0,s.Z)({},k.payload),{},{pluginInitiatorPeerId:A})}),e.abrupt("break",95);case 85:return e.next=87,Zs(this,vx,mx).getRoomState();case 87:return o=e.sent,I=o.payload.roomState.plugins,O=I.find((function(e){return e.id===D.id})),L=O.enabledBy,this.sendIframeEvent({type:"websocket/get-plugin-initiator-user-id",payload:(0,s.Z)((0,s.Z)({},k.payload),{},{pluginInitiatorUserId:L})}),e.abrupt("break",95);case 91:return this.emit(k.payload.eventName,k.payload.data),e.abrupt("break",95);case 93:return this.emit("toggleViewMode",k.payload.data),e.abrupt("break",95);case 95:case"end":return e.stop()}}),e,this,[[29,35]])})));return function(t){return e.apply(this,arguments)}}()},{key:"sendData",value:function(e){"socket-service"!==Zs(this,lx)?this.sendIframeEvent({type:cm.PLUGIN_INTERNAL_DATA,payload:{pluginId:this.id,data:e}}):this.sendIframeEvent({type:Rx,uuid:"",payload:e})}},{key:"removePluginView",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",n=null!=(e=this.iframes.get(t))?e:{},r=n.iframe,i=n.listener;(r||i)&&(window.removeEventListener("message",i),this.iframes.delete(t))}},{key:"addPluginView",value:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";if(!Zs(this,fx))throw Dv.error("DytePlugin::addPluginView::no_auth_token_set_for_plugin"),new Bv("No auth token set for plugin.");if(!e)throw Dv.error("DytePlugin::addPluginView::iframe_was_not_provided"),new Bv("Iframe was not provided.");this.removePluginView(r);var i=e,a=new URL(this.baseURL),o={auth:Zs(this,fx),parent:!navigator.isReactNative&&window.location.origin,backend:lv.apiBase,pluginId:this.id,roomName:null!=(t=Zs(this,vx,mx).roomName)?t:"",displayTitle:Zs(this,vx,mx).meetingTitle};
2Object.keys(o).forEach((function(e){a.searchParams.set(e,o[e])})),i.src=a.href,i.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",i.title=r;var s=function(){var t=(0,h.Z)((0,p.Z)().mark((function t(r){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=r.source===e.contentWindow,!t.t0){t.next=4;break}return t.next=4,n.handleIframeMessage(r.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();window.addEventListener("message",s),this.iframes.set(r,{iframe:i,listener:s})}},{key:"setActive",value:function(e){var t,n;this.active=e,e?this.emit("stateUpdate",{active:this.active,pluginId:this.id,bind:this.addPluginView.bind(this),views:null==(t=this.config)?void 0:t.views}):(this.active=!1,this.emit("stateUpdate",{active:this.active,pluginId:this.id,views:null==(n=this.config)?void 0:n.views}))}},{key:"activateForSelf",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Xy(),e.next=3,t.authorizePlugin(this.id);case 3:return n=e.sent,As(this,fx,n),e.prev=5,e.next=8,t.getPluginConfig(this.baseURL);case 8:r=e.sent,this.config=r,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),Dv.error("DytePlugin::activateForSelf",{error:e.t0});case 15:this.setActive(!0),this.emit("enabled");case 16:case"end":return e.stop()}}),e,this,[[5,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"deactivateForSelf",value:function(){var e=this;(0,o.Z)(this.iframes.keys()).forEach((function(t){e.removePluginView(t)})),this.iframes.clear(),this.setActive(!1),this.emit("closed")}},{key:"enable",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.activateForSelf());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disable",value:function(){return this.deactivateForSelf()}},{key:"activate",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==(n=null==(t=Zs(this,dx).permissions)?void 0:t.plugins)||!n.canStart){e.next=6;break}if("socket-service"!==Zs(this,lx)){e.next=4;break}return Zs(this,ux).addPlugin(this.id,this.staggered),e.abrupt("return");case 4:return e.next=6,Zs(this,vx,mx).addRoomPlugin(this);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"deactivate",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==(n=null==(t=Zs(this,dx).permissions)?void 0:t.plugins)||!n.canClose){e.next=6;break}if("socket-service"!==Zs(this,lx)){e.next=4;break}return Zs(this,ux).removePlugin(this.id),e.abrupt("return");case 4:return e.next=6,Zs(this,vx,mx).removeRoomPlugin(this);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(ek),ux=new WeakMap,lx=new WeakMap,dx=new WeakMap,px=new WeakMap,hx=new WeakMap,fx=new WeakMap,vx=new WeakSet,mx=function(){return Sk()},gx);Zx=function(e,t,n,r){for(var i,a=r>1?void 0:r?bx(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&yx(t,n,a),a}([zv((function(e){throw new Bv(e.message,"0600")}))],Zx);var Mx=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,{onAddEvent:"pluginAdded",onDeleteEvent:"pluginDeleted"})}return(0,y.Z)(n,[{key:"add",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l((0,u.Z)(n.prototype),"add",this).call(this,e,t)}},{key:"delete",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return l((0,u.Z)(n.prototype),"delete",this).call(this,e,t,r)}}]),n}(Mw),Ax=Object.defineProperty,Ix=Object.getOwnPropertyDescriptor,Ox=(0,y.Z)((function e(){(0,g.Z)(this,e),Cs(this,"all"),Cs(this,"active"),this.all=ne
2w Mx,this.active=new Mx}));Ox=function(e,t,n,r){for(var i,a=r>1?void 0:r?Ix(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Ax(t,n,a),a}([zv((function(e){throw new Bv(e.message,"0600")}))],Ox);var Lx,Dx=Object.defineProperty,Nx=Object.getOwnPropertyDescriptor,jx=function(e,t,n,r){for(var i,a=r>1?void 0:r?Nx(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Dx(t,n,a),a},Bx=function(e){return e[e.TEXT=0]="TEXT",e[e.IMAGE=1]="IMAGE",e[e.FILE=2]="FILE",e}(Bx||{}),Ux=function(){function e(t){(0,g.Z)(this,e),Ms(this,Lx,void 0),As(this,Lx,t)}return(0,y.Z)(e,[{key:"getChatMessages",value:function(){return Zs(this,Lx).sendMessagePromise(rb.getMessages)}},{key:"getChatMessagesPaginated",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,a,o=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={timeStamp:t,size:n,from:o.length>3&&void 0!==o[3]?o[3]:0,reversed:r},e.next=4,Zs(this,Lx).sendMessagePromise(rb.getPaginatedMessages,gg.toBinary(i));case 4:return a=e.sent,e.abrupt("return",a.payload?yg.fromBinary(a.payload):{messages:[],next:!1});case 6:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"sendMessageToRoom",value:function(e,t){var n={payloadType:t,payload:e};Zs(this,Lx).sendMessage(rb.sendMessageToRoom,kg.toBinary(n))}},{key:"sendMessageToPeers",value:function(e,t,n){var r={payloadType:t,peerIds:n,payload:e};Zs(this,Lx).sendMessage(rb.sendMessageToPeers,wg.toBinary(r))}},{key:"sendMessage",value:function(e,t,n){n&&n.length>0?this.sendMessageToPeers(e,t,n):this.sendMessageToRoom(e,t)}},{key:"editMessage",value:function(e,t,n,r){var i={chatId:e,pinned:r,payloadType:n,payload:t};Zs(this,Lx).sendMessage(rb.editMessage,Sg.toBinary(i))}},{key:"deleteMessage",value:function(e){Zs(this,Lx).sendMessage(rb.deleteMessage,Tg.toBinary({chatId:e}))}},{key:"on",value:function(e,t){var n,r;switch(e){case rb.sendMessageToRoom:n=_g.fromBinary.bind(_g),r=_g.create();break;case rb.sendMessageToPeers:n=xg.fromBinary.bind(xg),r=xg.create();break;case rb.editMessage:n=Eg.fromBinary.bind(Eg),r=Eg.create();break;case rb.deleteMessage:n=Pg.fromBinary.bind(Pg),r=Pg.create()}n?Zs(this,Lx).on(e,(function(e){var i=e.payload,a=r;try{a=n(i)}catch(o){Dv.error("chatSocketHandler::on::binary_decode_error",{error:o})}return t(a)})):Dv.warn("ChatSocketHandler::Event ".concat(e," is not recognized"))}}]),e}();Lx=new WeakMap,jx([Lv.trace("SocketService.getChatMessages")],Ux.prototype,"getChatMessages",1),jx([Lv.trace("SocketService.getChatMessagesPaginated")],Ux.prototype,"getChatMessagesPaginated",1),jx([Lv.trace("SocketService.sendMessageToRoom")],Ux.prototype,"sendMessageToRoom",1),jx([Lv.trace("SocketService.sendMessageToPeers")],Ux.prototype,"sendMessageToPeers",1),jx([Lv.trace("SocketService.sendMessage")],Ux.prototype,"sendMessage",1),jx([Lv.trace("SocketService.editMessage")],Ux.prototype,"editMessage",1),jx([Lv.trace("SocketService.deleteMessage")],Ux.prototype,"deleteMessage",1);var Vx,Fx,zx,Hx,qx,Gx,Wx,Jx=Object.defineProperty,$x=Object.getOwnPropertyDescriptor,Kx=function(e,t,n,r){for(var i,a=r>1?void 0:r?$x(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&Jx(t,n,a),a},Qx=["text","image","file","poll"],Yx=(Wx=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i,a){var o;return(0,g.Z)(this,n),o=t.call(this),Ms((0,f.Z)(o),qx),Cs((0,f.Z)(o),"messages"),Ms((0,f.Z)(o),Vx,void 0),Ms((0,f.Z)(o),Fx,void 0),Ms((0,f.Z)(o),zx,void 0),Ms((0,f.Z)(o),Hx,void 0),As((0,f.Z)(o),zx,e),As((0,f.Z)(o),Hx,r),As((0,f.Z)(o),Vx,i),As((0,f.Z)(o),Fx,a),o.messages=[],o}return(0,y.Z)(n,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,qx,Gx))?void 0:e.roomJoined)}},{key:"sendTextMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o,s,c,u;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(i=null==(r=Zs(this,Vx).permissions)?void 0:r.chatPublic)&&i.canSend&&null!=(o=null==(a=Zs(this,Vx).permissions)?void 0:a.chatPublic)&&o.text){e.next=2;break}throw Dv.error("sendTextMessage::public_chat_permission_denied"),new Bv("Could not send message to public chat.","0501");case 2:if(!(n&&n.length>
20)||null!=(s=Zs(this,Vx).permissions)&&s.chatPrivate.canSend&&null!=(c=Zs(this,Vx).permissions)&&c.chatPrivate.text){e.next=4;break}throw Dv.error("sendTextMessage::private_chat_permission_denied"),new Bv("Could not send message to private chat.","0501");case 4:if(t){e.next=6;break}throw Dv.error("sendTextMessage::message_can_not_be_empty"),new Bv("Message can not be empty.","0502");case 6:if("socket-service"!==Zs(this,Hx)){e.next=10;break}return[],n&&n.length>0&&(n.push(Zs(this,Vx).id),Zs(this,Fx).joined.toArray().filter((function(e){return n.includes(e.id)})).map((function(e){return e.userId})).push(Zs(this,Vx).userId)),Zs(this,zx).sendMessage(t,Bx.TEXT,n),e.abrupt("return");case 10:if(!(void 0!==n&&n.length>0)){e.next=13;break}return Dv.error("sendTextMessage::private_chat_unsupported"),e.abrupt("return");case 13:if(u={userId:Zs(this,Vx).userId,displayName:Zs(this,Vx).name,message:t,type:Qx.indexOf("text"),time:+new Date},this.roomJoined){e.next=16;break}throw Dv.error("DyteChat.sendTextMessage.RoomNodeClientSocketUsed_WithoutRoomJoin"),new Bv("Can`t sendTextMessage without joining room");case 16:return e.next=18,Zs(this,qx,Gx).sendChatMessage(u);case 18:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendImageMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o,s,c,u,l,d,h,f;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n&&n.length>0)){e.next=6;break}if(null!=(r=Zs(this,Vx).permissions)&&r.chatPrivate.canSend&&null!=(i=Zs(this,Vx).permissions)&&i.chatPrivate.files){e.next=4;break}return Dv.error("sendImageMessage::private_chat_permission_denied"),e.abrupt("return");case 4:e.next=9;break;case 6:if(null!=(o=null==(a=Zs(this,Vx).permissions)?void 0:a.chatPublic)&&o.canSend&&null!=(c=null==(s=Zs(this,Vx).permissions)?void 0:s.chatPublic)&&c.files){e.next=9;break}return Dv.error("sendImageMessage::permission_denied"),e.abrupt("return");case 9:if(t){e.next=12;break}return Dv.error("sendImageMessage::required_argument_image_can_not_be_empty"),e.abrupt("return");case 12:if(["image/gif","image/jpeg","image/png"].includes(t.type)){e.next=15;break}return Dv.error("sendImageMessage::image_type_not_supported",{dyteChat:{imageType:t.type}}),e.abrupt("return");case 15:return e.prev=15,u=Xy(),e.next=19,u.getPresignedUrls(t.name);case 19:return l=e.sent,d=l.getLocation,h=l.putLocation,e.next=24,u.uploadFile(t,h);case 24:if("socket-service"!==Zs(this,Hx)){e.next=28;break}return[],n&&n.length>0&&(n.push(Zs(this,Vx).id),Zs(this,Fx).joined.toArray().filter((function(e){return n.includes(e.id)}
2)).map((function(e){return e.userId})).push(Zs(this,Vx).userId)),Zs(this,zx).sendMessage(d,Bx.IMAGE,n),e.abrupt("return");case 28:if(!(void 0!==n&&n.length>0)){e.next=31;break}return Dv.error("sendImageMessage::private_chat_unsupported"),e.abrupt("return");case 31:if(f={userId:Zs(this,Vx).userId,displayName:Zs(this,Vx).name,type:Qx.indexOf("image"),link:d,time:+new Date},this.roomJoined){e.next=34;break}throw Dv.error("DyteChat.sendImageMessage.RoomNodeClientSocketUsed_WithoutRoomJoin"),new Bv("Can`t sendImageMessage without joining room");case 34:return e.next=36,Zs(this,qx,Gx).sendChatMessage(f);case 36:e.next=41;break;case 38:throw e.prev=38,e.t0=e.catch(15),new Bv("Error sending image message.");case 41:case"end":return e.stop()}}),e,this,[[15,38]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendFileMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o,s,c,u,l,d,h,f,v;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n&&n.length>0)){e.next=6;break}if(null!=(r=Zs(this,Vx).permissions)&&r.chatPrivate.canSend&&null!=(i=Zs(this,Vx).permissions)&&i.chatPrivate.files){e.next=4;break}return Dv.error("sendFileMessage::private_chat_permission_denied"),e.abrupt("return");case 4:e.next=9;break;case 6:if(null!=(o=null==(a=Zs(this,Vx).permissions)?void 0:a.chatPublic)&&o.canSend&&null!=(c=null==(s=Zs(this,Vx).permissions)?void 0:s.chatPublic)&&c.files){e.next=9;break}return Dv.error("sendFileMessage::permission_denied"),e.abrupt("return");case 9:if(t){e.next=12;break}return Dv.error("sendFileMessage::required_argument_file_can_not_be_empty"),e.abrupt("return");case 12:return e.prev=12,u=Xy(),e.next=16,u.getPresignedUrls(t.name);case 16:return l=e.sent,d=l.getLocation,h=l.putLocation,e.next=21,u.uploadFile(t,h);case 21:if("socket-service"!==Zs(this,Hx)){e.next=27;break}return[],n&&n.length>0&&(n.push(Zs(this,Vx).id),Zs(this,Fx).joined.toArray().filter((function(e){return n.includes(e.id)}
2)).map((function(e){return e.userId})).push(Zs(this,Vx).userId)),f=JSON.stringify({link:d,name:t.name,size:t.size}),Zs(this,zx).sendMessage(f,Bx.FILE,n),e.abrupt("return");case 27:if(!(void 0!==n&&n.length>0)){e.next=30;break}return Dv.error("sendFileMessage::private_chat_unsupported"),e.abrupt("return");case 30:if(v={userId:Zs(this,Vx).userId,displayName:Zs(this,Vx).name,type:Qx.indexOf("file"),link:d,name:t.name,size:t.size,time:+new Date},this.roomJoined){e.next=33;break}throw Dv.error("DyteChat.sendFileMessage.RoomNodeClientSocketUsed_WithoutRoomJoin"),new Bv("Can`t sendFileMessage without joining room");case 33:return e.next=35,Zs(this,qx,Gx).sendChatMessage(v);case 35:e.next=40;break;case 37:throw e.prev=37,e.t0=e.catch(12),new Bv("Error sending file message.");case 40:case"end":return e.stop()}}),e,this,[[12,37]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.type,e.next="text"===e.t0?3:"image"===e.t0?6:"file"===e.t0?9:12;break;case 3:return e.next=5,this.sendTextMessage(t.message,n);case 5:case 8:case 11:return e.abrupt("break",14);case 6:return e.next=8,this.sendImageMessage(t.image,n);case 9:return e.next=11,this.sendFileMessage(t.file,n);case 12:return Dv.error("sendMessage::message_type_not_supported",{dyteChat:{messageType:t.type}}),e.abrupt("break",14);case 14:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"editTextMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"===Zs(this,Hx)){e.next=3;break}return Dv.warn("editTextMessage::Coming soon!"),e.abrupt("return");case 3:if(null!=(i=null==(r=Zs(this,Vx).permissions)?void 0:r.chatPublic)&&i.canSend&&null!=(o=null==(a=Zs(this,Vx).permissions)?void 0:a.chatPublic)&&o.text){e.next=6;break}return Dv.error("editTextMessage::permission_denied"),e.abrupt("return");case 6:if(n){e.next=9;break}return Dv.error("editTextMessage::message_can_not_be_empty"),e.abrupt("return");case 9:Zs(this,zx).editMessage(t,n,Bx.TEXT);case 10:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"editImageMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"===Zs(this,Hx)){e.next=3;break}return Dv.warn("editImageMessage::Coming soon!"),e.abrupt("return");case 3:if(null!=(i=null==(r=Zs(this,Vx).permissions)?void 0:r.chatPublic)&&i.canSend&&null!=(o=null==(a=Zs(this,Vx).permissions)?void 0:a.chatPublic)&&o.files){e.next=6;break}return Dv.error("editImageMessage::permission_denied"),e.abrupt("return");case 6:if(n){e.next=9;break}return Dv.error("editImageMessage::required_argument_image_can_not_be_empty"),e.abrupt("return");case 9:if(["image/gif","image/jpeg","image/png"].includes(n.type)){e.next=12;break}return Dv.error("sendImageMessage::image_type_not_supported",{dyteChat:{imageType:n.type}}),e.abrupt("return");case 12:return e.prev=12,s=Xy(),e.next=16,s.getPresignedUrls(n.name);case 16:return c=e.sent,u=c.getLocation,l=c.putLocation,e.next=21,s.uploadFile(n,l);case 21:Zs(this,zx).editMessage(t,u,Bx.IMAGE),e.next=27;break;case 24:throw e.prev=24,e.t0=e.catch(12),new Bv("Error editing image message.");case 27:case"end":return e.stop()}}),e,this,[[12,24]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"editFileMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"===Zs(this,Hx)){e.next=3;break}return Dv.warn("editFileMessage::Coming soon!"),e.abrupt("return");case 3:if(null!=(i=null==(r=Zs(this,Vx).permissions)?void 0:r.chatPublic)&&i.canSend&&null!=(o=null==(a=Zs(this,Vx).permissions)?void 0:a.chatPublic)&&o.files){e.next=6;break}return Dv.error("sendFileMessage::permission_denied"),e.abrupt("return");case 6:if(n){e.next=9;break}return Dv.error("sendFileMessage::required_argument_file_can_not_be_empty"),e.abrupt("return");case 9:return e.prev=9,s=Xy(),e.next=13,s.getPresignedUrls(n.name);case 13:return c=e.sent,u=c.getLocation,l=c.putLocation,e.next=18,s.uploadFile(n,l);case 18:Zs(this,zx).editMessage(t,JSON.stringify({link:u,name:n.name,size:n.size}),Bx.FILE),e.next=24;break;case 21:throw e.prev=21,e.t0=e.catch(9),new Bv("Error editing file message.");case 24:case"end":return e.stop()}}),e,this,[[9,21]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"editMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"===Zs(this,Hx)){e.next=3;break}return Dv.warn("editMessage::Coming soon!"),e.abrupt("return");case 3:e.t0=n.type,e.next="text"===e.t0?6:"image"===e.t0?8:"file"===e.t0?10:12;break;case 6:return this.editTextMessage(t,n.message),e.abrupt("break",14);case 8:return this.editImageMessage(t,n.image),e.abrupt("break",14);case 10:return this.editFileMessage(t,n.file),e.abrupt("break",14);case 12:return Dv.error("editMessage::message_type_not_supported",{dyteChat:{messageType:n.type}}),e.abrupt("break",14);case 14:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteMessage",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"===Zs(this,Hx)){e.next=3;break}return Dv.warn("editMessage::Coming soon!"),e.abrupt("return");case 3:Zs(this,zx).deleteMessage(t);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getMessagesByUser",value:function(e){return this.messages.filter((function(t){return t.userId===e}))}},{key:"getMessagesByType",value:function(e){return this.messages.filter((function(t){return t.type===e}))}},{key:"pin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"===Zs(this,Hx)){e.next=5;break}if(this.roomJoined){e.next=3;break}throw new Bv("Can`t pin message without joining room");case 3:return e.next=5,Zs(this,qx,Gx).pinChatMessage({id:t});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unpin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"===Zs(this,Hx)){e.next=5;break}if(this.roomJoined){e.next=3;break}throw new Bv("Can`t unpin message without joining room");case 3:return e.next=5,Zs(this,qx,Gx).unpinChatMessage({id:t});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getMessages",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,a,o=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.length>3&&void 0!==o[3]?o[3]:0,e.next=3,Zs(this,zx).getChatMessagesPaginated(t,n,r,i);case 3:return a=e.sent,e.abrupt("return",{messages:a.messages.map((function(e){return oS.formatSocketServiceMessage(e)})),next:a.next});case 5:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"pinned",get:function(){return this.messages.filter((function(e){return e.pinned}))}}]),n}(ek),Vx=new WeakMap,Fx=new WeakMap,zx=new WeakMap,Hx=new WeakMap,qx=new WeakSet,Gx=function(){return Sk()},Wx);Kx([Lv.trace("DyteChat.sendTextMessage")],Yx.prototype,"sendTextMessage",1),Kx([Lv.trace("DyteChat.sendImageMessage")],Yx.prototype,"sendImageMessage",1),Kx([Lv.trace("DyteChat.sendFileMessage")],Yx.prototype,"sendFileMessage",1),Kx([Lv.trace("DyteChat.sendMessage")],Yx.prototype,"sendMessage",1),Kx([Lv.trace("DyteChat.editTextMessage")],Yx.prototype,"editTextMessage",1),Kx([Lv.trace("DyteChat.editImageMessage")],Yx.prototype,"editImageMessage",1),Kx([Lv.trace("DyteChat.editFileMessage")],Yx.prototype,"editFileMessage",1),Kx([Lv.trace("DyteChat.editMessage")],Yx.prototype,"editMessage",1),Kx([Lv.trace("DyteChat.deleteMessage")],Yx.prototype,"deleteMessage",1),Yx=Kx([zv((function(e){throw new Bv(e.message,"0500")}))],Yx);var Xx,eS,tS,nS,rS=Object.defineProperty,iS=Object.getOwnPropertyDescriptor,aS=(nS=function(){function e(t,n,r,i){(0,g.Z)(this,e),Ms(this,Xx),Cs(this,"chat"),Cs(this,"chatSocketHandler"),Cs(this,"self"),Ms(this,tS,void 0),this.chatSocketHandler=t,As(this,tS,n),this.chat=new Yx(t,n,r,i),this.self=r,this.setupEvents()}return(0,y.Z)(e,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,Xx,eS))?void 0:e.roomJoined)}},{key:"getChatMessages",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("LIVESTREAM"!==this.self.config.viewType&&!jc.hasFeature(tv)){e.next=2;break}return e.abrupt("return");case 2:if("socket-service"!==Zs(this,tS)){e.next=11;break}return e.next=5,this.chatSocketHandler.getChatMessages();case 5:if(null!=(t=e.sent)&&t.payload){e.next=8;break}return e.abrupt("return");case 8:return n=bg.fromBinary(t.payload).messages,this.chat.messages=n.map((function(e){return aS.formatSocketServiceMessage(e)})),e.abrupt("return");case 11:if(this.roomJoined){e.next=14;break}return Dv.error("ChatController.getChatMessages.RoomNodeClientSocketUsed_WithoutRoomJoin"),e.abrupt("return");case 14:return e.next=16,Zs(this,Xx,eS).getChatMessages();case 16:r=e.sent.payload.messages,this.chat.messages=r.filter((function(e){return"poll"!==Qx[e.type]})).map(aS.formatMessage);case 18:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setupEvents",value:function(){var e=this;"socket-service"===Zs(this,tS)?sm.on(cm.SOCKET_SERVICE_ROOM_JOINED,(function(){e.getChatMessages()})):sm.onAsync(cm.ROOM_JOINED,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getChatMessages();case 2:case"end":return t.stop()}}),t)})))),this.chatSocketHandler.on(rb.sendMessageToRoom,(function(t){var n=aS.formatSocketServiceMessage(t.message);e.chat.messages=[].concat((0,o.Z)(e.chat.messages),[n]),e.chat.emit("chatUpdate",{action:"add",message:n,messages:e.chat.messages})})),this.chatSocketHandler.on(rb.sendMessageToPeers,(function(t){var n=aS.formatSocketServiceMessage(t.message);e.chat.messages=[].concat((0,o.Z)(e.chat.messages),[n]),e.chat.emit("chatUpdate",{action:"add",message:n,messages:e.chat.messages})})),this.chatSocketHandler.on(rb.editMessage,(function(t){var n=aS.formatSocketServiceMessage(t.message),r=e.chat.messages.findIndex((function(e){return e.id===n.id}));-1!==r&&(e.chat.messages[r]=n,e.chat.emit("chatUpdate",{action:"edit",message:n,messages:e.chat.messages}))})),this.chatSocketHandler.on(rb.deleteMessage,(function(t){var n=e.chat.messages.findIndex((function(e){return e.id===t.chatId}));if(-1!==n){var r=e.chat.messages.splice(n,1),i=(0,d.Z)(r,1)[0];e.chat.emit("chatUpdate",{action:"delete",message:i,messages:e.chat.messages})}})),sm.on(cm.NEW_CHAT_MESSAGE,(function(t){if("poll"!==Qx[null==t?void 0:t.type]){var n=aS.formatMessage(t);e.chat.messages=[].concat((0,o.Z)(e.chat.messages),[n]),e.chat.emit("chatUpdate",{action:"add",message:n,messages:e.chat.messages})}})),sm.on(cm.PIN_CHAT_MESSAGE,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=aS.formatMessage(n),i=e.chat.messages.findIndex((function(e){return e.id===r.id})),e.chat.messages[i]=r,e.chat.emit("pinMessage",{message:r,messages:e.chat.messages});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.UNPIN_CHAT_MESSAGE,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=aS.formatMessage(n),i=e.chat.messages.findIndex((function(e){return e.id===r.id})),e.chat.messages[i]=r,e.chat.emit("unpinMessage",{message:r,messages:e.chat.messages});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i){var a,o;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=jc.getValue(Cf),Dv.debug("Received flagsmith chat_socket_server: ".concat(a)),o="socket-service"===Yv("chat_socket_server")||"socket-service"===a||i.includes("HIVE")?"socket-service":"room-node",e.abrupt("return",(Dv.info("Using socket server :: ".concat(o," for chat")),new aS(t,o,n,r)));case 4:case"end":return e.stop()}}),e)})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"formatMessage",value:function(e){return(0,s.Z)((0,s.Z)({},e),{},{time:new Date(e.time),type:Qx[e.type]})}},{key:"formatSocketServiceMessage",value:function(e){var t=1e3*e.createdAt,n={dis
2playName:e.displayName,id:e.chatId,time:t,timeMs:e.createdAtMs,type:e.payloadType,isEdited:e.isEdited,userId:e.userId,targetUserIds:e.targetUserIds,message:"",link:"",name:"",size:0};switch(n.type){case Bx.TEXT:n.message=e.payload;break;case Bx.IMAGE:n.link=e.payload;break;case Bx.FILE:var r=JSON.parse(e.payload),i=r.link,a=r.name,o=r.size;n.link=i,n.name=a,n.size=o}return aS.formatMessage(n)}}]),e}(),Xx=new WeakSet,eS=function(){return Sk()},tS=new WeakMap,nS),oS=aS;!function(e,t,n,r){for(var i,a=r>1?void 0:r?iS(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&rS(t,n,a)}([Lv.trace("ChatController.setupEvents")],oS.prototype,"setupEvents",1);var sS,cS,uS,lS,dS,pS,hS=Object.defineProperty,fS=Object.getOwnPropertyDescriptor,vS=(pS=function(){function e(t,n,r,i){(0,g.Z)(this,e),Ms(this,lS),Cs(this,"plugins"),Ms(this,sS,void 0),Ms(this,cS,void 0),Ms(this,uS,void 0),As(this,sS,t),As(this,uS,n),As(this,cS,r),this.plugins=i,this.setupEvents()}return(0,y.Z)(e,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,lS,dS))?void 0:e.roomJoined)}},{key:"getRoomPlugins",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"!==Zs(this,cS)){e.next=8;break}return e.next=3,Zs(this,sS).getActivePlugins();case 3:return t=e.sent,n=t.plugins,e.next=7,Promise.all(n.map((function(e){return a.enablePlugin({id:e.pluginId,enabledBy:e.enabledBy})})));case 7:return e.abrupt("return");case 8:if(this.roomJoined){e.next=11;break}return Dv.error("PluginController.getRoomPlugins.RoomNodeClientSocketUsed_WithoutRoomJoin"),e.abrupt("return");case 11:return e.next=13,Zs(this,lS,dS).getRoomState();case 13:return r=e.sent,i=r.payload,e.next=17,Promise.all(i.roomState.plugins.map((function(e){return a.enablePlugin(e)})));case 17:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"enablePlugin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.id,r=t.enabledBy,i=this.plugins.all.get(n),e.t0=i,!e.t0){e.next=7;break}return e.next=6,i.activateForSelf();case 6:i.enabledBy=r;case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disablePlugin",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.id,(r=this.plugins.all.get(n))&&r.deactivateForSelf();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendIframeEventOld",value:function(e,t){var n=t.id,r=this.plugins.all.get(n);r&&r.sendIframeEvent({type:e,payload:t})}},{key:"sendIframeEvent",value:function(e,t,n,r){var i=this.plugins.all.get(t);t&&i.sendIframeEvent({type:e,uuid:n,payload:r})}},{key:"broadcastIframeEventOld",value:function(e,t){var n=this;this.plugins.active.forEach((function(r){n.sendIframeEventOld(e,(0,s.Z)((0,s.Z)({},t),{},{id:r.id}))}))}},{key:"broadcastIframeEvent",value:function(e,t){var n=this;this.plugins.active.forEach((function(r){n.sendIframeEvent(e,r.id,"",t)}))}},{key:"setupEvents",value:function(){var e=this;if(this.plugins.all.on("stateUpdate",(function(t){var n=t.active,r=t.id;n?e.plugins.active.add(e.plugins.all.get(r)):e.plugins.active.delete(r)})),sm.onAsync(cm.ROOM_JOINED,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getRoomPlugins();case 2:Dv.debug("[ROOM_JOINED] resolved request to fetch plugins.");case 3:case"end":return t.stop()}}),t)})))),"socket-service"===Zs(this,cS))return Zs(this,sS).on(ib.addPlugin,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n.pluginId,t.t0=null!=(r=e.plugins.all.get(i))&&r.active,t.t0){t.next=5;break}return t.next=5,e.enablePlugin({id:i,enabledBy:n.enabledBy});case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Zs(this,sS).on(ib.removePlugin,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n.pluginId,t.t0=null!=(r=e.plugins.all.get(i))&&r.active,!t.t0){t.next=5;break}return t.next=5,e.disablePlugin({id:i});case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),[ib.enablePluginForPeers,ib.enablePluginForRoom].forEach((function(t){Zs(e,sS).on(t,function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r,i){return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e.sendIframeEvent(t,r.pluginId,i,{enabledBy:r.enabledBy});case 1:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())})),[ib.disablePluginForPeers,ib.disablePluginForRoom].forEach((function(t){Zs(e,sS).on(t,function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r,i){return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e.sendIframeEvent(t,r.pluginId,i,{disabledBy:r.disabledBy});case 1:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())})),[ib.customPluginEventToPeers,ib.customPluginEventToRoom].forEach((function(t){Zs(e,sS).on(t,function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r,i){return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e.sendIframeEvent(t,r.pluginId,i,{data:JSON.parse((new TextDecoder).decode(r.pluginData))});case 1:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())})),[ib.storeInsertKeys,ib.storeGetKeys,ib.storeDeleteKeys].forEac
2h((function(t){Zs(e,sS).on(t,function(){var n=(0,h.Z)((0,p.Z)().mark((function n(r,i){var a,o;return(0,p.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=null==(a=r.storeItems)?void 0:a.map((function(e){return{timestamp:e.timestamp,peerId:e.peerId,payload:JSON.parse(e.payload?(new TextDecoder).decode(e.payload):"{}"),key:e.storeKey}})),e.sendIframeEvent(t,r.pluginId,i,{storeName:r.storeName,storeItems:o});case 2:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}())})),Zs(this,sS).on(ib.storeDelete,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n,r){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.sendIframeEvent(ib.storeDelete,n.pluginId,r,{storeName:n.storeName});case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),Zs(this,uS).on(rb.sendMessageToPeers,(function(t){var n=null==oS?void 0:oS.formatSocketServiceMessage(t.message);e.broadcastIframeEvent(wx,{message:n})})),Zs(this,uS).on(rb.sendMessageToRoom,(function(t){var n=null==oS?void 0:oS.formatSocketServiceMessage(t.message);e.broadcastIframeEvent(wx,{message:n})})),sm.on(cm.PEER_JOINED,(function(t){e.broadcastIframeEvent(Px,t)})),void sm.on(cm.PEER_CLOSED,(function(t){e.broadcastIframeEvent(Cx,t)}));sm.on(cm.ENABLE_PLUGIN,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.id,i=n.enabledBy,t.next=3,e.enablePlugin({id:r,enabledBy:i});case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.DISABLE_PLUGIN,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.id,t.next=3,e.disablePlugin({id:r});case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),[cm.PLUGIN_DATA,cm.PLUGIN_EVENT].forEach((function(t){sm.on(t,(function(n){e.sendIframeEventOld(t,n)}))})),[cm.PEER_JOINED,cm.PEER_CLOSED,cm.NEW_CHAT_MESSAGE].forEach((function(t){sm.on(t,(function(n){e.broadcastIframeEventOld(t,n)}))}))}}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r,i,a,o,s){var c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=jc.getValue(Zf),Dv.debug("Received flagsmith plugin_socket_server:: ".concat(c)),u="socket-service"===c||s.includes("HIVE")?"socket-service":"room-node",Dv.info("Using socket server ".concat(u," for plugin")),l=new Ox,e.abrupt("return",(t.forEach((function(e){var t=new Zx(e,n,u,a,o,i);l.all.add(t)})),!1===a.config.isV2&&a.config.setDisabledPlugins(l.all.toArray().map((function(e){return e.id}))),new vS(n,r,u,l)));case 6:case"end":return e.stop()}}),e)})));return function(t,n,r,i,a,o,s){return e.apply(this,arguments)}}()}]),e}(),sS=new WeakMap,cS=new WeakMap,uS=new WeakMap,lS=new WeakSet,dS=function(){return Sk()},pS),mS=vS;!function(e,t,n,r){for(var i,a=r>1?void 0:r?fS(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&hS(t,n,a)}([Lv.trace("PluginController.setupEvents")],mS.prototype,"setupEvents",1);var gS,yS,bS,kS,_S,wS,xS=Object.defineProperty,SS=Object.getOwnPropertyDescriptor,ES=(wS=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r,i){var a;return(0,g.Z)(this,n),a=t.call(this),Ms((0,f.Z)(a),gS),Cs((0,f.Z)(a),"items"),Ms((0,f.Z)(a),bS,void 0),Ms((0,f.Z)(a),kS,void 0),Ms((0,f.Z)(a),_S,void 0),As((0,f.Z)(a),bS,e),As((0,f.Z)(a),kS,r),As((0,f.Z)(a),_S,i),a.items=[],a}return(0,y.Z)(n,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,gS,yS))?void 0:e.roomJoined)}},{key:"create",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r,i,a,o=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.length>2&&void 0!==o[2]&&o[2],i=o.length>3&&void 0!==o[3]&&o[3],"LIVESTREAM"===Zs(this,bS).config.viewType||this.roomJoined){e.next=4;break}throw new Bv("Can't create polls without joining room");case 4:if(Zs(this,bS).permissions.polls.canCreate){e.next=7;break}return Dv.error("DytePolls::create::permission_denied"),e.abrupt("return");case 7:if(t&&n){e.next=10;break}return Dv.error("DytePolls::question_and_options_can_not_be_empty",{dytePolls:{hasQuestion:!!t,optionsLength:null==n?void 0:n.length}}),e.abrupt("return");case 10:if(!(n.length<2)){e.next=13;break}return Dv.error("DytePolls::there_must_be_at_least_two_options",{dytePolls:{hasQuestion:!!t,optionsLength:n.length}}),e.abrupt("return");case 13:if("socket-service"!==Zs(this,_S)){e.next=17;break}
2return e.next=16,Zs(this,kS).createPoll(t,n,r,i);case 16:return e.abrupt("return");case 17:return a={question:t,options:n,anonymous:r,hideVotes:i,createdBy:Zs(this,bS).name,createdByUserId:Zs(this,bS).userId},e.next=20,Zs(this,gS,yS).newPoll(a);case 20:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"vote",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n){var r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,bS).permissions.polls.canVote){e.next=3;break}return Dv.error("DytePolls::vote::permission_denied"),e.abrupt("return");case 3:if("socket-service"!==Zs(this,_S)){e.next=7;break}return e.next=6,Zs(this,kS).votePoll(t,n);case 6:return e.abrupt("return");case 7:return r={pollId:t,index:n},e.next=10,Zs(this,gS,yS).votePoll(r);case 10:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(ek),gS=new WeakSet,yS=function(){return Sk()},bS=new WeakMap,kS=new WeakMap,_S=new WeakMap,wS);ES=function(e,t,n,r){for(var i,a=r>1?void 0:r?SS(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&xS(t,n,a),a}([zv((function(e){throw new Bv(e.message,"0700")}))],ES);var TS,PS,CS,RS,ZS,MS,AS=Object.defineProperty,IS=Object.getOwnPropertyDescriptor,OS=(MS=function(){function e(t,n,r){(0,g.Z)(this,e),Ms(this,RS),Cs(this,"polls"),Ms(this,TS,void 0),Ms(this,PS,void 0),Ms(this,CS,void 0),this.polls=new ES(t,n,r),As(this,TS,t),As(this,PS,n),As(this,CS,r),this.setupEvents()}return(0,y.Z)(e,[{key:"canViewPolls",value:function(){return Zs(this,TS).permissions.polls.canView}},{key:"setupEvents",value:function(){var e=this;if("socket-service"===Zs(this,CS)){if(!this.canViewPolls())return;sm.on(cm.SOCKET_SERVICE_ROOM_JOINED,(function(){e.getPolls()})),Zs(this,PS).on(ab.createPoll,(function(t){t.poll&&e.updatePoll(OS.formatSocketServicePoll(t.poll))})),Zs(this,PS).on(ab.updatePoll,(function(t){t.poll&&e.updatePoll(OS.formatSocketServicePoll(t.poll))})),Zs(this,PS).on(ab.votePoll,(function(t){t.poll&&e.updatePoll(OS.formatSocketServicePoll(t.poll))}))}else sm.onAsync(cm.ROOM_JOINED,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.canViewPolls()&&e.getPolls();case 1:case"end":return t.stop()}}),t)}))));sm.on(cm.UPDATE_POLL,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=n.poll,e.updatePoll(r);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"updatePoll",value:function(e){if(this.canViewPolls()){var t=this.polls.items.findIndex((function(t){return t.id===e.id}));if(t>-1){var n=JSON.stringify(this.polls.items[t]);return this.polls.items[t]=e,void(n!==JSON.stringify(e)&&this.polls.emit("pollsUpdate",{polls:this.polls.items,newPoll:!1}))}this.polls.items=[].concat((0,o.Z)(this.polls.items),[e]),this.polls.emit("pollsUpdate",{polls:this.polls.items,newPoll:!0})}}},{key:"getPolls",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("socket-service"!==Zs(this,CS)){e.next=9;break}return e.next=3,Zs(this,PS).getPolls();case 3:if(null!=(t=e.sent)&&t.payload){e.next=6;break}return e.abrupt("return");case 6:return n=Ay.fromBinary(t.payload),r=n.polls,this.polls.items=r.map((function(e){return OS.formatSocketServicePoll(e)})),e.abrupt("return");case 9:if(!(Zs(this,RS,ZS)instanceof gk)){e.next=14;break}return e.next=12,Zs(this,RS,ZS).getPolls();case 12:i=e.sent.payload.polls,this.polls.items=Object.values(i);case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=jc.getValue(Rf),Dv.debug("Received flagsmith poll_socket_server: ".concat(i)),a="socket-service"===Yv("poll_socket_server")||"socket-service"===i||r.includes("HIVE")?"socket-service":"room-node",e.abrupt("return",(Dv.info("Using socket server ".concat(a," for polls")),new OS(t,n,a)));case 4:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"formatSocketServicePoll",value:function(e){var t=e.options.map((function(e){return{count:e.count,text:e.text,votes:e.votes.map((function(e){return{id:e.userId,name:e.name}}))}}));return{anonymous:e.anonymous,createdBy:e.createdBy,createdByUserId:e.createdByUserId,hideVotes:e.hideVotes,id:e.pollId,options:t,question:e.question,voted:e.votes}}}]),e}(),TS=new WeakMap,PS=new WeakMap,CS=new WeakMap,RS=new WeakSet,ZS=function(){return Sk()},MS),LS=OS;!function(e,t,n,r){for(var i,a=r>1?void 0:r?IS(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&AS(t,n,a)}([Lv.trace("PollController.setupEvents")],LS.prototype,"setupEvents",1);var DS,NS,jS,BS,US,VS,FS=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,{onAddEvent:"remoteRequestAdd",onDeleteEvent:"remoteRequestRemove"})}return(0,y.Z)(n,[{key:"add",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return l((0,u.Z)(n.prototype),"add",this).call(this,e,t)}},{key:"delete",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return l((0,u.Z)(n.prototype),"delete",this).call(this,e,t,r)}}]),n}(Mw),zS=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this),Ms((0,f.Z)(i),DS),Cs((0,f.Z)(i),"incomingRequests"),Cs((0,f.Z)(i),"outgoingRequests"),Cs((0,f.Z)(i),"active"),Ms((0,f.Z)(i),jS,void 0),Ms((0,f.Z)(i),BS,void 0),As((0,f.Z)(i),BS,r),As((0,f.Z)(i),jS,e),i.incomingRequests=new FS,i.outgoingRequests=new FS,i.active=null,i.mouseEvent=i.mouseEvent.bind((0,f.Z)(i)),i.keyboardEvent=i.keyboardEvent.bind((0,f.Z)(i)),i}return(0,y.Z)(n,[{key:"requestControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,BS).joined.get(t)){e.next=2;break}throw new Bv("Invalid peer.");case 2:if(!(r=null==(n=this.outgoingRequests)?void 0:n.toArray().find((function(e){return e.hostPeerId===t})))){e.next=5;break}return e.abrupt("return",r.id);case 5:return i=P(),a=new ck({requestId:i,hostPeerId:t,remotePeerId:Zs(this,jS).id,state:ik.PENDING}),this.outgoingRequests.add(a),e.next=9,Zs(this,DS,NS).requestRemoteControl(a);
2case 9:return this.emit("remoteUpdate",{payload:{request:{id:a.id,hostPeerId:a.hostPeerId,remotePeerId:a.remotePeerId}},type:sk.REQUEST_SENT}),e.abrupt("return",i);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"acceptControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((null==(n=this.active)?void 0:n.id)!==t){e.next=2;break}return e.abrupt("return");case 2:if(r=this.incomingRequests.get(t)){e.next=5;break}throw new Bv("No request found.");case 5:r.state=ik.ACCEPTED,this.endControl(),this.active=r,Zs(this,DS,NS).acceptRemoteControl(r),this.emit("remoteUpdate",{payload:{request:{id:this.active.id,hostPeerId:this.active.hostPeerId,remotePeerId:this.active.remotePeerId}},type:sk.INCOMING_REQUEST_ACCEPTED});case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"endControl",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.active){e.next=2;break}return e.abrupt("return");case 2:t=(0,s.Z)({},this.active),Zs(this,DS,NS).terminateRemoteControl(this.active.hostPeerId===Zs(this,jS).id?this.active.remotePeerId:this.active.hostPeerId,this.active),this.active=null,this.emit("remoteUpdate",{payload:{request:{id:t.id,hostPeerId:t.hostPeerId,remotePeerId:t.remotePeerId}},type:t.hostPeerId===Zs(this,jS).id?sk.INCOMING_REQUEST_ENDED:sk.OUTGOING_REQUEST_ENDED});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"keyboardEvent",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.active){e.next=2;break}return e.abrupt("return");case 2:(r=n.getFormattedKeyboardEvent(t))&&(i={eventType:ak.KEYBOARD,keyboardEvent:r},Zs(this,DS,NS).sendEventRemoteControl(this.active.hostPeerId,this.active.id,i));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"mouseEvent",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,r){var i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.active){e.next=2;break}return e.abrupt("return");case 2:(i=n.getFormattedRemoteMouseEvent(t,r))&&(a={eventType:ak.MOUSE,mouseEvent:i},Zs(this,DS,NS).sendEventRemoteControl(this.active.hostPeerId,this.active.id,a));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}],[{key:"getFormattedRemoteMouseEvent",value:function(e,t){var n=t.getBoundingClientRect();return{type:e.type,position:{x:Math.floor(e.x-n.left),y:Math.floor(e.y-n.top)},boundingRect:{width:n.width,height:n.height}}}},{key:"getFormattedKeyboardEvent",value:function(e){return"keydown"===e.type?{type:e.type,key:e.key}:null}}]),n}(ek),HS=zS;DS=new WeakSet,NS=function(){return Sk()},jS=new WeakMap,BS=new WeakMap;var qS=function(){function e(t,n){(0,g.Z)(this,e),Cs(this,"remote"),Cs(this,"hostPeetId"),Cs(this,"remotePeetId"),Cs(this,"remoteRequestTokens"),Cs(this,"activeRemoteToken"),Ms(this,US,void 0),Ms(this,VS,void 0),As(this,US,t),As(this,VS,n),this.hostPeetId=t.id,this.remote=new HS(t,n),this.setupEvents()}return(0,y.Z)(e,[{key:"setupEvents",value:function(){var t=this;sm.on(cm.MESSAGE,(function(n){var r;if(n.remoteRequestType===rk.REQUEST&&(t.remote.incomingRequests.add(new ck({requestId:n.remoteRequestId,hostPeerId:n.hostPeerId,remotePeerId:n.remotePeerId,state:ik.PENDING})),t.remote.emit("remoteUpdate",{payload:{request:{id:n.remoteRequestId,hostPeerId:n.hostPeerId,remotePeerId:n.remotePeerId}},type:sk.REQUEST_RECEIVED})),n.remoteRequestType===rk.ACCEPT){var i=t.remote.outgoingRequests.get(n.remoteRequestId);if(!i)throw new Bv("There is no pending remote control request to accept.");t.remote.endControl(),i.state=ik.ACCEPTED,t.remote.active=new ck({requestId:n.remoteRequestId,hostPeerId:n.hostPeerId,remotePeerId:n.remotePeerId,state:ik.ACCEPTED}),t.remote.emit("remoteUpdate",{payload:{request:{id:n.remoteRequestId,hostPeerId:n.hostPeerId,remotePeerId:n.remotePeerId}},type:sk.OUTGOING_REQUEST_ACCEPTED})}n.remoteRequestType===rk.END&&((null==(r=t.remote.active)?void 0:r.id)===n.remoteRequestId&&(t.remote.active=null),t.remote.emit("remoteUpdate",{payload:{request:{id:n.remoteRequestId,hostPeerId:n.hostPeerId,remotePeerId:n.remotePeerId}},type:n.hostPeerId===Zs(t,US).id?sk.INCOMING_REQUEST_ENDED:sk.OUTGOING_REQUEST_ENDED})),n.remoteRequestType===rk.EVENT&&t.remote.active&&t.remote.active.id===n.remoteRequestId&&window.DyteRobot&&(n.remoteEvent.eventType===ak.MOUSE?e.executeMouseEvent(n.remoteEvent.mouseEvent):n.remoteEvent.eventType===ak.KEYBOARD&&e.executeKeyboardEvent(n.remoteEvent.keyboardEvent))})),sm.on(cm.PEER_CLOSED,(function(e){var n,r,i,a,o,s,c,u,l=e.id;[null==(r=null==(n=t.remote)?void 0:n.active)?void 0:r.hostPeerId,null==(a=null==(i=t.remote)?void 0:i.active)?void 0:a.remotePeerId].includes(l)&&t.remote.endControl(),null==(s=null==(o=t.remote)?void 0:o.incomingRequests)||s.toArray().forEac
2h((function(e){[e.hostPeerId,e.remotePeerId].includes(l)&&t.remote.incomingRequests.delete(e.id)})),null==(u=null==(c=t.remote)?void 0:c.outgoingRequests)||u.toArray().forEach((function(e){[e.hostPeerId,e.remotePeerId].includes(l)&&t.remote.outgoingRequests.delete(e.id)}))}))}}],[{key:"executeMouseEvent",value:function(e){var t=window.screen.width*e.position.x/e.boundingRect.width,n=window.screen.height*e.position.y/e.boundingRect.height,r={width:window.screen.width,height:window.screen.height};switch(e.type){case ok.LEFT_CLICK:window.DyteRobot.mouse.leftClick(t,n,r);break;case ok.RIGHT_CLICK:window.DyteRobot.mouse.rightClick(t,n,r);break;case ok.MOVE:window.DyteRobot.mouse.moveTo(t,n,r)}}},{key:"executeKeyboardEvent",value:function(e){if("keydown"===e.type)window.DyteRobot.keyboard.press(e.key)}}]),e}(),GS=qS;US=new WeakMap,VS=new WeakMap;var WS,JS,$S,KS,QS,YS,XS,eE,tE,nE,rE,iE,aE,oE,sE,cE,uE,lE,dE,pE,hE,fE,vE,mE,gE,yE,bE,kE,_E,wE,xE,SE,EE=Object.defineProperty,TE=function(e,t,n){return function(e,t,n){t in e?EE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!=typeof t?t+"":t,n),n},PE=function(e,t,n){if(!t.has(e))throw TypeError("Cannot "+n)},CE=function(e,t,n){return PE(e,t,"read from private field"),n?n.call(e):t.get(e)},RE=function(e,t,n){if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ZE=function(e,t,n,r){return PE(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n},ME=function(e,t,n){return PE(e,t,"access private method"),n},AE={exports:{}},IE="object"==typeof Reflect?Reflect:null,OE=IE&&"function"==typeof IE.apply?IE.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};SE=IE&&"function"==typeof IE.ownKeys?IE.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var LE=Number.isNaN||function(e){return e!==e};function DE(){DE.init.call(this)}AE.exports=DE,AE.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}GE(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&GE(e,"error",t,n)}(e,i,{once:!0})}))},DE.EventEmitter=DE,DE.prototype._events=void 0,DE.prototype._eventsCount=0,DE.prototype._maxListeners=void 0;var NE=10;function jE(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function BE(e){return void 0===e._maxListeners?DE.defaultMaxListeners:e._maxListeners}function UE(e,t,n,r){var i,a,o;if(jE(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=BE(e))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function VE(){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 FE(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=VE.bind(r);return i.listener=n,r.wrapFn=i,i}function zE(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):qE(i,i.length)}function HE(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 qE(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function GE(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(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(DE,"defaultMaxListeners",{enumerable:!0,get:function(){return NE},set:function(e){if("number"!=typeof e||e<0||LE(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");NE=e}}),DE.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},DE.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||LE(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},DE.prototype.getMaxListeners=function(){return BE(this)},DE.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)OE(s,this,t);else{var c=s.length,u=qE(s,c);for(n=0;n<c;++n)OE(u[n],this,t)}return!0},DE.prototype.addListener=function(e,t){return UE(this,e,t,!1)},DE.prototype.on=DE.prototype.addListener,DE.prototype.prependListener=function(e,t){return UE(this,e,t,!0)},DE.prototype.once=function(e,t){return jE(t),this.on(e,FE(this,e,t)),this},DE.prototype.prependOnceListener=function(e,t){return jE(t),this.prependListener(e,FE(this,e,t)),this},DE.prototype.removeListener=function(e,t){var n,r,i,a,o;if(jE(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
2("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;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,o||t)}return this},DE.prototype.off=DE.prototype.removeListener,DE.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,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[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},DE.prototype.listeners=function(e){return zE(this,e,!0)},DE.prototype.rawListeners=function(e){return zE(this,e,!1)},DE.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):HE.call(e,t)},DE.prototype.listenerCount=HE,DE.prototype.eventNames=function(){return this._eventsCount>0?SE(this._events):[]};var WE=AE.exports,JE=new(function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.call(this,"message.v1.SocketMessage",[{no:1,name:"event",kind:"scalar",T:13},{no:2,name:"id",kind:"scalar",opt:!0,T:9},{no:3,name:"payload",kind:"scalar",opt:!0,T:12},{no:4,name:"metadata",kind:"scalar",opt:!0,T:12}])}return(0,y.Z)(n)}(Xa)),$E=function(){function e(){(0,g.Z)(this,e)}return(0,y.Z)(e,null,[{key:"encode",value:function(e){return JE.toBinary(e)}},{key:"decode",value:function(e){return JE.fromBinary(new Uint8Array(e))}}]),e}();function KE(e,t){return Math.floor(Math.random()*(t-e+1)+e)}var QE=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,g.Z)(this,e),TE(this,"opts"),RE(this,WS,void 0),this.opts={initialTimeout:t.initialTimeout||1e3,maxTimeout:t.maxTimeout||1e4,factor:t.factor||2},ZE(this,WS,0)}return(0,y.Z)(e,[{key:"wait",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ZE(this,WS,CE(this,WS)+1),t=KE(0,Math.min(this.opts.maxTimeout,this.opts.initialTimeout*Math.pow(2,CE(this,WS)))),e.next=4,new Promise((function(e){setTimeout(e,t)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getAttempts",value:function(){return CE(this,WS)}},{key:"reset",value:function(){ZE(this,WS,0)}}]),e}();WS=new WeakMap;var YE={debug:0,info:1,warn:2,error:3},XE=function(){function e(t){(0,g.Z)(this,e),RE(this,JS,void 0),RE(this,$S,void 0),ZE(this,JS,console),ZE(this,$S,t)}return(0,y.Z)(e,[{key:"debug",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];YE[CE(this,$S)]>YE.debug||(e=CE(this,JS)).debug.apply(e,["[Sockrates]:"].concat(n))}},{key:"info",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];YE[CE(this,$S)]>YE.info||(e=CE(this,JS)).info.apply(e,["[Sockrates]:"].concat(n))}},{key:"warn",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];YE[CE(this,$S)]>YE.warn||(e=CE(this,JS)).warn.apply(e,["[Sockrates]:"].concat(n))}},{key:"error",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];YE[CE(this,$S)]>YE.error||(e=CE(this,JS)).error.apply(e,["[Sockrates]:"].concat(n))}}]),e}();JS=new WeakMap,$S=new WeakMap;var eT=function(e){return e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED",e}(eT||{}),tT=function(){function e(t,n){var r,i,a,o,s,c,u,l,d,p;(0,g.Z)(this,e),RE(this,oE),RE(this,cE),RE(this,lE),RE(this,pE),RE(this,fE),RE(this,mE),RE(this,yE),RE(this,kE),RE(this,wE),RE(this,KS,void 0),RE(this,QS,void 0),RE(this,YS,void 0),RE(this,XS,void 0),RE(this,eE,void 0),RE(this,tE,void 0),RE(this,nE,void 0),RE(this,rE,void 0),RE(this,iE,void 0),RE(this,aE,void 0),ZE(this,QS,t),ZE(this,eE,[]),ZE(this,tE,new W
2E),ZE(this,nE,!0),ZE(this,rE,!1),ZE(this,YS,null!=n?n:{}),null!=(r=CE(this,YS)).autoReconnect||(r.autoReconnect=!0),null!=(i=CE(this,YS)).retryConnectionInterval||(i.retryConnectionInterval=1e3),null!=(a=CE(this,YS)).pingTimeout||(a.pingTimeout=3e4),null!=(o=CE(this,YS)).connectionTimeout||(o.connectionTimeout=5e3),null!=(s=CE(this,YS)).debug||(s.debug=!0),null!=(c=CE(this,YS)).maxReconnectionAttempts||(c.maxReconnectionAttempts=10),null!=(u=CE(this,YS)).disconnectOnPingTimeout||(u.disconnectOnPingTimeout=!0),null!=(l=CE(this,YS)).queueOnDisconnect||(l.queueOnDisconnect=!1),null!=(d=CE(this,YS)).flushOnReconnect||(d.flushOnReconnect=!1),ZE(this,XS,null!=(p=CE(this,YS).logger)?p:new XE(CE(this,YS).debug?"debug":"info")),ZE(this,aE,new QE)}return(0,y.Z)(e,[{key:"readyState",get:function(){return CE(this,KS).readyState}},{key:"url",get:function(){return CE(this,QS)}},{key:"config",get:function(){return CE(this,YS)}},{key:"sendQueue",get:function(){return CE(this,eE)}},{key:"flush",value:function(){var e=this;if(!CE(this,YS).queueOnDisconnect)return!1;var t=[];return CE(this,eE).forEach((function(n){e.send(n.event,n.id,n.payload,n.metadata)||t.push(n)})),ZE(this,eE,t),CE(this,eE)}},{key:"connect",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1===CE(this,nE)){e.next=2;break}return e.abrupt("return",new Promise((function(e,n){ME(t,kE,_E).call(t),ME(t,wE,xE).call(t);try{ZE(t,KS,new WebSocket(ME(t,oE,sE).call(t,CE(t,QS)))),CE(t,KS).binaryType="arraybuffer",CE(t,XS).debug("Connecting to",CE(t,QS));var r=setTimeout((function(){CE(t,XS).debug("Connection timeout. Closing socket"),ZE(t,nE,!0),ME(t,wE,xE).call(t),CE(t,KS).close(3001,"Connection Timeout"),CE(t,YS).autoReconnect&&!CE(t,rE)&&(CE(t,tE).emit("reconnecting"),ME(t,fE,vE).call(t)),n(new Error("Connection timed out!"))}),CE(t,YS).connectionTimeout);CE(t,KS).onopen=function(){CE(t,XS).debug("Ready State: ".concat(eT[CE(t,KS).readyState])),r&&clearTimeout(r),ME(t,yE,bE).call(t),CE(t,tE).emit("connected"),CE(t,YS).flushOnReconnect&&t.flush(),e()},CE(t,KS).onclose=function(e){try{r&&clearTimeout(r);var i=e.code,a=e.reason;if(n(a),CE(t,XS).debug("Socket closed. Close event:",e),CE(t,XS).debug("Connection closed code:",i),CE(t,XS).debug("Connection closed reason:",a),CE(t,nE)&&1e3!==i&&CE(t,YS).autoReconnect&&!CE(t,rE))return CE(t,tE).emit("reconnecting"),void ME(t,fE,vE).call(t);CE(t,rE)||CE(t,tE).emit("disconnected",{code:i,reason:a})}catch(o){ME(t,cE,uE).call(t,o)}},CE(t,KS).onerror=function(e){ME(t,cE,uE).call(t,e)},CE(t,KS).onmessage=function(e){return ME(t,lE,dE).call(t,e)}}catch(i){ME(t,cE,uE).call(t,i,n)}})));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(e,t,n,r){var i={event:e,id:t,payload:n,metadata:r};if(CE(this,YS).queueOnDisconnect&&(!CE(this,KS)||1!==CE(this,KS).readyState))return CE(this,XS).debug("Queuing message since socket is not connected!",i),CE(this,eE).push(i),!1;var a=$E.encode(i);return ME(this,mE,gE).call(this,a)}},{key:"emit",value:function(e,t,n,r){return this.send(e,t,n,r)}},{key:"receive",value:function(e,t){return CE(this,tE).on(e.toString(),t)}},{key:"on",value:function(e,t){"string"!=typeof e||"connected"!==e&&"disconnected"!==e&&"errored"!==e&&"reconnected"!==e&&"reconnecting"!==e&&"reconnectAttempt"!==e&&"reconnectFailure"!==e&&"failed"!==e?this.receive(e,t):CE(this,tE).on(e,t)}},{key:"removeAllListeners",value:function(){CE(this,tE).removeAllListeners()}},{key:"removeReceiver",value:function(e,t){this.removeListener(e,t)}},{key:"removeListener",value:function(e,t){CE(this,tE).removeListener(e.toString(),t)}},{key:"removeReceivers",value:function(e){this.removeListeners(e)}},{key:"removeListeners",value:function(e){var t=this;CE(this,tE).listeners(e.toString()).map((function(n){return t.removeListener(e,n)}))}},{key:"disconnect",value:function(){ZE(this,nE,!1),ME(this,kE,_E).call(this),this.removeAllListeners(),CE(this,KS).close(1e3,"Sockrates disconnect method called.")}}]),e}();KS=new WeakMap,QS=new WeakMap,YS=new WeakMap,XS=new WeakMap,eE=new WeakMap,tE=new WeakMap,nE=new WeakMap,rE=new WeakMap,iE=new WeakMap,aE=new WeakMap,oE=new WeakSet,sE=function(e){if(e.startsWith("ws://")||e.startsWith("wss://"))return e;if(e.startsWith("https://"))return"wss://".concat(e.substring(8));if(e.startsWith("http://"))return"ws://".concat(e.substring(7));throw new Error("Invalid URL. URL must start with http(s):// or ws(s)://.")},cE=new WeakSet,uE=function(e,t){CE(this,XS).error("Error:",e),CE(this,tE).emit("errored",{error:e}),null==t||t(e)},lE=new WeakSet,dE=function(e){if("2"===e.data)return CE(this,XS).debug("Received ping from server"),ME(this,yE,bE).call(this),void ME(this,mE,gE).call(this,"3");CE(this,XS).debug("Received data:",e.data);var t=$E.decode(e.data),n=t.id,r=t.payload;CE(this,tE).emit(t.event.toString(),{id:n,payload:r})},pE=new WeakSet,hE=function(){return 1===CE(this,KS).readyState},fE=new WeakSet,vE=function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!(t.length>0&&void 0!==t[0])||t[0])||!CE(this,rE)){e.next=4;break}return CE(this,XS).debug("Reconnect called when already in a reconnect loop. Ignoring."),e.abrupt("return");case 4:if(CE(this,rE)||CE(this,aE).reset(),!(null!==CE(this,YS).maxReconnectionAttempts&&CE(this,aE).getAttempts()>=CE(this,YS).maxReconnectionAttempts)){e.next=7;break}return CE(this,tE).emit("failed"),ZE(this,rE,!1),e.abrupt("return");case 7:return ZE(this,rE,!0),ME(this,wE,xE).call(this),ME(this,kE,_E).call(this),e.prev=8,e.next=11,CE(this,aE).wait();case 11:if(!1!==CE(this,nE)){e.next=13;break}return e.abrupt("return");case 13:return CE(this,XS).debug("Reconnection attempt ".concat(CE(this,aE).getAttempts())),CE(this,tE).emit("reconnectAttempt",{attempt:CE(this,aE).getAttempts()}),e.next=17,this.connect();case 17:if(ME(this,pE,hE).call(this)){e.next=19;break}throw Error("Reconnect Failed");case 19:ZE(this,rE,!1),CE(this,tE).emit("reconnected"),e.next=25;break;case 22:e.prev=22,e.t0=e.catch(8),CE(this,XS).debug("Failed to reconnect."),CE(this,tE).emit("reconnectFailure",{attempt:CE(this,aE).getAttempts()}),ME(this,fE,vE).call(this,!1);case 25:case"end":return e.stop()}}),e,this,[[8,22]])})));return function(){return e.apply(this,arguments)}}(),mE=new WeakSet,gE=function(e){try{return CE(this,KS).send(e),!0}catch(t){return CE(this,XS).error(t.message),!1}},yE=new WeakSet,bE=function(){var e=this;this.config.disconnectOnPingTimeout&&(CE(this,XS).debug("Resetting ping timeout"),ME(this,kE,_E).call(this),ZE(this,iE,setTimeout((function(){var t;CE(e,XS).debug("Disconnecting the socket due to ping timeout"),ZE(e,nE,!0);var n="Ping timeout";null==(t=CE(e,KS))||t.close(3002,n),CE(e,tE).emit("disconnected",{code:3002,reason:n}),CE(e,YS).autoReconnect&&!CE(e,rE)&&(CE(e,XS).debug("Triggering reconnection due to ping timeout"),CE(e,tE).emit("reconnecting"),ME(e,fE,vE).call(e))}),CE(this,YS).pingTimeout)))},kE=new WeakSet,_E=function(){CE(this,iE)&&(clearTimeout(CE(this,iE)),ZE(this,iE,void 0))},wE=new WeakSet,xE=function(){CE(this,KS)&&(CE(this,KS).onopen=void 0,CE(this,KS).onerror=void 0,CE(this,KS).onmessage=void 0,CE(this,KS).onclose
2=void 0)};var nT,rT,iT,aT,oT,sT,cT=Object.defineProperty,uT=Object.getOwnPropertyDescriptor,lT=function(e,t,n,r){for(var i,a=r>1?void 0:r?uT(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&cT(t,n,a),a},dT=function(){function e(t){var n,r=t.peerId,i=t.roomName,a=t.authToken,o=t.url,s=t.capabilities;if((0,g.Z)(this,e),Ms(this,aT),Ms(this,nT,void 0),Ms(this,rT,void 0),Ms(this,iT,void 0),Cs(this,"roomName"),Cs(this,"peerId"),Cs(this,"authToken"),Cs(this,"capabilities"),!r||!i||!a)throw new Bv("peerId, roomName, or authToken can not be empty");var c=lv.apiBase.includes("staging.dyte")?"socket-staging.dyte.io":"socket-edge.dyte.io";"string"==typeof Yv("socket_server_base")&&(c=Yv("socket_server_base"));var u="wss://".concat(c);this.roomName=i,this.peerId=r,this.authToken=a,this.capabilities=s;var l=new URL("".concat(null!=o?o:u,"/ws")),p={roomID:i,peerID:r,authToken:a,useMediaV2:s.includes("HIVE"),ping:s.includes("PING"),capabilities:s.map((function(e){return ig[e]})).join(" ")};Object.entries(p).forEach((function(e){var t=(0,d.Z)(e,2),n=t[0],r=t[1];l.searchParams.append(n,r.toString())})),As(this,nT,l.href),As(this,iT,r),As(this,rT,new tT(Zs(this,nT),{autoReconnect:!0,disconnectOnPingTimeout:null!=(n=s.includes("PING"))&&n,queueOnDisconnect:!0,flushOnReconnect:!1,logger:Dv}))}return(0,y.Z)(e,[{key:"url",get:function(){return Zs(this,nT)}},{key:"connect",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=function(){Dv.info("SocketService::connect::Connected to socket-edge"),sm.emit(cm.SOCKET_SERVICE_CONNECTED)},this.onStateEvent("connected",t),n=function(e){var t=e.reason,n=e.code;Dv.info("SocketService::connect::Disconnected from socket-edge",{error:{code:n,reason:t}}),sm.emit(cm.SOCKET_SERVICE_DISCONNECTED),!(n<4e3||n>4002)&&(4e3===n?Dv.error("SocketService::connect::Bad Request",{error:{code:n,reason:t}}):4001===n?Dv.error("SocketService::connect::Unauthorized",{error:{code:n,reason:t}}):4002===n?Dv.error("SocketService::connect::Internal Error",{error:{code:n,reason:t}}):Dv.error("SocketService::connect::Unknown Error",{error:{code:n,reason:t}}))},this.onStateEvent("disconnected",n),r=function(){Dv.info("SocketService::connect::Reconnecting to socket-edge"),sm.emit(cm.SOCKET_SERVICE_RECONNECTING)},this.onStateEvent("reconnecting",r),i=function(e){var t=e.attempt;Dv.info("SocketService::connect::Attempting reconnect to socket-edge"),sm.emit(cm.SOCKET_SERVICE_RECONNECTION_ATTEMPT,{attempt:t})},this.onStateEvent("reconnectAttempt",i),a=function(e){var t=e.attempt;Dv.info("SocketService::connect::Reconnect attempt failed"),sm.emit(cm.SOCKET_SERVICE_RECONNECT_FAILURE,{attempt:t})},this.onStateEvent("reconnectFailure",a),o=function(){Dv.info("SocketService::connect::Reconnected to socket-edge"),sm.emit(cm.SOCKET_SERVICE_RECONNECTED)},this.onStateEvent("reconnected",o),s=function(){Dv.info("SocketService::connect::Socket-edge reconnects failed"),sm.emit(cm.SOCKET_SERVICE_FAILED)},this.onStateEvent("failed",s),e.next=16,Zs(this,rT).connect();case 16:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){return Zs(this,rT).disconnect()}},{key:"isConnected",get:function(){try{return 1===Zs(this,rT).readyState}catch(e){return!1}}},{key:"sendMessage",value:function(e,t,n){var r={};return Lv.injectContext(r),Zs(this,rT).send(e,null!=n?n:Is(this,aT,oT).call(this),t,(new TextEncoder).encode(JSON.stringify(r)))}},{key:"sendMessagePromise",value:function(e,t,n){var r=parseInt({}.SOCKET_SERVICE_MESSAGE_REQUEST_TIMEOUT,10)||2e4;return this.sendMessagePromiseWithTimeout({event:e,timeout:r,protobuf:t,messageId:n})}},{key:"sendMessagePromiseWithTimeout",value:function(e){var t=this,n=e.event,r=e.timeout,i=e.protobuf,a=e.messageId;return new Promise((function(e,o){var s=null!=a?a:Is(t,aT,oT).call(t),c={};Lv.injectContext(c),setTimeout(o,r,"request timeout for callback");var u=function r(i){var a=i.id,o=i.payload;s===a&&(e({id:a,payload:o}),Zs(t,rT).removeListener(n,r),Zs(t,rT).removeListener(65535,r))};Zs(t,rT).on(n,u),Zs(t,rT).on(65535,u),Zs(t,rT).send(n,s,i,(new TextEncoder).encode(JSON.stringify(c)))}))}},{key:"on",value:function(e,t){Zs(this,rT).on(e,t)}},{key:"onStateEvent",value:function(e,t){Zs(this,rT).on(e,t)}},{key:"flush",value:function(){return Zs(this,rT).flush()}}]),e}();nT=new WeakMap,rT=new WeakMap,iT=new WeakMap,aT=new WeakSet,oT=function(){return"".concat(Zs(this,iT),"-").concat((Math.random()+1).toString(36).substring(7))},lT([Lv.trace("SocketService.connect")],dT.prototype,"connect",1),lT([Lv.trace("SocketService.disconnect")],dT.prototype,"disconnect",1),lT([Lv.trace("SocketService.sendMessage")],dT.prototype,"sendMessage",1),lT([Lv.trace("SocketService.sendMessagePromise")],dT.prototype,"sendMessagePromise",1);var pT=function(){function e(t){(0,g.Z)(this,e),Ms(this,sT,void 0),As(this,sT,t)}return(0,y.Z)(e,[{key:"addPlugin",value:function(e,t){Zs(this,sT).sendMessage(ib.addPlugin,ey.toBinary({pluginId:e,staggered:t}))}},{key:"removePlugin",value:function(e){Zs(this,sT).sendMessage(ib.removePlugin,ty.toBinary({pluginId:e,staggered:!1}))}},{key:"getActivePlugins",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,sT).sendMessagePromise(ib.getPlugins);case 2:return t=e.sent,n=t.payload,e.abrupt("return",n?fy.fromBinary(n):{plugins:[]});case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"customPluginEventToRoom",value:function(e,t,n){var r={pluginId:e,pluginData:(new TextEncoder).encode(JSON.stringify(t))};Zs(this,sT).sendMessage(ib.customPluginEventToRoom,oy.toBinary(r),n)}},{key:"customPluginEventToPeers",value:function(e,t,n,r){var i={pluginId:e,peerIds:t,pluginData:(new TextEncoder).encode(JSON.stringify(n))};Zs(this,sT).sendMessage(ib.customPluginEventToPeers,sy.toBinary(i),r)}},{key:"enablePluginForRoom",value:function(e,t){Zs(this,sT).sendMessage(ib.enablePluginForRoom,ny.toBinary({pluginId:e}),t)}},{key:"enablePluginForPeers",value:function(e,t,n){Zs(this,sT).sendMessage(ib.enablePluginForPeers,iy.toBinary({pluginId:e,peerIds:t}),n)}},{key:"disablePluginForRoom",value:function(e,t){Zs(this,sT).sendMessage(ib.disablePluginForRoom,ry.toBinary({pluginId:e}),t)}},{key:"disablePluginForPeers",value:function(e,t,n){Zs(this,sT).sendMessage(ib.disablePluginForPeers,ay.toBinary({pluginId:e,peerIds:t}),n)}},{key:"storeInsertKeys",value:function(e,t,n,r){var i={pluginId:e,storeName:t,insertKeys:n.map((function(e){return{storeKey:e.key,payload:(new TextEncoder).encode(JSON.stringify(e.payload))}}))};Zs(this,sT).sendMessage(ib.storeInsertKeys,uy.toBinary(i),r)}},{key:"storeGetKeys",value:function(e,t,n,r){var i={pluginId:e,storeName:t,getKeys:n.map((function(e){return{storeKey:e.key}}))};Zs(this,sT).sendMessage(ib.storeGetKeys,ly.toBinary(i),r)}},{key:"storeDeleteKeys",value:function(e,t,n,r){var i={pluginId:e,storeName:t,deleteKeys:n.map((function(e){return{storeKey:e.key}}))};Zs(this,sT).sendMessage(ib.storeDeleteKeys,dy.toBinary(i),r)}},{key:"storeDelete",value:function(e,t,n){Zs(this,sT).sendMessage(ib.storeDelete,py.toBinary({pluginId:e,storeName:t}),n)}},{key:"getPluginDataOld",value:function(e,t){Dv.info("getPluginDataOld",{plugin:{id:e,storeName:t}})}},{key:"storePluginDataOld",value:function(e,t,n){var r={pluginId:e,storeName:t,insertKeys:[{storeKey:n.key,payload:(new TextEncoder).encode(JSON.stringify(n))}]};Zs(this,sT).sendMessage(ib.storeInsertKeys,uy.toBinary(r))}},{key:"on",value:function(e,t){var n;switch(e){case ib.addPlugin:case ib.enablePluginForPeers:case ib.enablePluginForRoom:n=hy.fromBinary.bind(hy);break;case ib.removePlugin:case ib.disablePluginForPeers:case ib.disablePluginForRoom:n=vy.fromBinary.bind(vy);break;case ib.customPluginEventToPeers:case ib.customPluginEventToRoom:n=yy.fromBinary.bind(yy);break;case ib.storeInsertKeys:case ib.storeGetKeys:case ib.storeDeleteKeys:case ib.storeDelete:n=gy.fromBinary.bind(gy)}Zs(this,sT).on(e,(function(e){var r=e.payload,i=e.id,a=n(r);return t(a,i)}))}}]),e}();sT=new WeakMap;var hT,fT,vT=Object.defineProperty,mT=Object.getOwnPropertyDescriptor,gT=function(e,t,n,r){for(var i,a=r>1?void 0:r?mT(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&vT(t,n,a),a},yT=(fT=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),hT,void 0),Cs((0,f.Z)(r),"recordingState","IDLE"),Cs((0,f.Z)(r),"recordingId"),Cs((0,f.Z)(r),"recordingPeerId"),As((0,f.Z)(r),hT,e),r}return(0,y.Z)(n,[{key:"setRecordingState",value:function(e){var t=this.recordingState;this.recordingState=e,t!==e&&this.emitCurrentRecordingState()}}
2,{key:"emitCurrentRecordingState",value:function(){this.emit("recordingUpdate",this.recordingState)}},{key:"start",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,hT).permissions.canRecord){e.next=2;break}throw Dv.error("DyteRecording::start::permission_denied"),new Bv("User does not have permission to start recording");case 2:if("STARTING"!==this.recordingState&&"RECORDING"!==this.recordingState&&"STOPPING"!==this.recordingState){e.next=4;break}throw Dv.error("DyteRecording::start::recording_in_progress",{recording:{state:this.recordingState}}),new Bv("Cant start recording, recordingState irregular: ".concat(this.recordingState));case 4:return this.setRecordingState("STARTING"),e.prev=5,t=Xy(),n=lv.defaults.recording,r=void 0===n?{}:n,e.next=11,t.startRecording(r);case 11:i=e.sent,this.recordingId=i,e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(5),Dv.error("DyteRecording::stop::recording_failed_to_start",{error:e.t0}),this.setRecordingState("IDLE"),new Bv("Error while starting recording");case 18:case"end":return e.stop()}}),e,this,[[5,15]])})));return function(){return e.apply(this,arguments)}}()},{key:"stop",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,hT).permissions.canRecord){e.next=2;break}throw Dv.error("DyteRecording::stop::permission_denied"),new Bv("User does not have permission to stop recording");case 2:if(e.t0="RECORDING"!==this.recordingState||!this.recordingId,!e.t0){e.next=7;break}return Dv.error("DyteRecording::stop::recording_not_in_progress",{recording:{state:this.recordingState,id:this.recordingId}}),e.next=7,this.getRecordingId();case 7:if("RECORDING"===this.recordingState&&this.recordingId){e.next=9;break}throw Dv.error("DyteRecording::stop::recording_not_in_progress",{recording:{state:this.recordingState,id:this.recordingId}}),new Bv("Cant stop recording, recordingState irregular: ".concat(this.recordingState));case 9:return this.setRecordingState("STOPPING"),e.prev=10,e.next=13,Xy().stopRecording(this.recordingId);case 13:this.setRecordingState("IDLE"),e.next=19;break;case 16:throw e.prev=16,e.t1=e.catch(10),Dv.error("DyteRecording::stop::recording_failed_to_stop",{error:e.t1}),this.setRecordingState("RECORDING"),new Bv("Error while stopping recording");case 19:case"end":return e.stop()}}),e,this,[[10,16]])})));return function(){return e.apply(this,arguments)}}()},{key:"getRecordingId",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,hT).permissions.canRecord){e.next=2;break}throw Dv.error("DyteRecording::getRecordingId::permission_denied"),new Bv("User does not have permission to stop recording");case 2:return e.prev=2,t=Xy(),e.next=6,t.getActiveRecording();case 6:n=e.sent,r=n.status,i=n.id,"RECORDING"===r&&(this.recordingState="RECORDING",this.recordingId=i),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(2),Dv.error("DyteRecording::getRecordingId::unable_to_get_recording_id",{error:e.t0}),new Bv("Unable to get recording");case 15:case"end":return e.stop()}}),e,this,[[2,12]])})));return function(){return e.apply(this,arguments)}}()}]),n}(ek),hT=new WeakMap,fT);gT([Lv.trace("DyteRecording.start")],yT.prototype,"start",1),gT([Lv.trace("DyteRecording.stop")],yT.prototype,"stop",1),gT([Lv.trace("DyteRecording.getRecordingId")],yT.prototype,"getRecordingId",1),yT=gT([zv((function(e){throw new Bv(e.message,"1000")}))],yT);var bT=Object.defineProperty,kT=Object.getOwnPropertyDescriptor,_T=function(){function e(t){(0,g.Z)(this,e),Cs(this,"recording"),this.recording=new yT(t),this.setupEvents()}return(0,y.Z)(e,[{key:"setupEvents",value:function(){var e=this;sm.on(cm.HIVE_RECORDING_STARTED,(function(t){e.recording.recordingPeerId=t,e.recording.setRecordingState("RECORDING")})),sm.on(cm.HIVE_RECORDING_STOPPED,(function(){e.recording.recordingPeerId=void 0,e.recording.setRecordingState("IDLE")})),sm.on(cm.PEER_JOINED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!=(r=n.flags)&&r.recorder&&(e.recording.recordingPeerId=n.id,e.recording.setRecordingState("RECORDING"));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.PEER_CLOSED,(function(t){t.id===e.recording.recordingPeerId&&(e.recording.recordingPeerId=void 0,e.recording.setRecordingState("IDLE"))})),sm.onAsync(cm.ROOM_JOINED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i,a;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Dv.debug("[ROOM_JOINED] resolved request to fetch recordings."),(a=null==(r=n.peers)?void 0:r.filter((function(e){var t;return!(null==(t=e.flags)||!t.recorder)}))).length?(e.recording.recordingPeerId=a&&(null==(i=a[0])?void 0:i.id),e.recording.setRecordingState("RECORDING")):(e.recording.recordingPeerId=void 0,e.recording.setRecordingState("IDLE"));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.RECORDING_STARTED,(function(){e.recording.setRecordingState("RECORDING")})),sm.on(cm.RECORDING_STOPPED,(function(){e.recording.recordingId=void 0,e.recording.recordingPeerId=void 0,e.recording.setRecordingState("IDLE")}))}}]),e}();!function(e,t,n,r){for(var i,a=r>1?void 0:r?kT(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&bT(t,n,a)}([Lv.trace("RecordingController.setupEvents")],_T.prototype,"setupEvents",1);var wT,xT,ST,ET,TT=Object.defineProperty,PT=Object.getOwnPropertyDescriptor,CT=function(e){return e[e.User=0]="User",e[e.Spotlight=1]="Spotlight",e}(CT||{}),RT=(ET=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),wT),Cs((0,f.Z)(r),"selfActiveTab"),Cs((0,f.Z)(r),"spotlighted"),Ms((0,f.Z)(r),ST,void 0),r.spotlighted=e.permissions.canSpotlight,As((0,f.Z)(r),ST,e),r}return(0,y.Z)(n,[{key:"roomJoined",get:function(){var e;return!0===(null==(e=Zs(this,wT,xT))?void 0:e.roomJoined)}},{key:"setSpotlighted",value:function(e){if(!Zs(this,ST).permissions.canSpotlight)throw Dv.error("DyteSpotlight::setSpotlighted::permission_denied"),new Bv("User does not have permission to toggle spotlight");
2this.spotlighted=e,this.emit("spotlightUpdate",this.spotlighted),this.spotlighted&&this.assertSpotlightToRoom()}},{key:"setSelfActiveTab",value:function(e,t){var n;Dv.info("DyteSpotlight::setActiveTab",{spotlight:{currentTab:{id:e.id,type:e.type}}}),this.selfActiveTab=e,0===t&&this.emit("selfTabUpdate",e),null!=(n=Zs(this,ST).permissions)&&n.canSpotlight&&this.spotlighted&&0===t&&this.assertSpotlightToRoom()}},{key:"assertSpotlightToRoom",value:function(){Zs(this,wT,xT)instanceof gk&&this.selfActiveTab&&Zs(this,wT,xT).assertSpotlightToRoom({spotlightedUserId:Zs(this,ST).userId,currentTab:this.selfActiveTab,peerId:void 0})}}],[{key:"init",value:function(e){return new RT(e)}}]),n}(ek),wT=new WeakSet,xT=function(){return Sk()},ST=new WeakMap,ET);RT=function(e,t,n,r){for(var i,a=r>1?void 0:r?PT(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&TT(t,n,a),a}([zv((function(e){throw new Bv(e.message,"1300")}))],RT);var ZT,MT,AT,IT=Object.defineProperty,OT=Object.getOwnPropertyDescriptor,LT=function(){function e(t){(0,g.Z)(this,e),Ms(this,MT),Cs(this,"spotlight"),Ms(this,ZT,void 0),this.spotlight=RT.init(t),As(this,ZT,t),this.setupEvents()}return(0,y.Z)(e,[{key:"conditionallySetActiveTab",value:function(e){var t;null!=e&&e.currentTab&&(null==(t=this.spotlight.selfActiveTab)?void 0:t.id)!==e.currentTab.id&&(this.spotlight.setSelfActiveTab(e.currentTab,CT.Spotlight),this.spotlight.emit("activeTabUpdate",e.currentTab))}},{key:"setupEvents",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Zs(this,ZT).permissions.canSpotlight&&(Dv.info("DyteSpotlightController::Asserting Spotlight"),Zs(this,MT,AT)instanceof gk&&this.spotlight.selfActiveTab&&Zs(this,MT,AT).assertSpotlightToRoom({spotlightedUserId:Zs(this,ZT).userId,currentTab:this.spotlight.selfActiveTab,peerId:void 0})),sm.on(cm.PEER_JOINED,function(){var e=(0,h.Z)((0,p.Z)().mark((function e(n){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Zs(t,ZT).permissions.canSpotlight&&Zs(t,MT,AT)instanceof gk&&t.spotlight.selfActiveTab&&Zs(t,MT,AT).assertSpotlightToPeer({spotlightedUserId:Zs(t,ZT).userId,currentTab:t.spotlight.selfActiveTab,peerId:n.id});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),sm.on(cm.ROOM_MESSAGE,(function(e){var n,r;"spotlight"===e.roomMessageType&&(Dv.info("Spotlight Assertion Received",{spotlight:{spotlighter:{id:e.spotlightedUserId},currentTab:{id:null==(n=e.currentTab)?void 0:n.id,type:null==(r=e.currentTab)?void 0:r.type}}}),t.conditionallySetActiveTab(e))})),sm.on(cm.MESSAGE,(function(e){var n,r;"spotlight"===e.roomMessageType&&(Dv.info("Spotlight Assertion Received",{spotlight:{spotlighter:{id:e.spotlightedUserId},currentTab:{id:null==(n=e.currentTab)?void 0:n.id,type:null==(r=e.currentTab)?void 0:r.type}}}),t.conditionallySetActiveTab(e))}));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}();function DT(e){var t,n=0;if(!e)return n;for(t=0;t<e.length;t+=1)n=(n<<5)-n+e.charCodeAt(t),n|=0;return Math.abs(n)%100+1}ZT=new WeakMap,MT=new WeakSet,AT=function(){return Sk()},function(e,t,n,r){for(var i,a=r>1?void 0:r?OT(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&IT(t,n,a)}([Lv.trace("SpotlightController.setupEvents")],LT.prototype,"setupEvents",1);var NT,jT=function(){function e(){(0,g.Z)(this,e)}return(0,y.Z)(e,null,[{key:"hasFeature",value:function(e){var t;return null!=(t=jc.hasFeature(e))&&t}},{key:"getFeatureValue",value:function(e){return jc.getValue(e)}},{key:"getAllFeatures",value:function(){return jc.getAllFlags()}}]),e}(),BT=function(){function e(t,n,r){(0,g.Z)(this,e),Cs(this,"logger"),Cs(this,"features"),Cs(this,"browserSpecs"),Cs(this,"callStats"),this.logger=t,this.features=n,this.browserSpecs=ff,this.callStats=r}return(0,y.Z)(e,null,[{key:"init",value:function(){return new e(Dv,jT,Ic)}}]),e}(),UT=function(){function e(t){(0,g.Z)(this,e),Cs(this,"internals"),this.internals=t}return(0,y.Z)(e,null,[{key:"init",value:function(){var t=(0,h.Z)((0,p.Z)().mark((function t(){var n;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=BT.init(),t.abrupt("return",new e(n));case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}]),e}(),VT=Object.defineProperty,FT=Object.getOwnPropertyDescriptor,zT=function(e,t,n,r){for(var i,a=r>1?void 0:r?FT(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&VT(t,n,a),a},HT=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),NT,void 0),Cs((0,f.Z)(r),"state","IDLE"),Cs((0,f.Z)(r),"playbackUrl"),Cs((0,f.Z)(r),"viewerCount"),As((0,f.Z)(r),NT,e),r.viewerCount=0,r}return(0,y.Z)(n,[{key:"setLivestreamState",value:function(e){var t=this.state;this.state=e,t!==e&&this.emitCurrentLivestreamState()}}
2,{key:"emitCurrentLivestreamState",value:function(){this.emit("livestreamUpdate",this.state)}},{key:"start",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,NT).permissions.canLivestream){e.next=2;break}throw Dv.error("DyteLivestream::start::permission_denied"),new Bv("User does not have permission to start livestreaming");case 2:return this.setLivestreamState("STARTING"),e.prev=3,e.next=6,Xy().startLivestreaming();case 6:t=e.sent,this.playbackUrl=t,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(3),Dv.error("DyteRecording::stop::livestream_failed_to_start",{error:e.t0}),this.setLivestreamState("IDLE"),new Bv("Error while starting livestream");case 13:case"end":return e.stop()}}),e,this,[[3,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"stop",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,NT).permissions.canLivestream){e.next=2;break}throw Dv.error("DyteLivestream::stop::permission_denied"),new Bv("User does not have permission to stop livestreaming");case 2:if("LIVESTREAMING"===this.state){e.next=4;break}throw Dv.error("DyteLivestream::stop::inconsistent_state"),new Bv("Livestream not started yet");case 4:return e.prev=4,this.setLivestreamState("STOPPING"),e.next=8,Xy().stopLivestreaming();case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(4),Dv.error("DyteLivestream::stop::livestream_failed_to_stop",{error:e.t0}),this.setLivestreamState("STOPPING"),new Bv("Error while stopping livestream");case 13:case"end":return e.stop()}}),e,this,[[4,10]])})));return function(){return e.apply(this,arguments)}}()}]),n}(ek);NT=new WeakMap,zT([Lv.trace("livestream.start")],HT.prototype,"start",1),zT([Lv.trace("livestream.stop")],HT.prototype,"stop",1);var qT,GT,WT=Object.defineProperty,JT=Object.getOwnPropertyDescriptor,$T=function(){function e(t,n){(0,g.Z)(this,e),Cs(this,"livestream"),Ms(this,qT,void 0),Ms(this,GT,void 0),this.livestream=new HT(t),As(this,GT,n),this.setupEvents()}return(0,y.Z)(e,[{key:"fetchInitialLivestreamingState",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n,r,i;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Xy(),e.next=3,t.getActiveLivestream();case 3:n=e.sent,r=n.status,i=n.playbackUrl,"LIVE"===r&&(this.livestream.playbackUrl=i,this.livestream.setLivestreamState("LIVESTREAMING"));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setupEvents",value:function(){var e=this;Zs(this,GT).on(nb.startedLivestream,(function(t){e.livestream.playbackUrl=t.playbackUrl,e.livestream.setLivestreamState("LIVESTREAMING")})),Zs(this,GT).on(nb.stoppedLivestream,(function(){e.livestream.setLivestreamState("IDLE"),e.livestream.playbackUrl=void 0})),Zs(this,GT).on(nb.erroredLivestream,(function(){e.livestream.setLivestreamState("IDLE"),e.livestream.playbackUrl=void 0})),Zs(this,GT).on(nb.roomPeerCount,(function(t){e.livestream.viewerCount=t.count,e.livestream.emit("viewerCountUpdate",t.count)})),sm.on(cm.PEER_JOINED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:!0===(null==(r=n.flags)?void 0:r.hiddenParticipant)&&"LIVESTREAMER"===n.recorderType&&(As(e,qT,n.id),e.livestream.setLivestreamState("LIVESTREAMING"));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.on(cm.PEER_CLOSED,(function(t){t.id===Zs(e,qT)&&(As(e,qT,void 0),e.livestream.setLivestreamState("IDLE"))})),sm.onAsync(cm.ROOM_JOINED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i,a;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Dv.debug("[ROOM_JOINED] resolved request to fetch livestream."),(a=null==(r=n.peers)?void 0:r.filter((function(e){var t;return!(null==(t=e.flags)||!t.hiddenParticipant)}))).length?(As(e,qT,a&&(null==(i=a[0])?void 0:i.id)),e.livestream.setLivestreamState("LIVESTREAMING")):(As(e,qT,void 0),e.livestream.setLivestreamState("IDLE"));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),sm.onAsync(cm.LEAVE_MEDIA_ROOM,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.livestream.playbackUrl){t.next=9;break}return Dv.info("Fetching livestreaming state on leave stage"),t.prev=2,t.next=5,e.fetchInitialLivestreamingState();case 5:t.next=9;break;case 7:t.prev=7,t.t0=t.catch(2);case 9:case"end":return t.stop()}}),t,null,[[2,7]])})))),sm.onAsync(cm.SOCKET_SERVICE_ROOM_JOINED,(0,h.Z)((0,p.Z)().mark((function t(){return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.fetchInitialLivestreamingState();case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])}))))}}]),e}();
2qT=new WeakMap,GT=new WeakMap,function(e,t,n,r){for(var i,a=r>1?void 0:r?JT(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&WT(t,n,a)}([Lv.trace("LivestreamController.setupEvents")],$T.prototype,"setupEvents",1);var KT,QT=xf(sp().permissions),YT=function(){function e(t){if((0,g.Z)(this,e),Ms(this,KT,void 0),!t)throw Dv.error("DytePermissionsPreset::load_preset_permissions_failed"),new Bv("Could not load preset permissions.");As(this,KT,t)}return(0,y.Z)(e,[{key:"acceptWaitingRequests",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.acceptWaitingRequests)?t:QT.acceptWaitingRequests}},{key:"requestProduceVideo",get:function(){var e,t,n;return(null==(n=null==(t=null==(e=Zs(this,KT))?void 0:e.media)?void 0:t.video)?void 0:n.canProduce)===Yd.CanRequest}},{key:"requestProduceAudio",get:function(){var e,t,n;return(null==(n=null==(t=null==(e=Zs(this,KT))?void 0:e.media)?void 0:t.audio)?void 0:n.canProduce)===Yd.CanRequest}},{key:"requestProduceScreenshare",get:function(){var e,t,n;return(null==(n=null==(t=null==(e=Zs(this,KT))?void 0:e.media)?void 0:t.screenshare)?void 0:n.canProduce)===Yd.CanRequest}},{key:"canAllowParticipantAudio",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.canAcceptProductionRequests)?t:QT.canAcceptProductionRequests}},{key:"canAllowParticipantScreensharing",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.canAcceptProductionRequests)?t:QT.canAcceptProductionRequests}},{key:"canAllowParticipantVideo",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.canAcceptProductionRequests)?t:QT.canAcceptProductionRequests}},{key:"canDisableParticipantAudio",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.disableParticipantAudio)?t:QT.disableParticipantAudio}},{key:"canDisableParticipantVideo",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.disableParticipantVideo)?t:QT.disableParticipantVideo}},{key:"kickParticipant",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.kickParticipant)?t:QT.kickParticipant}},{key:"pinParticipant",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.pinParticipant)?t:QT.pinParticipant}},{key:"canRecord",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.canRecord)?t:QT.canRecord}},{key:"waitingRoomType",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.waitingRoomType)?t:QT.waitingRoomType}},{key:"waitingRoomBehaviour",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.waitingRoomType)?t:QT.waitingRoomType}},{key:"plugins",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.plugins)?t:QT.plugins}},{key:"polls",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.polls)?t:QT.polls}},{key:"produceVideo",get:function(){var e,t,n,r;return null!=(r=null==(n=null==(t=null==(e=Zs(this,KT))?void 0:e.media)?void 0:t.video)?void 0:n.canProduce)?r:QT.media.video.canProduce}},{key:"requestProduce",get:function(){return Zs(this,KT).media.audio.canProduce===Yd.CanRequest||Zs(this,KT).media.video.canProduce===Yd.CanRequest||Zs(this,KT).media.screenshare.canProduce===Yd.CanRequest}},{key:"canProduceVideo",get:function(){var e,t,n,r;return null!=(r=null==(n=null==(t=null==(e=Zs(this,KT))?void 0:e.media)?void 0:t.video)?void 0:n.canProduce)?r:QT.media.video.canProduce}},{key:"produceScreenshare",get:function(){var e,t,n,r;return null!=(r=null==(n=null==(t=null==(e=Zs(this,KT))?void 0:e.media)?void 0:t.screenshare)?void 0:n.canProduce)?r:QT.media.screenshare.canProduce}},{key:"canProduceScreenshare",get:function(){var e,t,n,r;return null!=(r=null==(n=null==(t=null==(e=Zs(this,KT))?void 0:e.media)?void 0:t.screenshare)?void 0:n.canProduce)?r:QT.media.screenshare.canProduce}},{key:"produceAudio",get:function(){var e;return null!=(e=Zs(this,KT).media.audio.canProduce)?e:QT.media.audio.canProduce}},{key:"canProduceAudio",get:function(){var e;return null!=(e=Zs(this,KT).media.audio.canProduce)?e:QT.media.audio.canProduce}},{key:"chatPublic",get:function(){var e,t,n;return null!=(n=null==(t=null==(e=Zs(this,KT))?void 0:e.chat)?void 0:t.public)?n:QT.chat.public}},{key:"chatPrivate",get:function(){var e,t,n;return null!=(n=null==(t=null==(e=Zs(this,KT))?void 0:e.chat)?void 0:t.private)?n:QT.chat.private}},{key:"connectedMeetings",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.connectedMeetings)?t:null==QT?void 0:QT.connectedMeetings}},{key:"hiddenParticipant",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.hiddenParticipant)?t:QT.hiddenParticipant}},{key:"showParticipantList",get:function(){var e;return null!=(e=Zs(this,KT).showParticipantList)?e:QT.showParticipantList}},{key:"canChangeParticipantRole",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.canChangeParticipantPermissions)?t:QT.canChangeParticipantPermissions}},{key:"canChangeParticipantPermissions",get:function(){var e,t;return null!=(t=null==(e=Zs(this,KT))?void 0:e.canChangeParticipantPermissions)?t:QT.canChangeParticipantPermissions}},{key:"canChangeTheme",get:function(){return!1}},{key:"canPresent",get:function(){return Zs(this,KT).media.audio.canProduce===Yd.Allowed||Zs(this,KT).media.video.canProduce===Yd.Allowed||Zs(this,KT).media.screenshare.canProduce===Yd.Allowed}},{key:"acceptPresentRequests",get:function(){return Zs(this,KT).canAcceptProductionRequests}},{key:"canEditDisplayName",get:function(){var e;return null!=(e=Zs(this,KT).canEditDisplayName)&&e}},{key:"maxScreenShareCount",get:function(){return 1}},{key:"isRecorder",get:function(){return Zs(this,KT).isRecorder}},{key:"canSpotlight",get:function(){return Zs(this,KT).canSpotlight}},{key:"canLivestream",get:function(){return Zs(this,KT).canLivestream}},{key:"isV2",get:function(){return!0}}],[{key:"fromResponse",value:function(t){return new e(t)}},{key:"default",value:function(){return new e(QT)}}]),e}(),XT=YT;KT=new WeakMap;var eP,tP,nP,rP=xf(sp()),iP=function(){function e(t){if((0,g.Z)(this,e),Ms(this,eP,void 0),Ms(this,tP,void 0),Ms(this,nP,void 0),!t)throw new Bv("Could not load preset.");As(this,eP,t.config),As(this,tP,t.ui||xf(sp().ui)),As(this,nP,t.permissions.plugins.config)}return(0,y.Z)(e,[{key:"setupScreen",get:function(){return{isEnabled:!0}}},{key:"waitingRoom",get:function(){return{isEnabled:!0}}},{key:"controlBar",get:function(){return{isEnabled:!0,elements:{chat:!0,fullscreen:!0,invite:!1,layout:!1,participants:!0,plugins:!0,polls:!0,reactions:!1,screenshare:!0}}}},{key:"header",get:function(){return{isEnabled:!0,elements:{logo:Zs(this,tP).designTokens.logo,timer:!0,title:!0,participantCount:!0,changeLayout:!1}}}},{key:"pipMode",get:function(){return!0}}
2,{key:"viewType",get:function(){return Zs(this,eP).viewType}},{key:"maxVideoStreams",get:function(){return Zs(this,eP).maxVideoStreams}},{key:"maxScreenShareCount",get:function(){return Zs(this,eP).maxScreenshareCount}},{key:"plugins",get:function(){return[]}},{key:"disabledPlugins",get:function(){var e=this;return Object.keys(Zs(this,nP)).filter((function(t){return Zs(e,nP)[t].disabled}))}},{key:"designTokens",get:function(){return Zs(this,tP).designTokens}},{key:"configDiff",get:function(){return Zs(this,tP).configDiff}},{key:"mediaConstraints",get:function(){var e,t,n,r,i,a,o,s,c,u,l,d,p,h,f,v;return{video:{quality:null!=(r=null==(n=null==(t=null==(e=Zs(this,eP))?void 0:e.media)?void 0:t.video)?void 0:n.quality)?r:fv.video.quality,frameRate:null!=(s=null==(o=null==(a=null==(i=Zs(this,eP))?void 0:i.media)?void 0:a.video)?void 0:o.frameRate)?s:fv.video.frameRate},screenshare:{quality:null!=(d=null==(l=null==(u=null==(c=Zs(this,eP))?void 0:c.media)?void 0:u.screenshare)?void 0:l.quality)?d:fv.screenshare.quality,frameRate:null!=(v=null==(f=null==(h=null==(p=Zs(this,eP))?void 0:p.media)?void 0:h.screenshare)?void 0:f.frameRate)?v:fv.screenshare.frameRate}}}},{key:"isV2",get:function(){return!0}}],[{key:"fromResponse",value:function(t){return new e(t)}},{key:"default",value:function(){return new e(rP)}}]),e}(),aP=iP;eP=new WeakMap,tP=new WeakMap,nP=new WeakMap;var oP,sP,cP,uP,lP,dP,pP=xf({setup_screen:{is_enabled:!1},alone_here:{is_enabled:!1},waiting_room:{is_enabled:!1,enable_preview:!0},control_bar:{is_enabled:!0,elements:{plugins:!0,screenshare:!0,invite:!1,participants:!0,chat:!0,reactions:!1,polls:!0,fullscreen:!0,layout:!0}},header:{is_enabled:!0,elements:{logo:"",timer:!0,title:!0,participant_count:!0,change_layout:!0}},pip_mode:!0,auto_tune:!0,grid:{multi:{max_video_count:9,video_fit:"cover"},single:{max_video_count:6,video_fit:"cover"},default_view:"MULTI"},colors:{primary:"#2160FD",secondary:"#1A1A1A",text:"#EEEEEE",background:"#1A1A1A",text_primary:"#EEEEEE",video_background:"#1A1A1A"},controls:{pip_toggle:!1},plugins:[]}),hP=function(){function e(t){if((0,g.Z)(this,e),Ms(this,oP,void 0),Ms(this,sP,void 0),Ms(this,cP,void 0),Ms(this,uP,void 0),Ms(this,lP,[]),!t)throw new Bv("Could not load preset theme.");As(this,oP,t),As(this,sP,1),As(this,cP,Kd.GroupCall)}return(0,y.Z)(e,[{key:"configFromPermissions",value:function(e){var t,n,r,i,a,o,s,c,u,l,d,p;As(this,sP,e.maxScreenshareCount||1),As(this,cP,e.viewType),As(this,uP,{video:{quality:null!=(r=null==(n=null==(t=null==e?void 0:e.produce)?void 0:t.video)?void 0:n.quality)?r:fv.video.quality,frameRate:null!=(o=null==(a=null==(i=null==e?void 0:e.produce)?void 0:i.video)?void 0:a.frameRate)?o:fv.video.frameRate},screenshare:{quality:null!=(u=null==(c=null==(s=null==e?void 0:e.produce)?void 0:s.screenshare)?void 0:c.quality)?u:fv.screenshare.quality,frameRate:null!=(p=null==(d=null==(l=null==e?void 0:e.produce)?void 0:l.screenshare)?void 0:d.frameRate)?p:fv.screenshare.frameRate}})}},{key:"setDisabledPlugins",value:function(e){var t=Zs(this,oP).plugins;t&&t.length>0&&As(this,lP,e.filter((function(e){return!t.includes(e)})))}},{key:"setupScreen",get:function(){return Zs(this,oP).setupScreen}},{key:"aloneHere",get:function(){return Zs(this,oP).aloneHere}},{key:"waitingRoom",get:function(){return Zs(this,oP).waitingRoom}},{key:"controlBar",get:function(){return Zs(this,oP).controlBar}},{key:"header",get:function(){return Zs(this,oP).header}},{key:"pipMode",get:function(){var e;return(null==(e=Zs(this,oP).controls)?void 0:e.pipToggle)||Zs(this,oP).pipMode}},{key:"viewType",get:function(){return Zs(this,cP)}},{key:"autoTune",get:function(){return Zs(this,oP).autoTune}},{key:"grid",get:function(){return Zs(this,oP).grid}},{key:"maxVideoStreams",get:function(){return{mobile:this.grid.multi.maxVideoCount>6?6:this.grid.multi.maxVideoCount,desktop:this.grid.multi.maxVideoCount}}},{key:"maxScreenShareCount",get:function(){return Zs(this,sP)}},{key:"colors",get:function(){return Zs(this,oP).colors}},{key:"controls",get:function(){return Zs(this,oP).controls}},{key:"plugins",get:function(){return Zs(this,oP).plugins}},{key:"disabledPlugins",get:function(){return Zs(this,lP)}},{key:"mediaConstraints",get:function(){return Zs(this,uP)}},{key:"isV2",get:function(){return!1}}],[{key:"fromResponse",value:function(t){return new e(t)}},{key:"default",value:function(){return new e(pP)}}]),e}(),fP=hP;oP=new WeakMap,sP=new WeakMap,cP=new WeakMap,uP=new WeakMap,lP=new WeakMap;var vP,mP=function(){function e(t){(0,g.Z)(this,e),Ms(this,dP,void 0),As(this,dP,t)}return(0,y.Z)(e,[{key:"on",value:function(e,t){var n;n=e===nb.roomPeerCount?Zg.fromBinary.bind(Zg):by.fromBinary.bind(by),Zs(this,dP).on(e,(function(e){var r=e.payload,i=n(r);return t(i)}))}}]),e}();dP=new WeakMap;var gP=function(){function e(t){(0,g.Z)(this,e),Ms(this,vP,void 0),As(this,vP,t)}return(0,y.Z)(e,[{key:"getStageRequests",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Zs(this,vP).sendMessagePromise(nb.getStageRequests);case 2:return t=e.sent,n=t.payload,e.abrupt("return",n?wy.fromBinary(n):{stageRequests:[]});case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"requestAccess",value:function(){Zs(this,vP).sendMessage(nb.requestStageAccess)}},{key:"cancelRequestAccess",value:function(){Zs(this,vP).sendMessage(nb.cancelStageRequest)}},{key:"grantAccess",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={userIds:t},e.next=3,Zs(this,vP).sendMessagePromise(nb.grantStageAccess,xy.toBinary(n));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"denyAccess",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={userIds:t},e.next=3,Zs(this,vP).sendMessagePromise(nb.denyStageAccess,Sy.toBinary(n));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"joinStage",value:function(){return Zs(this,vP).sendMessage(nb.joinStage)}},{key:"leaveStage",value:function(e){var t={userIds:[e]};return Zs(this,vP).sendMessage(nb.leaveStage,Ey.toBinary(t))}},{key:"kick",value:function(e){var t={userIds:e};return Zs(this,vP).sendMessagePromise(nb.leaveStage,Ey.toBinary(t))}},{key:"on",value:function(e,t){var n;switch(e){case nb.grantStageAccess:case nb.denyStageAccess:n=void 0;break;case nb.getStagePeers:n=ky.fromBinary.bind(ky);break;case nb.getStageRequests:case nb.requestStageAccess:case nb.cancelStageRequest:n=wy.fromBinary.bind(wy)}Zs(this,vP).on(e,(function(e){var r=e.payload,i=e.id;if(!r||!n)return t(void 0,i);var a=n(r);return t(a,i)}))}}]),e}();vP=new WeakMap;var yP,bP,kP,_P=Object.defineProperty,wP=Object.getOwnPropertyDescriptor,xP=function(e,t,n,r){for(var i,a=r>1?void 0:r?wP(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&_P(t,n,a),a},SP=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);
2function n(e,r,i){var a;return(0,g.Z)(this,n),a=t.call(this),Ms((0,f.Z)(a),yP,void 0),Ms((0,f.Z)(a),bP,void 0),Ms((0,f.Z)(a),kP,void 0),Cs((0,f.Z)(a),"status"),As((0,f.Z)(a),yP,i),As((0,f.Z)(a),kP,r),As((0,f.Z)(a),bP,e),a}return(0,y.Z)(n,[{key:"getAccessRequests",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,bP)){e.next=2;break}throw new Bv("You do not have permissions for getStageRequests");case 2:return e.next=4,Zs(this,yP).getStageRequests();case 4:return t=e.sent,n=t.stageRequests,e.abrupt("return",{stageRequests:n});case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"requestAccess",value:function(){if("OFF_STAGE"!==this.status)throw new Bv("Unable to request access you are currently ".concat(this.status));Zs(this,bP)?this.setStatus("ACCEPTED_TO_JOIN_STAGE"):(Zs(this,yP).requestAccess(),this.setStatus("REQUESTED_TO_JOIN_STAGE"))}},{key:"cancelRequestAccess",value:function(){Zs(this,yP).cancelRequestAccess(),this.setStatus("OFF_STAGE")}},{key:"grantAccess",value:function(e){if(!Zs(this,bP))throw new Bv("You do not have permissions for grantAccess");return Zs(this,yP).grantAccess(e)}},{key:"denyAccess",value:function(e){if(!Zs(this,bP))throw new Bv("You do not have permissions for denyAccess");return Zs(this,yP).denyAccess(e)}},{key:"join",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,bP)||"ACCEPTED_TO_JOIN_STAGE"===this.status){e.next=2;break}throw new Bv("Unable to join stage you are currently ".concat(this.status));case 2:if(!Zs(this,bP)||"ON_STAGE"!==this.status){e.next=4;break}throw new Bv("You are already on stage.");case 4:return Zs(this,yP).joinStage(),e.next=7,sm.emitAsync(cm.JOIN_MEDIA_ROOM);case 7:this.setStatus("ON_STAGE");case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"leave",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ON_STAGE"===this.status||"ACCEPTED_TO_JOIN_STAGE"===this.status){e.next=2;break}throw new Bv("Unable to leave stage you are currently ".concat(this.status));case 2:if(this.setStatus("OFF_STAGE"),e.t0=null!=(t=Sk())&&t.roomJoined,!e.t0){e.next=7;break}return e.next=7,sm.emitAsync(cm.LEAVE_MEDIA_ROOM);case 7:return e.prev=7,e.next=10,Zs(this,kP).disableScreenShare();case 10:return e.next=12,Zs(this,kP).disableVideo();case 12:return e.next=14,Zs(this,kP).disableAudio();case 14:Zs(this,kP).destructMediaHandler(),e.next=20;break;case 17:e.prev=17,e.t1=e.catch(7),Dv.error("DyteStage.leaveStage.DisableMediaError",{error:e.t1});case 20:Zs(this,yP).leaveStage(Zs(this,kP).userId);case 21:case"end":return e.stop()}}),e,this,[[7,17]])})));return function(){return e.apply(this,arguments)}}()},{key:"kick",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Zs(this,bP)){e.next=2;break}throw new Bv("You do not have permissions for kick");case 2:return e.abrupt("return",Zs(this,yP).kick(t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setStatus",value:function(e){this.status!==e&&(this.status=e,this.emit("stageStatusUpdate",e))}}]),n}(ek);yP=new WeakMap,bP=new WeakMap,kP=new WeakMap,xP([Lv.trace("DyteStage.getStageRequests")],SP.prototype,"getAccessRequests",1),xP([Lv.trace("DyteStage.requestAccess")],SP.prototype,"requestAccess",1),xP([Lv.trace("DyteStage.cancelRequestAccess")],SP.prototype,"cancelRequestAccess",1),xP([Lv.trace("DyteStage.grantAccess")],SP.prototype,"grantAccess",1),xP([Lv.trace("DyteStage.denyAccess")],SP.prototype,"denyAccess",1),xP([Lv.trace("DyteStage.joinStage")],SP.prototype,"join",1),xP([Lv.trace("DyteStage.leaveStage")],SP.prototype,"leave",1);var EP,TP,PP,CP,RP=Object.defineProperty,ZP=Object.getOwnPropertyDescriptor,MP=function(){function e(t,n,r){(0,g.Z)(this,e),Cs(this,"stage"),Ms(this,EP,void 0),Ms(this,TP,void 0),Ms(this,PP,void 0),Ms(this,CP,0),this.stage=new SP(n,r,t),As(this,PP,t),As(this,EP,n),As(this,TP,r),this.setupEvents()}return(0,y.Z)(e,[{key:"setupEvents",value:function(){var e=this;Zs(this,PP).on(nb.grantStageAccess,(function(){Zs(e,EP)||(e.stage.emit("stageRequestApproved"),e.setStageStatus("ACCEPTED_TO_JOIN_STAGE"))})),Zs(this,PP).on(nb.denyStageAccess,(function(){Zs(e,EP)||(e.stage.emit("stageRequestRejected"),e.setStageStatus("OFF_STAGE"))})),Zs(this,PP).on(nb.getStagePeers,(function(t){"ON_STAGE"===e.stage.status&&!t.stagePeers.includes(Zs(e,TP).userId)&&sm.emitAsync(cm.LEAVE_MEDIA_ROOM)})),Zs(this,PP).on(nb.getStageRequests,(function(t){var n;if(Zs(e,EP)){var r=null!=(n=null==t?void 0:t.stageRequests)?n:[];Zs(e,CP)<r.length&&r.length>0&&e.stage.emit("newStageRequest",{count:r.length}),As(e,CP,r.length),e.stage.emit("stageAccessRequestUpdate",r)}})),sm.onAsync(cm.SOCKET_SERVICE_ROOM_JOINED,function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=null==(r=n.peer)?void 0:r.stageType,t.next=t.t0===rg.OFF_STAGE?3:t.t0===rg.ON_STAGE?5:t.t0===rg.APPROVED_STAGE?11:t.t0===rg.REQUESTED_STAGE?13:15;break;case 3:return e.setStageStatus("OFF_STAGE"),t.abrupt("break",16);
2case 5:if(t.t1="LIVESTREAM"===Zs(e,TP).config.viewType,!t.t1){t.next=9;break}return t.next=9,sm.emitAsync(cm.JOIN_MEDIA_ROOM);case 9:return e.setStageStatus("ON_STAGE"),t.abrupt("break",16);case 11:return e.stage.emit("stageRequestApproved"),e.setStageStatus("ACCEPTED_TO_JOIN_STAGE"),t.abrupt("break",16);case 13:return e.setStageStatus("REQUESTED_TO_JOIN_STAGE"),t.abrupt("break",16);case 15:e.setStageStatus("OFF_STAGE");case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"setStageStatus",value:function(e){this.stage.status!==e&&(this.stage.status=e,this.stage.emit("stageStatusUpdate",e))}}]),e}();EP=new WeakMap,TP=new WeakMap,PP=new WeakMap,CP=new WeakMap,function(e,t,n,r){for(var i,a=r>1?void 0:r?ZP(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);r&&a&&RP(t,n,a)}([Lv.trace("DyteStage.setupEvents")],MP.prototype,"setupEvents",1);var AP,IP=Object.defineProperty,OP=Object.getOwnPropertyDescriptor,LP=function(e,t,n,r){for(var i,a=r>1?void 0:r?OP(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&IP(t,n,a),a},DP=function(){function e(t){(0,g.Z)(this,e),Ms(this,AP,void 0),As(this,AP,t)}return(0,y.Z)(e,[{key:"getPolls",value:function(){return Zs(this,AP).sendMessagePromise(ab.getPolls)}},{key:"createPoll",value:function(e,t){var n={anonymous:arguments.length>2&&void 0!==arguments[2]&&arguments[2],hideVotes:arguments.length>3&&void 0!==arguments[3]&&arguments[3],question:e,options:t};return Zs(this,AP).sendMessage(ab.createPoll,Ry.toBinary(n))}},{key:"votePoll",value:function(e,t){var n={index:t,pollId:e};return Zs(this,AP).sendMessage(ab.votePoll,Zy.toBinary(n))}},{key:"on",value:function(e,t){var n,r;switch(e){case ab.updatePoll:case ab.createPoll:case ab.votePoll:n=My.fromBinary.bind(My),r=My.create()}Zs(this,AP).on(e,(function(e){var i=e.payload,a=r;try{a=n(i)}catch(o){Dv.error("chatSocketHandler::on::binary_decode_error",{error:o})}return t(a)}))}}]),e}();AP=new WeakMap,LP([Lv.trace("PollSocketHandler.getPolls")],DP.prototype,"getPolls",1),LP([Lv.trace("PollSocketHandler.createPoll")],DP.prototype,"createPoll",1),LP([Lv.trace("PollSocketHandler.votePoll")],DP.prototype,"votePoll",1);var NP,jP,BP=new((0,y.Z)((function e(){var t=this;(0,g.Z)(this,e),Cs(this,"battery"),Cs(this,"init",(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0="getBattery"in navigator,!e.t0){e.next=10;break}return e.next=5,navigator.getBattery();case 5:t.battery=e.sent,t.battery.addEventListener("chargingchange",t.updateChargeInfo),t.battery.addEventListener("levelchange",t.updateLevelInfo),t.updateLevelInfo(),t.updateChargeInfo();case 10:e.next=15;break;case 12:e.prev=12,e.t1=e.catch(0),Dv.error("Error getting battery",e.t1);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})))),Cs(this,"updateChargeInfo",(function(){var e;Dv.log("Battery charging? ".concat(null!=(e=t.battery)&&e.charging?"Yes":"No"))})),Cs(this,"updateLevelInfo",(function(){var e;Dv.log("Battery level: ".concat(100*(null==(e=t.battery)?void 0:e.level),"%"))})),Cs(this,"cleanup",(function(){var e,n;"getBattery"in navigator&&(null==(e=t.battery)||e.removeEventListener("chargingchange",t.updateChargeInfo),null==(n=t.battery)||n.removeEventListener("levelchange",t.updateLevelInfo))}))}))),UP=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),NP,void 0),Ms((0,f.Z)(r),jP,void 0),As((0,f.Z)(r),NP,e),As((0,f.Z)(r),jP,!1),r}return(0,y.Z)(n,[{key:"mediaPermission",get:function(){return Zs(this,NP).mediaPermissions.audio}}]),n}(ek);NP=new WeakMap,jP=new WeakMap;var VP,FP,zP,HP=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"getNetworkMetadata",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){Ic.onSafeInitialization((function(){Ic.onPreCallTestResults((function(t){e(t.connectionInfo)}
2)),Ic.startPreCallTest()}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]),n}(ek),qP=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),VP,void 0),As((0,f.Z)(r),VP,e),r}return(0,y.Z)(n,[{key:"mediaPermission",get:function(){return Zs(this,VP).mediaPermissions.screenshare}}]),n}(ek);VP=new WeakMap;var GP=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),FP,void 0),Ms((0,f.Z)(r),zP,void 0),As((0,f.Z)(r),FP,e),r}return(0,y.Z)(n,[{key:"mediaPermission",get:function(){return Zs(this,FP).mediaPermissions.video}}]),n}(ek);FP=new WeakMap,zP=new WeakMap;var WP=(0,y.Z)((function e(t){(0,g.Z)(this,e),Cs(this,"audio"),Cs(this,"video"),Cs(this,"screenshare"),Cs(this,"network"),this.audio=new UP(t),this.video=new GP(t),this.screenshare=new qP(t),this.network=new HP})),JP=(0,y.Z)((function e(t){(0,g.Z)(this,e),Cs(this,"troubleshooter"),this.troubleshooter=new WP(t)})),$P=function(){function e(){(0,g.Z)(this,e)}return(0,y.Z)(e,null,[{key:"handleConnectedRoomsDumpRaw",value:function(e){var t,n=e.payload,r=jg.fromBinary(n),i=r.meetings.map((function(e){var t;return{id:e.id,title:e.title,participants:null!=(t=e.participants)?t:[]}}));return{parentMeeting:{id:r.parentMeeting.id,title:r.parentMeeting.title,participants:null!=(t=r.parentMeeting.participants)?t:[]},meetings:i}}},{key:"handleTransferPeerRaw",value:function(e){var t=e.payload,n=Xg.fromBinary(t);return{authToken:n.authToken,meetingId:n.meetingId}}},{key:"handleMovedPeerRaw",value:function(e){var t=e.payload,n=Kg.fromBinary(t);return{meetingId:n.meetingId,customParticipantId:n.customParticipantId}}},{key:"handleConnectedRoomsUpdatedRaw",value:function(e){var t=e.payload;return Fg.fromBinary(t).payloads.map((function(e){return{id:e.id,title:e.title}}))}},{key:"handleConnectedRoomsDeletedRaw",value:function(e){var t=e.payload;return Gg.fromBinary(t).payloads}},{key:"getConnectedRoomsDump",value:function(){var t=(0,h.Z)((0,p.Z)().mark((function t(){var n;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.socketService.sendMessagePromise(nb.getConnectedRoomsDump);case 2:return n=t.sent,t.abrupt("return",e.handleConnectedRoomsDumpRaw(n));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()},{key:"createConnectedRooms",value:function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.socketService.sendMessagePromise(nb.createConnectedRooms,Ug.toBinary({payloads:n}));case 2:return r=t.sent,i=r.payload,t.abrupt("return",Fg.fromBinary(i).payloads.map((function(e){return{id:e.id,title:e.title}})));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"updateConnectedRooms",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableConnectedRooms",value:function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.map((function(e){return{id:e}})),t.next=3,e.socketService.sendMessagePromise(nb.deleteConnectedRooms,qg.toBinary({payloads:r}));case 3:return i=t.sent,t.abrupt("return",e.handleConnectedRoomsDeletedRaw(i));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"movePeersBetweenRooms",value:function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.socketService.sendMessagePromise(nb.movePeers,$g.toBinary({sourceMeetingId:n.sourceMeetingId,destinationMeetingId:n.destinationMeetingId,participants:n.participants}));case 3:return r=t.sent,t.abrupt("return",(new TextDecoder).decode(r.payload).includes("error")?{success:!1,error:"failed to move participants"}:{success:!0});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{success:!1,error:t.t0});case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()}]),e}(),KP=$P;Cs(KP,"socketService"),Cs(KP,"currentMeetingId");var QP,YP={codecs:[{kind:"audio",mimeType:"audio/opus",clockRate:48e3,channels:2,rtcpFeedback:[{type:"transport-cc",parameter:""}],parameters:{},preferredPayloadType:100},{kind:"video",mimeType:"video/VP8",clockRate:9e4,rtcpFeedback:[{type:"nack",parameter:""},{type:"nack",parameter:"pli"},{type:"ccm",parameter:"fir"},{type:"goog-remb",parameter:""},{type:"transport-cc",parameter:""}],parameters:{"x-google-start-bitrate":1e3},preferredPayloadType:101},{kind:"video",mimeType:"video/rtx",preferredPayloadType:102,clockRate:9e4,parameters:{apt:101},rtcpFeedback:[]},{kind:"video",mimeType:"video/VP9",clockRate:9e4,rtcpFeedback:[{type:"nack",parameter:""},{type:"nack",parameter:"pli"},{type:"ccm",parameter:"fir"},{type:"goog-remb",parameter:""},{type:"transport-cc",parameter:""}],parameters:{"profile-id":0,"x-google-start-bitrate":1e3},preferredPayloadType:103},{kind:"video",mimeType:"video/rtx",preferredPayloadType:104,clockRate:9e4,parameters:{apt:103},rtcpFeedback:[]},{kind:"video",mimeType:"video/H264",clockRate:9e4,parameters:{"level-asymmetry-allowed":1,"packetization-mode":1,"profile-level-id":"42e01f","x-google-start-bitrate":1e3},rtcpFeedback:[{type:"nack",parameter:""},{type:"nack",parameter:"pli"},{type:"ccm",parameter:"fir"},{type:"goog-remb",parameter:""},{type:"transport-cc",parameter:""}],preferredPayloadType:105},{kind:"video",mimeType:"video/rtx",preferredPayloadType:106,clockRate:9e4,parameters:{apt:105},rtcpFeedback:[]}],headerExtensions:[{kind:"audio",uri:"urn:ietf:params:rtp-hdrext:sdes:mid",preferredId:1,preferredEncrypt:!1,direction:"sendrecv"},{kind:"video",uri:"urn:ietf:params:rtp-hdrext:sdes:mid",preferredId:1,preferredEncrypt:!1,direction:"sendrecv"},{kind:"video",uri:"urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id",preferredId:2,preferredEncrypt:!1,direction:"recvonly"},{kind:"video",uri:"urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id",preferredId:3,preferredEncrypt:!1,direction:"recvonly"},{kind:"audio",uri:"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",preferredId:4,preferredEncrypt:!1,direction:"sendrecv"},{kind:"video",uri:"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",preferredId:4,preferredEncrypt:!1,direction:"sendrecv"},{kind:"audio",uri:"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",preferredId:5,preferredEncrypt:!1,direction:"recvonly"},{kind:"video",uri:"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",preferredId:5,preferredEncrypt:!1,direction:"sendrecv"},{kind:"video",uri:"http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07",preferredId:6,preferredEncrypt:!1,direction:"sendrecv"},{kind:"video",uri:"urn:ietf:params:rtp-hdrext:framemarking",preferredId:7,preferredEncrypt:!1,direction:"sendrecv"},{kind:"audio",uri:"urn:ietf:params:rtp-hdrext:ssrc-audio-level",preferredId:10,preferredEncrypt:!1,direction:"sendrecv"},{kind:"video",uri:"urn:ietf:params:rtp-hdrext:toffset",preferredId:12,preferredEncrypt:!1,direction:"sendrecv"},{kind:"video",uri:"http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time",preferredId:13,preferredEncrypt:!1,direction:"sendrecv"},{kind:"audio",uri:"http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time",preferredId:13,preferredEncrypt:!1,direction:"sendrecv"}]},XP=Object.defineProperty,eC=Object.getOwnPropertyDescriptor,tC=function(e,t,n,r){for(var i,a=r>1?void 0:r?eC(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&XP(t,n,a),a},nC=function(){function e(t,n,r,i,a,o,s,c,u,l,d,p,h,f){(0,g.Z)(this,e),Cs(this,"apiBase"),Cs(this,"chatController"),Cs(this,"metaController"),Cs(this,"participantController"),Cs(this,"pluginController"),Cs(this,"pollController"),Cs(this,"remoteController"),Cs(this,"selfController"),Cs(this,"recordingController"),Cs(this,"spotlightController"),Cs(this,"livestreamController"),Cs(this,"internalsController"),Cs(this,"stageController"),Cs(this,"troubleshooterController"),this.apiBase=t,this.metaController=n,this.selfController=r,this.pluginController=i,this.participantController=a,this.chatController=o,this.pollController=s,this.remoteController=c,this.recordingController=u,this.spotlightController=l,this.livestreamController=p,this.internalsController=d,this.stageController=h,this.troubleshooterController=f}return(0,y.Z)(e,[{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.selfController.joinRoom());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"leaveRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){var t,n=arguments;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:"left",e.abrupt("return",(BP.cleanup(),this.selfController.leaveRoom(t)));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n,r){var i,a,o,c,u,l,f,v,m,g,y,b,k,_,w,x,S,E,T,P,C,R,Z,M,A,I,O,L,D,N,j,B,U,V,F,z,H,q,G,W,J,$,K,Q,Y,X,ee,te,ne,re,ie,ae,oe,se,ce,ue,le,de,pe,he,fe,ve,me,ge;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x=n.apiBase,S=void 0===x?"https://api.cluster.dyte.in":x,E=n.authToken,T=(0,s.Z)({chat:!0,participant:!0,plugin:!0,poll:!0,self:!0,meta:!0,permissions:!0,theme:!0,spotlight:!0,tracing:!0,devTools:{logs:!1},internals:!0,stage:!0},null==n?void 0:n.modules),sm.reset(),Qv(null!=(o=n.overrides)?o:{}),(P=Yy({authToken:E,baseURL:S})).setHeader("dyte-tracing-id",r),P.setPeerId(r),P.setRoomName(n.roomName),C=n.roomName,R=Wv.isV2AuthToken?Wv.meetingId:C,Z=new Kh,M=Z.load({routerRtpCapabilities:YP}),A=P.getRoomNodeData({roomName:R,peerId:r}),I=Wv.isV2AuthToken?void 0:P.getUserPreset(C),t.next=12,P.getUserDetails();case 12:return O=t.sent,L=Wv.isV2AuthToken?O.participant.organizationId:O.organizationId,Lv.meetingMetadata.userId=Wv.isV2AuthToken?O.participant.id:O.id,dv((0,s.Z)((0,s.Z)({},n),{},{modules:T,apiBase:S,organizationId:L})),Lv.meetingMetadata.organizationId=L,D=DT(R),t.next=18,jc.identify("".concat(Tf.PEER,"_").concat(r),JSON.parse(JSON.stringify((0,s.Z)({entity:Tf.PEER,clientId:L,isAnonUser:!L,sdkVersion:hv,meetingHash:D,roomName:R},ff.getDeviceInfo()))));case 18:if(ff.isElectron()&&window.dyteElectronGetDisplayMediaSource&&(navigator.mediaDevices.getDisplayMedia=function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.dyteElectronGetDisplayMediaSource({types:["window","
2screen"]});case 2:return n=e.sent,r=!1,t.video&&(i=t.video,r={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:n.id,maxWidth:i.width.max,maxHeight:i.height.max}}),a={audio:!1,video:r},e.next=8,navigator.mediaDevices.getUserMedia(a);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),N=jc.getValue(Zf),j=P.getPlugins(N),Dv.info("flagsmith::allFlags",{flags:JSON.stringify(jc.getAllFlags())},!0),BP.init(),B=Wv.isV2AuthToken?XT.default():Gv.default(),U=Wv.isV2AuthToken?aP.default():fP.default(),V=Wv.isV2AuthToken?O.preset.name:void 0,!T.permissions&&!T.theme){t.next=27;break}return t.next=25,I;case 25:(F=t.sent)&&(V=F.presetName),T.permissions&&(B=Wv.isV2AuthToken?XT.fromResponse(O.preset.permissions):Gv.fromResponse(F.permissions)),T.theme&&(U=Wv.isV2AuthToken?aP.fromResponse(O.preset):fP.fromResponse(F.theme),Wv.isV2AuthToken||U.configFromPermissions(F.permissions));case 27:return t.next=29,A;case 29:return z=t.sent,H=z.roomNodeUrl,q=z.meetingTitle,G=z.useHiveMedia,t.next=35,M;case 35:return W=lw(U),J=jc.hasFeature(Uf),$=[],G&&$.push("HIVE"),J&&$.push("PING"),Xv((0,s.Z)((0,s.Z)({},n),{},{roomName:R,peerId:r,meetingTitle:q,roomNodeUrl:H,device:Z})),t.next=39,e.createSocketServiceAndRoomNodeClient((0,s.Z)((0,s.Z)({},n),{},{roomName:R,peerId:r,meetingTitle:q,roomNodeUrl:H,capabilities:$,shouldInitializeRoomNode:W,viewType:U.viewType,device:Z}));case 39:if(K=t.sent,Q=Sk(),de=new Ux(K),pe=new DP(K),he=new pT(K),fe=new mP(K),ve=new gP(K),KP.socketService=K,null!=(c=T.self)&&!c){t.next=52;break}return t.next=46,Promise.all([bw.init(K,O,B,U,V),Q instanceof gk?Q.setupTransports():null]);case 46:i=t.sent,a=(0,d.Z)(i,1),ne=a[0],P.setOrganizationId(ne.self.organizationId),t.next=56;break;case 52:if(t.t0=Q instanceof gk,!t.t0){t.next=56;break}return t.next=56,Q.setupTransports();case 56:if(me=jc.hasFeature(sv),ne&&me&&(le=new JP(ne.self)),null!=(u=T.participant)&&!u){t.next=61;break}if(ne){t.next=60;break}throw new Bv("The participant module cannot be initialized without the `self` module");case 60:X=new Qw(ne.self);case 61:if(null!=(l=T.chat)&&!l){t.next=67;break}if(ne){t.next=64;break}throw new Bv("The chat module cannot be initialized without the `self` module");case 64:return t.next=66,oS.init(de,ne.self,X.participants,$);case 66:Y=t.sent;case 67:if(null!=(f=T.plugin)&&!f){t.next=78;break}if(ne){t.next=70;break}throw new Bv("The plugin module cannot be initialized without the `self` module");case 70:if(X){t.next=72;break}throw new Bv("The plugin module cannot be initialized without the `participant` module");case 72:return t.next=74,j;case 74:return ge=t.sent,t.next=77,mS.init(ge,he,de,null==Y?void 0:Y.chat,ne.self,X.participants,$);case 77:ee=t.sent;case 78:if(null!=(v=T.poll)&&!v){t.next=84;break}if(ne){t.next=81;break}throw new Bv("The poll cannot be initialized without the `self` module");case 81:return t.next=83,LS.init(ne.self,pe,$);case 83:te=t.sent;case 84:if(null!=(m=T.meta)&&!m){t.next=88;break}if(ne){t.next=87;break}throw new Bv("The meta module cannot be initialized without the `self` module");case 87:re=new cx(ne.self,K,q);case 88:if(null!=(g=T.remoteControl)&&!g){t.next=92;break}if(ne){t.next=91;break}throw new Bv("The remote controller cannot be initialized without the `self` module");case 91:ie=new GS(ne.self,X.participants);case 92:if(null!=(y=T.recording)&&!y){t.next=96;break}if(ne){t.next=95;break}throw new Bv("The recording controller cannot be initialized without the `self` module");case 95:ae=new _T(ne.self);case 96:if(null!=(b=T.spotlight)&&!b){t.next=100;break}if(ne){t.next=99;break}throw new Bv("The spotlight controller cannot be initialized without the `self` module");case 99:oe=new LT(ne.self);case 100:if(t.t1=null==(k=T.internals)||k,!t.t1){t.next=105;break}return t.next=104,UT.init();case 104:ce=t.sent;case 105:if(U.viewType!==Kd.Livestream||null!=(_=T.livestream)&&!_){t.next=109;break}if(ne){t.next=108;break}throw new Bv("The livestream controller cannot be initialized without the `self` module");case 108:jc.hasFeature(Kf)&&(se=new $T(ne.self,fe));case 109:if(null!=(w=T.stage)&&!w){t.next=113;break}if(ne){t.next=112;break}throw new Bv("The stage client cannot be initialized without the `self` module");case 112:ue=new MP(ve,uw(B),ne.self);case 113:return t.abrupt("return",new e(S,re,ne,ee,X,Y,te,ie,ae,oe,ce,se,ue,le));case 114:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"createSocketServiceAndRoomNodeClient",value:function(){var t=(0,h.Z)((0,p.Z)().mark((function t(n){var r,i;return(0,p.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.createSocketService(n),n.shouldInitializeRoomNode){t.next=3;break}return t.abrupt("return",r);case 3:if(!n.capabilities.includes("HIVE")){t.next=10;break}return t.next=6,r;case 6:return i=t.sent,t.next=9,yk((0,s.Z)((0,s.Z)({},n),{},{roomName:n.roomName,peerId:n.peerId,socket:i}));case 9:return t.abrupt("return",i);case 10:return t.next=12,Promise.all([r,kk((0,s.Z)((0,s.Z)({},n),{},{roomName:n.roomName,peerId:n.peerId}))]);case 12:return t.abrupt("return",t.sent[0]);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},{key:"createSocketService",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a,o,s;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.peerId,i=t.roomName,a=t.authToken,o=t.capabilities,s=new dT({peerId:r,room
2Name:i,authToken:a,capabilities:o}),!Kv(t.viewType,o)&&"socket-service"!==(null==(n=t.overrides)?void 0:n.chat_socket_server)){e.next=10;break}return e.prev=2,e.next=5,s.connect();case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),Dv.error("[Socket Service] Failed to connect to socket server:",{error:e.t0});case 10:return e.abrupt("return",s);case 11:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(t){return e.apply(this,arguments)}}()}]),e}(),rC=nC;tC([Lv.trace("Controller.joinRoom")],rC.prototype,"joinRoom",1),tC([Lv.trace("Controller.leaveRoom")],rC.prototype,"leaveRoom",1),tC([Lv.trace("Controller.init")],rC,"init",1),tC([Lv.trace("Controller.createSocketServiceAndRoomNodeClient")],rC,"createSocketServiceAndRoomNodeClient",1),tC([Lv.trace("Controller.createSocketService")],rC,"createSocketService",1);var iC=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(e){var r;return(0,g.Z)(this,n),r=t.call(this),Ms((0,f.Z)(r),QP,void 0),Cs((0,f.Z)(r),"meetings",[]),Cs((0,f.Z)(r),"parentMeeting",null),As((0,f.Z)(r),QP,e.self),r}return(0,y.Z)(n,[{key:"supportsConnectedMeetings",get:function(){return""!==Zs(this,QP).id&&Wv.isV2AuthToken&&jc.hasFeature(Af)}},{key:"isActive",get:function(){return 0!==this.meetings.length}},{key:"currentMeetingId",get:function(){return KP.currentMeetingId}},{key:"validateConnectedMeetingsAction",value:function(){if(!this.supportsConnectedMeetings)throw new Error("You are not allowed to perform this action.\n            Please connect with Dyte team to move you to V2 APIs & to enable connected meetings.")}},{key:"getConnectedMeetings",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.validateConnectedMeetingsAction(),e.next=3,KP.getConnectedRoomsDump();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"createMeetings",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.validateConnectedMeetingsAction(),e.next=3,KP.createConnectedRooms(t);case 3:return e.abrupt("return",e.sent.map((function(e){return{id:e.id,title:e.title}})));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"updateMeetings",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.validateConnectedMeetingsAction(),e.next=3,KP.updateConnectedRooms(t.map((function(e){return{meetingId:e.id,title:e.title}})));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"deleteMeetings",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r=this;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.validateConnectedMeetingsAction(),n=this.meetings.map((function(e){return t.includes(e.id)&&0!==e.participants.length?r.moveParticipants(e.id,r.parentMeeting.id,e.participants.map((function(e){return e.id}))):Promise.resolve()})),e.next=4,Promise.all(n);case 4:return e.next=6,KP.disableConnectedRooms(t);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"moveParticipants",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t,n,r){var i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.validateConnectedMeetingsAction(),i=new Map,[].concat((0,o.Z)(this.parentMeeting.participants),(0,o.Z)(this.meetings.flatMap((function(e){return e.participants})))).forEach((function(e){return i.set(e.id,e)})),e.next=5,KP.movePeersBetweenRooms({sourceMeetingId:t,destinationMeetingId:n,participants:r.map((function(e){return{id:e}}))});case 5:return a=e.sent,e.abrupt("return",(a.success&&(n===this.parentMeeting.id&&(this.parentMeeting.participants=this.parentMeeting.participants.concat(r.map((function(e){return i.get(e)})))),t===this.parentMeeting.id&&(this.parentMeeting.participants=this.parentMeeting.participants.filter((function(e){return!r.includes(e.id)}
2))),this.meetings=this.meetings.map((function(e){if(n===e.id){var a=e.participants.concat(r.map((function(e){return i.get(e)})));return(0,s.Z)((0,s.Z)({},e),{},{participants:a})}if(t===e.id){var o=e.participants.filter((function(e){return!r.includes(e.id)}));return(0,s.Z)((0,s.Z)({},e),{},{participants:o})}return e}))),a));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),n}(ek);QP=new WeakMap;var aC,oC,sC,cC=Object.defineProperty,uC=Object.getOwnPropertyDescriptor,lC=function(e,t,n,r){for(var i,a=r>1?void 0:r?uC(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&cC(t,n,a),a},dC=(sC=function(){function e(t,n){(0,g.Z)(this,e),Cs(this,"connectedMeetings"),Ms(this,aC,void 0),Ms(this,oC,void 0),As(this,aC,n),this.connectedMeetings=new iC(t),this.setCurrentMeeting(t)}return(0,y.Z)(e,[{key:"setCurrentMeeting",value:function(e){As(this,oC,e),KP.currentMeetingId=e.meta.roomName}},{key:"getConnectedMeetings",value:function(){this.connectedMeetings.getConnectedMeetings()}},{key:"setupEvents",value:function(){KP.socketService&&(KP.socketService.on(nb.getConnectedRoomsDump,this.handleConnectedRoomsDump.bind(this)),KP.socketService.on(nb.transferPeer,this.handleTransferPeer.bind(this)),KP.socketService.on(nb.movedPeer,this.handleMovedPeer.bind(this)),KP.socketService.on(nb.connectedRoomsUpdated,this.handleConnectedRoomsUpdated.bind(this)),KP.socketService.on(nb.connectedRoomsDeleted,this.handleConnectedRoomsDeleted.bind(this)))}},{key:"handleTransferPeer",value:function(e){var t=KP.handleTransferPeerRaw(e);return this.switchMeeting(t)}},{key:"switchMeeting",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var n,r,i,a;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.authToken,r=t.meetingId,this.connectedMeetings.supportsConnectedMeetings){e.next=3;break}throw new Error("You are not allowed to perform this action.\n                Please connect with Dyte team to move you to V2 APIs & to enable connected meetings.");case 3:return this.connectedMeetings.emit("changingMeeting",r),i=Zs(this,oC).self.videoEnabled,e.next=7,Zs(this,oC).leaveRoom("connected-meeting");case 7:return KP.socketService=void 0,e.next=10,wC.init({authToken:n,apiBase:Zs(this,aC).apiBase,defaults:(0,s.Z)((0,s.Z)({},Zs(this,aC).defaults),{},{video:i,audio:!1}),modules:Zs(this,aC).modules});case 10:return a=e.sent,e.abrupt("return",(this.connectedMeetings.emit("meetingChanged",a),this.setCurrentMeeting(a),a));case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"handleConnectedRoomsDump",value:function(e){var t=KP.handleConnectedRoomsDumpRaw(e);this.connectedMeetings.meetings=t.meetings.map((function(e){return{id:e.id,title:e.title,participants:e.participants||[]}})),this.connectedMeetings.parentMeeting={id:t.parentMeeting.id,title:t.parentMeeting.title,participants:t.parentMeeting.participants},this.emitStateUpdate()}},{key:"handleMovedPeer",value:function(e){return KP.handleMovedPeerRaw(e)}},{key:"handleConnectedRoomsUpdated",value:function(e){var t=KP.handleConnectedRoomsUpdatedRaw(e),n=new Map;this.connectedMeetings.meetings.forEach((function(e){n.set(e.id,e)})),t.forEach((function(e){n.has(e.id)?n.get(e.id).title=e.title:n.set(e.id,(0,s.Z)((0,s.Z)({},e),{},{participants:[]}))})),this.connectedMeetings.meetings=Array.from(n.values()),this.emitStateUpdate()}},{key:"handleConnectedRoomsDeleted",value:function(e){var t=KP.handleConnectedRoomsDeletedRaw(e).map((function(e){return e.id}));this.connectedMeetings.meetings=this.connectedMeetings.meetings.filter((function(e){return!t.includes(e.id)}
2))}},{key:"emitStateUpdate",value:function(){this.connectedMeetings.emit("stateUpdate",{meetings:this.connectedMeetings.meetings,parentMeeting:this.connectedMeetings.parentMeeting})}}],[{key:"init",value:function(e,t){return dC.instance||(dC.instance=new dC(e,t)),dC.instance.connectedMeetings.supportsConnectedMeetings&&(dC.instance.setupEvents(),e.self.once("roomJoined",(function(){return dC.instance.getConnectedMeetings()}))),dC.instance}}]),e}(),aC=new WeakMap,oC=new WeakMap,Cs(sC,"instance"),sC),pC=dC;lC([Lv.trace("ConnectedMeetingsController.getConnectedMeetings")],pC.prototype,"getConnectedMeetings",1),lC([Lv.trace("ConnectedMeetingsController.setupEvents")],pC.prototype,"setupEvents",1),lC([Lv.trace("ConnectedMeetingsController.switchMeeting")],pC.prototype,"switchMeeting",1);var hC,fC,vC,mC,gC,yC=Object.defineProperty,bC=Object.getOwnPropertyDescriptor,kC=function(e,t,n,r){for(var i,a=r>1?void 0:r?bC(t,n):t,o=e.length-1;o>=0;o--)(i=e[o])&&(a=(r?i(t,n,a):i(a))||a);return r&&a&&yC(t,n,a),a},_C=(gC=function(){function e(t){(0,g.Z)(this,e),Ms(this,vC),Ms(this,hC,void 0),Ms(this,fC,void 0),As(this,hC,t)}return(0,y.Z)(e,[{key:"joinRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,hC).joinRoom());case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"leaveRoom",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Zs(this,hC).leaveRoom(t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"participants",get:function(){var e;return null==(e=Zs(this,hC).participantController)?void 0:e.participants}},{key:"self",get:function(){var e;return null==(e=Zs(this,hC).selfController)?void 0:e.self}},{key:"meta",get:function(){var e;return null==(e=Zs(this,hC).metaController)?void 0:e.meta}},{key:"plugins",get:function(){var e;return null==(e=Zs(this,hC).pluginController)?void 0:e.plugins}},{key:"chat",get:function(){var e;return null==(e=Zs(this,hC).chatController)?void 0:e.chat}},{key:"polls",get:function(){var e;return null==(e=Zs(this,hC).pollController)?void 0:e.polls}},{key:"remote",get:function(){var e;return null==(e=Zs(this,hC).remoteController)?void 0:e.remote}},{key:"connectedMeetings",get:function(){var e;return null==(e=Zs(this,fC))?void 0:e.connectedMeetings}},{key:"recording",get:function(){var e;return null==(e=Zs(this,hC).recordingController)?void 0:e.recording}},{key:"spotlight",get:function(){var e;return null==(e=Zs(this,hC).spotlightController)?void 0:e.spotlight}},{key:"livestream",get:function(){var e;return null==(e=Zs(this,hC).livestreamController)?void 0:e.livestream}},{key:"stage",get:function(){var e;return null==(e=Zs(this,hC).stageController)?void 0:e.stage}},{key:"troubleshoot",get:function(){var e;return null==(e=Zs(this,hC).troubleshooterController)?void 0:e.troubleshooter}},{key:"__internals__",get:function(){var e;return null==(e=Zs(this,hC).internalsController)?void 0:e.internals}}],[{key:"init",value:function(){var e=(0,h.Z)((0,p.Z)().mark((function e(t){var r,i,a,o,s,c,u,l;return(0,p.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ff.init(),c=P();try{null==(i=null==(r=t.modules)?void 0:r.tracing)||i||(window.__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION=!0,void 0===window.Zone&&n(104))}catch(d){}return Lv.init(c,null==(o=null==(a=t.modules)?void 0:a.tracing)||o),!navigator.isReactNative&&"undefined"!=typeof window&&(window.addEventListener("error",(function(e){var t;(null==(t=e.filename)||!t.includes("localhost"))&&0!==e.lineno&&Dv.error("window::error",{error:e.error},!0)})),window.addEventListener("unhandledrejection",(function(e){var t,n,r,i,a,o,s,c;Dv.error("window::unhandledrejection",{error:null==e?void 0:e.reason,networkCall:{url:null==(n=null==(t=null==e?void 0:e.reason)?void 0:t.config)?void 0:n.url,baseURL:null==(i=null==(r=null==e?void 0:e.reason)?void 0:r.config)?void 0:i.baseURL,method:null==(o=null==(a=null==e?void 0:e.reason)?void 0:a.config)?void 0:o.method,status:null==(s=null==e?void 0:e.reason)?void 0:s.status,statusText:null==(c=null==e?void 0:e.reason)?void 0:c.statusText}},!0)}))),$v(t.authToken,t.roomName),Lv.meetingMetadata.roomName=Wv.isV2AuthToken?Wv.meetingId:t.roomName,e.next=6,rC.init(t,c);
2case 6:return u=e.sent,l=new _C(u),e.abrupt("return",(Is(s=l,vC,mC).call(s,t),l));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),hC=new WeakMap,fC=new WeakMap,vC=new WeakSet,mC=function(e){As(this,fC,pC.init(this,e))},gC);kC([zv((function(e){throw new Bv(e.message,"0002")}))],_C.prototype,"joinRoom",1),kC([zv((function(e){throw new Bv(e.message,"0003")}))],_C.prototype,"leaveRoom",1),kC([zv((function(e){throw new Bv(e.message,"0001")})),function(e){var t=this;return function(n,r,i){var a=i.value,o=e?np(a,e):np(a);return i.value=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];if(o.cache&&o.cache.has(e.apply(void 0,i))){console.warn('[Dyte] method "'.concat(r,'" is called twice. This may result in inconsistent behaviors'));try{Dv.warn("Memoize::double_invoke",{memoize:{doubleInvoked:{property:r}}})}catch(s){}}return o.apply(t,i)},i}}((function(e){var t,n,r,i,a;return"".concat(null!=(t=e.roomName)?t:"","-").concat(e.authToken,"-").concat(null!=(n=e.apiBase)?n:"","-").concat(JSON.stringify(null!=(r=e.defaults)?r:{}),"-").concat(JSON.stringify(null!=(i=e.modules)?i:{}),"-").concat(JSON.stringify(null!=(a=e.overrides)?a:{}))}))],_C,"init",1),_C=kC([zv((function(e){throw new Bv(e.message,"0000")}))],_C);var wC=_C},1836:function(e,t,n){"use strict";var r=n(6690).default,i=n(9728).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;var o=a(n(8392)),s="awaitqueue",c=function(){function e(t){r(this,e),t?(this._debug=(0,o.default)("".concat(s,":").concat(t)),this._warn=(0,o.default)("".concat(s,":WARN:").concat(t)),this._error=(0,o.default)("".concat(s,":ERROR:").concat(t))):(this._debug=(0,o.default)(s),this._warn=(0,o.default)("".concat(s,":WARN")),this._error=(0,o.default)("".concat(s,":ERROR"))),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}return i(e,[{key:"debug",get:function(){return this._debug}},{key:"warn",get:function(){return this._warn}},{key:"error",get:function(){return this._error}}]),e}();t.Logger=c},9647:function(e,t,n){"use strict";var r=n(4704).default,i=n(7061).default,a=n(7424).default,o=n(7156).default,s=n(9728).default,c=n(6690).default,u=n(6115).default,l=n(1655).default,d=n(6389).default,p=n(3496).default;t.Cg=void 0;var h=new(n(1836).Logger),f=function(e){l(n,e);var t=d(n);function n(e){var r;return c(this,n),(r=t.call(this,null!==e&&void 0!==e?e:"AwaitQueue stopped")).name="AwaitQueueStoppedError","function"===typeof Error.captureStackTrace&&Error.captureStackTrace(u(r),n),r}return s(n)}(p(Error));var v=function(e){l(n,e);var t=d(n);function n(e){var r;return c(this,n),(r=t.call(this,null!==e&&void 0!==e?e:"AwaitQueue task removed")).name="AwaitQueueRemovedTaskError","function"===typeof Error.captureStackTrace&&Error.captureStackTrace(u(r),n),r}return s(n)}(p(Error));var m=function(){function e(){c(this,e),this.pendingTasks=new Map,this.nextTaskId=0,this.stopping=!1}return s(e,[{key:"size",get:function(){return this.pendingTasks.size}},{key:"push",value:function(){var e=o(i().mark((function e(t,n){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null!==n&&void 0!==n?n:t.name,h.debug("push() [name:".concat(n,"]")),"function"===typeof t){e.next=4;break}throw new TypeError("given task is not a function");case 4:if(n)try{Object.defineProperty(t,"name",{value:n})}catch(i){}return e.abrupt("return",new Promise((function(e,i){var o={id:r.nextTaskId++,task:t,name:n,enqueuedAt:Date.now(),executedAt:void 0,completed:!1,resolve:function(t){if(!o.completed){o.completed=!0,r.pendingTasks.delete(o.id),h.debug("resolving task [name:".concat(o.name,"]")),e(t);var n=r.pendingTasks.values(),i=a(n,1)[0];i&&!i.executedAt&&r.execute(i)}},reject:function(e){if(!o.completed&&(o.completed=!0,r.pendingTasks.delete(o.id),h.debug("rejecting task [name:".concat(o.name,"]: %s"),String(e)),i(e),!r.stopping)){var t=r.pendingTasks.values(),n=a(t,1)[0];n&&!n.executedAt&&r.execute(n)}}};r.pendingTasks.set(o.id,o),1===r.pendingTasks.size&&r.execute(o)})));case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"stop",value:function(){h.debug("stop()"),this.stopping=!0;var e,t=r(this.pendingTasks.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;h.debug("stop() | stopping task [name:".concat(n.name,"]")),n.reject(new f)}}catch(i){t.e(i)}finally{t.f()}this.stopping=!1}},{key:"remove",value:function(e){h.debug("remove() [taskIdx:".concat(e,"]"));var t=Array.from(this.pendingTasks.values())[e];t?t.reject(new v):h.debug("stop() | no task with given idx [taskIdx:".concat(e,"]"))}},{key:"dump",value:function(){var e=Date.now(),t=0;return Array.from(this.pendingTasks.values()).map((function(n){return{idx:t++,task:n.task,name:n.name,enqueuedTime:n.executedAt?n.executedAt-n.enqueuedAt:e-n.enqueuedAt,executionTime:n.executedAt?e-n.executedAt:0}}))}},{key:"execute",value:function(){var e=o(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.debug("execute() [name:".concat(t.name,"]")),!t.executedAt){e.next=3;break}throw new Error("task already being executed");case 3:return t.executedAt=Date.now(),e.prev=4,e.next=7,t.task();case 7:n=e.sent,t.resolve(n),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),t.reject(e.t0);case 14:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t){return e.apply(this,arguments)}}()}]),e}();t.Cg=m},4569:function(e,t,n){e.exports=n(8036)},3381:function(e,t,n){"use strict";var r=n(3589),i=n(7297),a=n(9301),o=n(9774),s=n(1804),c=n(9145),u=n(5411),l=n(6467),d=n(221),p=n(9346);e.exports=function(e){return new Promise((function(t,n){var h,f=e.data,v=e.headers,m=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}r.isFormData(f)&&delete v["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",k=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(b+":"+k)}var _=s(e.baseURL,e.url);function w(){if(y){var r="getAllResponseHeaders"in y?c(y.getAllResponseHeaders()):null,a={data:m&&"text"!==m&&"json"!==m?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y};i((function(e){t(e),g()}),(function(e){n(e),g()}),a),y=null}}if(y.open(e.method.toUpperCase(),o(_,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(w)},y.onabort=function(){y&&(n(l("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){n(l("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||d.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var x=(e.withCredentials||u(_))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;x&&(v[e.xsrfHeaderName]=x)}"setRequestHeader"in y&&r.forEach(v,(function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete v[t]:y.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),m&&"json"!==m&&(y.responseType=e.responseType),"function"===typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){y&&(n(!e||e&&e.type?new p("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),f||(f=null),y.send(f)}))}},8036:function(e,t,n){"use strict";var r=n(3589),i=n(4049),a=n(3773),o=n(777);var s=function e(t){var n=new a(t),s=i(a.prototype.request,n);return r.extend(s,a.prototype,n),r.extend(s,n),s.create=function(n){return e(o(t,n))},s}(n(221));s.Axios=a,s.Cancel=n(9346),s.CancelToken=n(6857),s.isCancel=n(5517),s.VERSION=n(7600).version,s.all=function(e){return Promise.all(e)},s.spread=n(8089),s.isAxiosError=n(9580),e.exports=s,e.exports.default=s},9346:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")}
vendor: 5,826 bytes, line 2
2,t.prototype.__CANCEL__=!0,e.exports=t},6857:function(e,t,n){"use strict";var r=n(9346);function i(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},5517:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},3773:function(e,t,n){"use strict";var r=n(3589),i=n(9774),a=n(7470),o=n(2733),s=n(777),c=n(7835),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new a,response:new a}}l.prototype.request=function(e,t){if("string"===typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var a,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!i){var d=[o,void 0];for(Array.prototype.unshift.apply(d,r),d=d.concat(l),a=Promise.resolve(t);d.length;)a=a.then(d.shift(),d.shift());return a}for(var p=t;r.length;){var h=r.shift(),f=r.shift();try{p=h(p)}catch(v){f(v);break}}try{a=o(p)}catch(v){return Promise.reject(v)}for(;l.length;)a=a.then(l.shift(),l.shift());return a},l.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=l},7470:function(e,t,n){"use strict";var r=n(3589);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},1804:function(e,t,n){"use strict";var r=n(4044),i=n(9549);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},6467:function(e,t,n){"use strict";var r=n(6460);e.exports=function(e,t,n,i,a){var o=new Error(e);return r(o,t,n,i,a)}},2733:function(e,t,n){"use strict";var r=n(3589),i=n(2693),a=n(5517),o=n(221),s=n(9346);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return c(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(c(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},6460:function(e){"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.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}},e}},777:function(e,t,n){"use strict";var r=n(3589);e.exports=function(e,t){t=t||{};var n={};function i(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function o(e){if(!r.isUndefined(t[e]))return i(void 0,t[e])}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function c(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||a,i=t(e);r.isUndefined(i)&&t!==c||(n[e]=i)})),n}},7297:function(e,t,n){"use strict";var r=n(6467);e.exports=function(e,t,n){var i=n.config.validateStatus;
2n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},2693:function(e,t,n){"use strict";var r=n(3589),i=n(221);e.exports=function(e,t,n){var a=this||i;return r.forEach(n,(function(n){e=n.call(a,e,t)})),e}},221:function(e,t,n){"use strict";var r=n(3589),i=n(4341),a=n(6460),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(e=n(3381)),e}(),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(i){if("SyntaxError"!==i.name)throw i}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||c.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(o){if("SyntaxError"===s.name)throw a(s,this,"E_JSON_PARSE");throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(o)})),e.exports=c},7600:function(e){e.exports={version:"0.25.0"}},4049:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},9774:function(e,t,n){"use strict";var r=n(3589);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var a;if(n)a=n(t);else if(r.isURLSearchParams(t))a=t.toString();else{var o=[];r.forEach(t,(function(e,t){null!==e&&"undefined"!==typeof e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))})))})),a=o.join("&")}if(a){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},9549:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},9301:function(e,t,n){"use strict";var r=n(3589);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(i)&&s.push("path="+i),r.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},4044:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},9580:function(e,t,n){"use strict";var r=n(3589);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},5411:function(e,t,n){"use strict";var r=n(3589);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},4341:function(e,t,n){"use strict";var r=n(3589);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},9145:function(e,t,n){"use strict";var r=n(3589),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,a,o={};return e?(r.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=r.trim(e.substr(0,a)).toLowerCase(),n=r.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},8089:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7835:function(e,t,n){"use strict";var r=n(7600).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var a={};i.transitional=function(e,t,n){function i(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,o){if(!1===e)throw new Error(i(r," has been removed"+(t?" in "+t:"")));return t&&!a[r]&&(a[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}},e.exports={assertOptions:function(e,t,n){if("object"!==typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var a=r[i],o=t[a];if(o){var s=e[a],c=void 0===s||o(s,a,e);if(!0!==c)throw new TypeError("option "+a+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:i}},3589:function(e,t,n){"use strict";var r=n(4049),i=Object.prototype.toString;function a(e){return Array.isArray(e)}function o(e){return"undefined"===typeof e}function s(e){return"[object ArrayBuffer]"===i.call(e)}function c(e){return null!==e&&"object"===typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function d(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),a(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)}e.exports={isArray:a,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===i.call(e)},isArrayBufferView:function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"===typeof e},isNumber:function(e){return"number"===typeof e},isObject:c,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:l,isStream:function(e){return c(e)&&l(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===i.call(e)},isStandardBrowserEnv:function(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}
vendor: 7,399 bytes, line 2
2,forEach:d,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):a(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,(function(t,i){e[i]=n&&"function"===typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},5524:function(e){e.exports=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=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,c=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),o-=1;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;o-=1}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=a.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},a=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(){}var t,n,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return a.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return a.ENGINE_MAP}},{key:"OS_MAP",get:function(){return a.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return a.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}();t.default=s,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),a=c(n(94)),o=c(n(95)),s=c(n(17));
vendor: 7,009 bytes, line 2
2function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];"string"==typeof o?(i[t]=o,a+=1):"object"==typeof o&&(n[t]=o,r+=1)})),r>0){var o=Object.keys(n),c=s.default.find(o,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(n[c]);if(void 0!==u)return u}var l=s.default.find(o,(function(e){return t.isPlatform(e)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(a>0){var p=Object.keys(i),h=s.default.find(p,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(i[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"}
vendor: 7,818 bytes, line 2
2,n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);
vendor: 5,069 bytes, line 2
2return{name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=o,e.exports=t.default}})},312:function(e){var t=1e3,n=60*t,r=60*n,i=24*r,a=7*i,o=365.25*i;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var a=Math.abs(e);if(a>=i)return s(e,a,i,"day");if(a>=r)return s(e,a,r,"hour");if(a>=n)return s(e,a,n,"minute");
2if(a>=t)return s(e,a,t,"second");return e+" ms"}(e):function(e){var a=Math.abs(e);if(a>=i)return Math.round(e/i)+"d";if(a>=r)return Math.round(e/r)+"h";if(a>=n)return Math.round(e/n)+"m";if(a>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},8392:function(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(n){}!e&&"undefined"!==typeof process&&"env"in process&&(e={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_SERVER_URL:"https://dyte-audio.fly.dev"}.DEBUG);return e},t.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=n(8472)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},8472:function(e,t,n){var r=n(861).default;e.exports=function(e){function t(e){var n,r,a,o=null;function s(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];if(s.enabled){var a=s,o=Number(new Date),c=o-(n||o);a.diff=c,a.prev=n,a.curr=o,n=o,r[0]=t.coerce(r[0]),"string"!==typeof r[0]&&r.unshift("%O");var u=0;r[0]=r[0].replace(/%([a-zA-Z%])/g,(function(e,n){if("%%"===e)return"%";u++;var i=t.formatters[n];if("function"===typeof i){var o=r[u];e=i.call(a,o),r.splice(u,1),u--}return e})),t.formatArgs.call(a,r),(a.log||t.log).apply(a,r)}}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=i,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==o?o:(r!==t.namespaces&&(r=t.namespaces,a=t.enabled(e)),a)},set:function(e){o=e}}),"function"===typeof t.init&&t.init(s),s}function i(e,n){var r=t(this.namespace+("undefined"===typeof n?":":n)+e);return r.log=this.log,r}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){var e=[].concat(r(t.names.map(a)),r(t.skips.map(a).map((function(e){return"-"+e})))).join(",");return t.enable(""),e},t.enable=function(e){var n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];var r=("string"===typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(312),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(n){t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},2389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var n=e(t);return t.add(n),n}},n=function(e){return function(t,n){return e.set(t,n),n}},r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,a=2*i,o=function(e,t){return function(n){var o=t.get(n),s=void 0===o?n.size:o<a?o+1:0;if(!n.has(s))return e(n,s);if(n.size<i){for(;n.has(s);)s=Math.floor(Math.random()*a);return e(n,s)}if(n.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;n.has(s);)s=Math.floor(Math.random()*r);return e(n,s)}},s=new WeakMap,c=n(s),u=o(c,s),l=t(u);e.addUniqueNumber=l,e.generateUniqueNumber=u}(t)},8828:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float),a=(r.new_float_n,r.new_int,r.new_int_n,r.assert,n(610));e.exports=function(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=i(a.SBMAX_l),this.s=i(a.SBMAX_s),this.psfb21=i(a.PSFB21),this.psfb12=i(a.PSFB12),this.cb_l=i(a.CBANDS),this.cb_s=i(a.CBANDS),this.eql_w=i(a.BLKSIZE/2)}},6435:function(e,t,n){var r=n(8768),i=r.System,a=(r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays),o=(r.new_array_n,r.new_byte),s=(r.new_double,r.new_float,r.new_float_n),c=r.new_int,u=(r.new_int_n,r.assert),l=n(2191),d=n(2804),p=n(610),h=n(4330);function f(){var e=n(7589),t=this,r=32,f=null,v=null,m=null,g=null;this.setModules=function(e,t,n,r){f=e,v=t,m=n,g=r};var y=null,b=0,k=0,_=0;function w(e){i.arraycopy(e.header[e.w_ptr].buf,0,y,k,e.sideinfo_len),k+=e.sideinfo_len,b+=8*e.sideinfo_len,e.w_ptr=e.w_ptr+1&h.MAX_HEADER_BUF-1}function x(t,n,i){for(u(i<r-2);i>0;){var a;0==_&&(_=8,k++,u(k<e.LAME_MAXMP3BUFFER),u(t.header[t.w_ptr].write_timing>=b),t.header[t.w_ptr].write_timing==b&&w(t),y[k]=0),a=Math.min(i,_),_-=a,u((i-=a)<r),u(_<r),y[k]|=n>>i<<_,b+=a}}function S(t,n,i){for(u(i<r-2);i>0;){var a;0==_&&(_=8,k++,u(k<e.LAME_MAXMP3BUFFER),y[k]=0),a=Math.min(i,_),_-=a,u((i-=a)<r),u(_<r),y[k]|=n>>i<<_,b+=a}}function E(e,t){var n,r=e.internal_flags;if(u(t>=0),t>=8&&(x(r,76,8),t-=8),t>=8&&(x(r,65,8),t-=8),t>=8&&(x(r,77,8),t-=8),t>=8&&(x(r,69,8),t-=8),t>=32){var i=m.getLameShortVersion();if(t>=32)for(n=0;n<i.length&&t>=8;++n)t-=8,x(r,i.charAt(n),8)}for(;t>=1;t-=1)x(r,r.ancillary_flag,1),r.ancillary_flag^=e.disable_reservoir?0:1;u(0==t)}function T(e,t,n){for(var i=e.header[e.h_ptr].ptr;n>0;){var a=Math.min(n,8-(7&i));u((n-=a)<r),e.header[e.h_ptr].buf[i>>3]|=t>>n<<8-(7&i)-a,i+=a}e.header[e.h_ptr].ptr=i}function P(e,t){e<<=8;for(var n=0;n<8;n++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=32773);return t}function C(e,t){var n,r=d.ht[t.count1table_select+32],i=0,a=t.big_values,o=t.big_values;for(u(t.count1table_select<2),n=(t.count1-t.big_values)/4;n>0;--n){var s,c=0,l=0;
20!=(s=t.l3_enc[a+0])&&(l+=8,t.xr[o+0]<0&&c++,u(s<=1)),0!=(s=t.l3_enc[a+1])&&(l+=4,c*=2,t.xr[o+1]<0&&c++,u(s<=1)),0!=(s=t.l3_enc[a+2])&&(l+=2,c*=2,t.xr[o+2]<0&&c++,u(s<=1)),0!=(s=t.l3_enc[a+3])&&(l++,c*=2,t.xr[o+3]<0&&c++,u(s<=1)),a+=4,o+=4,x(e,c+r.table[l],r.hlen[l]),i+=r.hlen[l]}return i}function R(e,t,n,i,a){var o=d.ht[t],s=0;if(u(t<32),0==t)return s;for(var c=n;c<i;c+=2){var l=0,p=0,h=o.xlen,f=o.xlen,v=0,m=a.l3_enc[c],g=a.l3_enc[c+1];if(0!=m&&(a.xr[c]<0&&v++,l--),t>15){if(m>14){var y=m-15;u(y<=o.linmax),v|=y<<1,p=h,m=15}if(g>14){var b=g-15;u(b<=o.linmax),v<<=h,v|=b,p+=h,g=15}f=16}0!=g&&(v<<=1,a.xr[c+1]<0&&v++,l--),u((m|g)<16),m=m*f+g,p-=l,l+=o.hlen[m],u(l<=r),u(p<=r),x(e,o.table[m],l),x(e,v,p),s+=l+p}return s}function Z(e,t){var n=3*e.scalefac_band.s[3];n>t.big_values&&(n=t.big_values);var r=R(e,t.table_select[0],0,n,t);return r+=R(e,t.table_select[1],n,t.big_values,t)}function M(e,t){var n,r,i,a;n=t.big_values,u(0<=n&&n<=576);var o=t.region0_count+1;return u(0<=o),u(o<e.scalefac_band.l.length),i=e.scalefac_band.l[o],o+=t.region1_count+1,u(0<=o),u(o<e.scalefac_band.l.length),i>n&&(i=n),(a=e.scalefac_band.l[o])>n&&(a=n),r=R(e,t.table_select[0],0,i,t),r+=R(e,t.table_select[1],i,a,t),r+=R(e,t.table_select[2],a,n,t)}function A(){this.total=0}function I(e,n){var r,a,o,s,c,u=e.internal_flags;return c=u.w_ptr,-1==(s=u.h_ptr-1)&&(s=h.MAX_HEADER_BUF-1),r=u.header[s].write_timing-b,n.total=r,r>=0&&(a=1+s-c,s<c&&(a=1+s-c+h.MAX_HEADER_BUF),r-=8*a*u.sideinfo_len),r+=o=t.getframebits(e),n.total+=o,n.total%8!=0?n.total=1+n.total/8:n.total=n.total/8,n.total+=k+1,r<0&&i.err.println("strange error flushing buffer ... \n"),r}this.getframebits=function(e){var t,n=e.internal_flags;return t=0!=n.bitrate_index?d.bitrate_table[e.version][n.bitrate_index]:e.brate,u(8<=t&&t<=640),8*(0|72e3*(e.version+1)*t/e.out_samplerate+n.padding)},this.CRC_writeheader=function(e,t){var n=65535;n=P(255&t[2],n),n=P(255&t[3],n);for(var r=6;r<e.sideinfo_len;r++)n=P(255&t[r],n);t[4]=byte(n>>8),t[5]=byte(255&n)},this.flush_bitstream=function(e){var t,n,r=e.internal_flags,i=r.h_ptr-1;if(-1==i&&(i=h.MAX_HEADER_BUF-1),t=r.l3_side,!((n=I(e,new A))<0)){if(E(e,n),u(r.header[i].write_timing+this.getframebits(e)==b),r.ResvSize=0,t.main_data_begin=0,r.findReplayGain){var a=f.GetTitleGain(r.rgdata);u(NEQ(a,GainAnalysis.GAIN_NOT_ENOUGH_SAMPLES)),r.RadioGain=0|Math.floor(10*a+.5)}r.findPeakSample&&(r.noclipGainChange=0|Math.ceil(20*Math.log10(r.PeakSample/32767)*10),r.noclipGainChange>0&&(EQ(e.scale,1)||EQ(e.scale,0))?r.noclipScale=Math.floor(32767/r.PeakSample*100)/100:r.noclipScale=-1)}},this.add_dummy_byte=function(e,t,n){for(var r,i=e.internal_flags;n-- >0;)for(S(0,t,8),r=0;r<h.MAX_HEADER_BUF;++r)i.header[r].write_timing+=8},this.format_bitstream=function(e){var t,n=e.internal_flags;t=n.l3_side;var r=this.getframebits(e);E(e,t.resvDrain_pre),function(e,t){var n,r,o,s=e.internal_flags;if(n=s.l3_side,s.header[s.h_ptr].ptr=0,a.fill(s.header[s.h_ptr].buf,0,s.sideinfo_len,0),e.out_samplerate<16e3?T(s,4094,12):T(s,4095,12),T(s,e.version,1),T(s,1,2),T(s,e.error_protection?0:1,1),T(s,s.bitrate_index,4),T(s,s.samplerate_index,2),T(s,s.padding,1),T(s,e.extension,1),T(s,e.mode.ordinal(),2),T(s,s.mode_ext,2),T(s,e.copyright,1),T(s,e.original,1),T(s,e.emphasis,2),e.error_protection&&T(s,0,16),1==e.version){for(u(n.main_data_begin>=0),T(s,n.main_data_begin,9),2==s.channels_out?T(s,n.private_bits,3):T(s,n.private_bits,5),o=0;o<s.channels_out;o++){var c;for(c=0;c<4;c++)T(s,n.scfsi[o][c],1)}for(r=0;r<2;r++)for(o=0;o<s.channels_out;o++)T(s,(l=n.tt[r][o]).part2_3_length+l.part2_length,12),T(s,l.big_values/2,9),T(s,l.global_gain,8),T(s,l.scalefac_compress,4),l.block_type!=p.NORM_TYPE?(T(s,1,1),T(s,l.block_type,2),T(s,l.mixed_block_flag,1),14==l.table_select[0]&&(l.table_select[0]=16),T(s,l.table_select[0],5),14==l.table_select[1]&&(l.table_select[1]=16),T(s,l.table_select[1],5),T(s,l.subblock_gain[0],3),T(s,l.subblock_gain[1],3),T(s,l.subblock_gain[2],3)):(T(s,0,1),14==l.table_select[0]&&(l.table_select[0]=16),T(s,l.table_select[0],5),14==l.table_select[1]&&(l.table_select[1]=16),T(s,l.table_select[1],5),14==l.table_select[2]&&(l.table_select[2]=16),T(s,l.table_select[2],5),u(0<=l.region0_count&&l.regi
2on0_count<16),u(0<=l.region1_count&&l.region1_count<8),T(s,l.region0_count,4),T(s,l.region1_count,3)),T(s,l.preflag,1),T(s,l.scalefac_scale,1),T(s,l.count1table_select,1)}else for(u(n.main_data_begin>=0),T(s,n.main_data_begin,8),T(s,n.private_bits,s.channels_out),r=0,o=0;o<s.channels_out;o++){var l;T(s,(l=n.tt[r][o]).part2_3_length+l.part2_length,12),T(s,l.big_values/2,9),T(s,l.global_gain,8),T(s,l.scalefac_compress,9),l.block_type!=p.NORM_TYPE?(T(s,1,1),T(s,l.block_type,2),T(s,l.mixed_block_flag,1),14==l.table_select[0]&&(l.table_select[0]=16),T(s,l.table_select[0],5),14==l.table_select[1]&&(l.table_select[1]=16),T(s,l.table_select[1],5),T(s,l.subblock_gain[0],3),T(s,l.subblock_gain[1],3),T(s,l.subblock_gain[2],3)):(T(s,0,1),14==l.table_select[0]&&(l.table_select[0]=16),T(s,l.table_select[0],5),14==l.table_select[1]&&(l.table_select[1]=16),T(s,l.table_select[1],5),14==l.table_select[2]&&(l.table_select[2]=16),T(s,l.table_select[2],5),u(0<=l.region0_count&&l.region0_count<16),u(0<=l.region1_count&&l.region1_count<8),T(s,l.region0_count,4),T(s,l.region1_count,3)),T(s,l.scalefac_scale,1),T(s,l.count1table_select,1)}e.error_protection&&CRC_writeheader(s,s.header[s.h_ptr].buf);var d=s.h_ptr;u(s.header[d].ptr==8*s.sideinfo_len),s.h_ptr=d+1&h.MAX_HEADER_BUF-1,s.header[s.h_ptr].write_timing=s.header[d].write_timing+t,s.h_ptr==s.w_ptr&&i.err.println("Error: MAX_HEADER_BUF too small in bitstream.c \n")}(e,r);var o=8*n.sideinfo_len;if(o+=function(e){var t,n,r,i,a=0,o=e.internal_flags,s=o.l3_side;if(1==e.version)for(t=0;t<2;t++)for(n=0;n<o.channels_out;n++){var c=s.tt[t][n],d=l.slen1_tab[c.scalefac_compress],h=l.slen2_tab[c.scalefac_compress];for(i=0,r=0;r<c.sfbdivide;r++)-1!=c.scalefac[r]&&(x(o,c.scalefac[r],d),i+=d);for(;r<c.sfbmax;r++)-1!=c.scalefac[r]&&(x(o,c.scalefac[r],h),i+=h);u(i==c.part2_length),c.block_type==p.SHORT_TYPE?i+=Z(o,c):i+=M(o,c),i+=C(o,c),u(i==c.part2_3_length+c.part2_length),a+=i}else for(t=0,n=0;n<o.channels_out;n++){c=s.tt[t][n];var f,v,m=0;if(u(null!=c.sfb_partition_table),i=0,r=0,v=0,c.block_type==p.SHORT_TYPE){for(;v<4;v++){var g=c.sfb_partition_table[v]/3,y=c.slen[v];for(f=0;f<g;f++,r++)x(o,Math.max(c.scalefac[3*r+0],0),y),x(o,Math.max(c.scalefac[3*r+1],0),y),x(o,Math.max(c.scalefac[3*r+2],0),y),m+=3*y}i+=Z(o,c)}else{for(;v<4;v++)for(g=c.sfb_partition_table[v],y=c.slen[v],f=0;f<g;f++,r++)x(o,Math.max(c.scalefac[r],0),y),m+=y;i+=M(o,c)}i+=C(o,c),u(i==c.part2_3_length),u(m==c.part2_length),a+=m+i}return a}(e),E(e,t.resvDrain_post),o+=t.resvDrain_post,t.main_data_begin+=(r-o)/8,I(e,new A)!=n.ResvSize&&i.err.println("Internal buffer inconsistency. flushbits <> ResvSize"),8*t.main_data_begin!=n.ResvSize&&(i.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size:             %d \nresv drain (post)         %d \nresv drain (pre)          %d \nheader and sideinfo:      %d \ndata bits:                %d \ntotal bits:               %d (remainder: %d) \nbitsperframe:             %d \n",8*t.main_data_begin,n.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*n.sideinfo_len,o-t.resvDrain_post-8*n.sideinfo_len,o,o%8,r),i.err.println("This is a fatal error.  It has several possible causes:"),i.err.println("90%%  LAME compiled with buggy version of gcc using advanced optimizations"),i.err.println(" 9%%  Your system is overclocked"),i.err.println(" 1%%  bug in LAME encoding library"),n.ResvSize=8*t.main_data_begin),u(b%8==0),b>1e9){var s;for(s=0;s<h.MAX_HEADER_BUF;++s)n.header[s].write_timing-=b;b=0}return 0},this.copy_buffer=function(e,t,n,r,a){var o=k+1;if(o<=0)return 0;if(0!=r&&o>r)return-1;if(i.arraycopy(y,0,t,n,o),k=-1,_=0,0!=a){var l=c(1);if(l[0]=e.nMusicCRC,g.updateMusicCRC(l,t,n,o),e.nMusicCRC=l[0],o>0&&(e.VBR_seek_table.nBytesWritten+=o),e.decode_on_the_fly)for(var d,p=s([2,1152]),h=o,m=-1;0!=m;)if(m=v.hip_decode1_unclipped(e.hip,t,n,h,p[0],p[1]),h=0,-1==m&&(m=0),m>0){if(u(m<=1152),e.findPeakSample){for(d=0;d<m;d++)p[0][d]>e.PeakSample?e.PeakSample=p[0][d]:-p[0][d]>e.PeakSample&&(e.PeakSample=-p[0][d]);if(e.channels_out>1)for(d=0;d<m;d++)p[1][d]>e.PeakSample?e.PeakSample=p[1][d]:-p[1][d]>e.PeakSample&&(e.PeakSample=-p[1][d])}if(e.findReplayGain&&f.AnalyzeSamples(e.rgdata,p[0],0,p[1],0,m,e.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6}}return o},this.init_bit_stream_w=function(t){y=o(e.LAME_MAXMP3BUFFER),t.h_ptr=t.w_ptr=0,t.header[t.h_ptr].write_timing=0,k=-1,_=0,b=0}}f.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},f.NEQ=function(e,t){return!f.EQ(e,t)},e.exports=f},6935:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float),a=(r.new_float_n,r.new_int),o=(r.new_int_n,r.assert),s=n(8767),c=n(610),u=n(2963),l=n(4330
vendor: 4,570 bytes, line 2
2);e.exports=function(e){var t=e;this.quantize=t,this.iteration_loop=function(e,t,n,r){var d,p=e.internal_flags,h=i(u.SFBMAX),f=i(576),v=a(2),m=0,g=p.l3_side,y=new s(m);this.quantize.rv.ResvFrameBegin(e,y),m=y.bits;for(var b=0;b<p.mode_gr;b++){d=this.quantize.qupvt.on_pe(e,t,v,m,b,b),p.mode_ext==c.MPG_MD_MS_LR&&(this.quantize.ms_convert(p.l3_side,b),this.quantize.qupvt.reduce_side(v,n[b],m,d));for(var k=0;k<p.channels_out;k++){var _,w,x=g.tt[b][k];x.block_type!=c.SHORT_TYPE?(_=0,w=p.PSY.mask_adjust-_):(_=0,w=p.PSY.mask_adjust_short-_),p.masking_lower=Math.pow(10,.1*w),this.quantize.init_outer_loop(p,x),this.quantize.init_xrpow(p,x,f)&&(this.quantize.qupvt.calc_xmin(e,r[b][k],x,h),this.quantize.outer_loop(e,x,h,f,k,v[k])),this.quantize.iteration_finish_one(p,b,k),o(x.part2_3_length<=l.MAX_BITS_PER_CHANNEL),o(x.part2_3_length<=v[k])}}this.quantize.rv.ResvFrameEnd(p,m)}}},4869:function(e,t,n){var r=n(8768),i=r.new_float,a=r.new_int;r.assert;e.exports=function(){this.global_gain=0,this.sfb_count1=0,this.step=a(39),this.noise=i(39),this.noise_log=i(39)}},1918:function(e){e.exports=function(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}},610:function(e,t,n){var r=n(8768),i=r.System,a=r.VbrMode,o=(r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n),s=(r.new_byte,r.new_double,r.new_float),c=r.new_float_n,u=r.new_int,l=(r.new_int_n,r.assert);function d(){var e=n(6592),t=n(6868),r=n(8299),p=d.FFTOFFSET,h=d.MPG_MD_MS_LR,f=null;this.psy=null;var v=null,m=null,g=null;this.setModules=function(e,t,n,r){f=e,this.psy=t,v=t,m=r,g=n};var y=new e;this.lame_encode_mp3_frame=function(e,n,b,k,_,w){var x,S=o([2,2]);S[0][0]=new t,S[0][1]=new t,S[1][0]=new t,S[1][1]=new t;var E,T=o([2,2]);T[0][0]=new t,T[0][1]=new t,T[1][0]=new t,T[1][1]=new t;var P,C,R,Z=[null,null],M=e.internal_flags,A=c([2,4]),I=[.5,.5],O=[[0,0],[0,0]],L=[[0,0],[0,0]];if(Z[0]=n,Z[1]=b,0==M.lame_encode_frame_init&&function(e,t){var n,r,i=e.internal_flags;if(0==i.lame_encode_frame_init){var a,o,c=s(2014),u=s(2014);for(i.lame_encode_frame_init=1,a=0,o=0;a<286+576*(1+i.mode_gr);++a)a<576*i.mode_gr?(c[a]=0,2==i.channels_out&&(u[a]=0)):(c[a]=t[0][o],2==i.channels_out&&(u[a]=t[1][o]),++o);for(r=0;r<i.mode_gr;r++)for(n=0;n<i.channels_out;n++)i.l3_side.tt[r][n].block_type=d.SHORT_TYPE;y.mdct_sub48(i,c,u),l(576>=d.FFTOFFSET),l(i.mf_size>=d.BLKSIZE+e.framesize-d.FFTOFFSET),l(i.mf_size>=512+e.framesize-32)}}(e,Z),M.padding=0,(M.slot_lag-=M.frac_SpF)<0&&(M.slot_lag+=e.out_samplerate,M.padding=1),0!=M.psymodel){var D=[null,null],N=0,j=u(2);for(R=0;R<M.mode_gr;R++){for(C=0;C<M.channels_out;C++)D[C]=Z[C],N=576+576*R-d.FFTOFFSET;if(0!=(e.VBR==a.vbr_mtrh||e.VBR==a.vbr_mt?v.L3psycho_anal_vbr(e,D,N,R,S,T,O[R],L[R],A[R],j):v.L3psycho_anal_ns(e,D,N,R,S,T,O[R],L[R],A[R],j)))return-4;for(e.mode==r.JOINT_STEREO&&(I[R]=A[R][2]+A[R][3],I[R]>0&&(I[R]=A[R][3]/I[R])),C=0;C<M.channels_out;C++){var B=M.l3_side.tt[R][C];B.block_type=j[C],B.mixed_block_flag=0}}}else for(R=0;R<M.mode_gr;R++)for(C=0;C<M.channels_out;C++)M.l3_side.tt[R][C].block_type=d.NORM_TYPE,M.l3_side.tt[R][C].mixed_block_flag=0,L[R][C]=O[R][C]=700;if(function(e){var t,n;if(0!=e.ATH.useAdjust)if(n=e.loudness_sq[0][0],t=e.loudness_sq[1][0],2==e.channels_out?(n+=e.loudness_sq[0][1],t+=e.loudness_sq[1][1]):(n+=n,t+=t),2==e.mode_gr&&(n=Math.max(n,t)),n*=.5,(n*=e.ATH.aaSensitivityP)>.03125)e.ATH.adjust>=1?e.ATH.adjust=1:e.ATH.adjust<e.ATH.adjustLimit&&(e.ATH.adjust=e.ATH.adjustLimit),e.ATH.adjustLimit=1;else{var r=31.98*n+625e-6;e.ATH.adjust>=r?(e.ATH.adjust*=.075*r+.925,e.ATH.adjust<r&&(e.ATH.adjust=r)):e.ATH.adjustLimit>=r?e.ATH.adjust=r:e.ATH.adjust<e.ATH.adjustLimit&&(e.ATH.adjust=e.ATH.adjustLimit),e.ATH.adjustLimit=r}else e.ATH.adjust=1}(M),y.mdct_sub48(M,Z[0],Z[1]),M.mode_ext=d.MPG_MD_LR_LR,e.force_ms)M.mode_ext=d.MPG_MD_MS_LR;else if(e.mode==r.JOINT_STEREO){var U=0,V=0;for(R=0;R<M.mode_gr;R++)for(C=0;C<M.channels_out;C++)U+=L[R][C],V+=O[R][C];if(U<=1*V){var F=M.l3_side.tt[0],z=M.l3_side.tt[M.mode_gr-1];F[0].block_type==F[1].block_type&&z[0].block_type==z[1].block_type&&(M.mode_ext=d.MPG_MD_MS_LR)}}if(M.mode_ext==h?(E=T,P=L):(E=S,P=O),e.analysis&&null!=M.pinfo)for(R=0;R<M.mode_gr;R++)for(C=0;C<M.channels_out;C++)M.pinfo.ms_ratio[R]=M.ms_ratio[R],M.pinfo.ms_ener_ratio[R]=I[R],M.pinfo.blocktype[R][C]=M.l3_side.tt[R][C].block_type,M.pinfo.pe[R][C]=P[R][C],i.arraycopy(M.l3_side.tt[R][C].xr,0,M.pinfo.xr[R][C],0,576),M.mode_ext==h&&(M.pinfo.ers[R][C]=M.pinfo.ers[R][C+2],i.arraycopy(M.pinfo.energy[R][C+2],0,M.pinfo.energy[R][C],0,M.pinfo.energy[R][C].length));
2if(e.VBR==a.vbr_off||e.VBR==a.vbr_abr){var H,q;for(H=0;H<18;H++)M.nsPsy.pefirbuf[H]=M.nsPsy.pefirbuf[H+1];for(q=0,R=0;R<M.mode_gr;R++)for(C=0;C<M.channels_out;C++)q+=P[R][C];for(M.nsPsy.pefirbuf[18]=q,q=M.nsPsy.pefirbuf[9],H=0;H<9;H++)q+=(M.nsPsy.pefirbuf[H]+M.nsPsy.pefirbuf[18-H])*d.fircoef[H];for(q=3350*M.mode_gr*M.channels_out/q,R=0;R<M.mode_gr;R++)for(C=0;C<M.channels_out;C++)P[R][C]*=q}if(M.iteration_loop.iteration_loop(e,P,I,E),f.format_bitstream(e),x=f.copy_buffer(M,k,_,w,1),e.bWriteVbrTag&&m.addVbrFrame(e),e.analysis&&null!=M.pinfo){for(C=0;C<M.channels_out;C++){var G;for(G=0;G<p;G++)M.pinfo.pcmdata[C][G]=M.pinfo.pcmdata[C][G+e.framesize];for(G=p;G<1600;G++)M.pinfo.pcmdata[C][G]=Z[C][G-p]}g.set_frame_pinfo(e,E)}return function(e){var t,n;for(l(0<=e.bitrate_index&&e.bitrate_index<16),l(0<=e.mode_ext&&e.mode_ext<4),e.bitrate_stereoMode_Hist[e.bitrate_index][4]++,e.bitrate_stereoMode_Hist[15][4]++,2==e.channels_out&&(e.bitrate_stereoMode_Hist[e.bitrate_index][e.mode_ext]++,e.bitrate_stereoMode_Hist[15][e.mode_ext]++),t=0;t<e.mode_gr;++t)for(n=0;n<e.channels_out;++n){var r=0|e.l3_side.tt[t][n].block_type;0!=e.l3_side.tt[t][n].mixed_block_flag&&(r=4),e.bitrate_blockType_Hist[e.bitrate_index][r]++,e.bitrate_blockType_Hist[e.bitrate_index][5]++,e.bitrate_blockType_Hist[15][r]++,e.bitrate_blockType_Hist[15][5]++}}(M),x}}d.ENCDELAY=576,d.POSTDELAY=1152,d.MDCTDELAY=48,d.FFTOFFSET=224+d.MDCTDELAY,d.DECDELAY=528,d.SBLIMIT=32,d.CBANDS=64,d.SBPSY_l=21,d.SBPSY_s=12,d.SBMAX_l=22,d.SBMAX_s=13,d.PSFB21=6,d.PSFB12=6,d.BLKSIZE=1024,d.HBLKSIZE=d.BLKSIZE/2+1,d.BLKSIZE_s=256,d.HBLKSIZE_s=d.BLKSIZE_s/2+1,d.NORM_TYPE=0,d.START_TYPE=1,d.SHORT_TYPE=2,d.STOP_TYPE=3,d.MPG_MD_LR_LR=0,d.MPG_MD_LR_I=1,d.MPG_MD_MS_LR=2,d.MPG_MD_MS_I=3,d.fircoef=[-.1039435,-.1892065,5*-.0432472,-.155915,3898045e-23,.0467745*5,.50455,.756825,.187098*5],e.exports=d},4525:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util),a=(r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float),o=(r.new_float_n,r.new_int,r.new_int_n,r.assert,n(610));e.exports=function(){var e=a(o.BLKSIZE),t=a(o.BLKSIZE_s/2),n=[.9238795325112867,.3826834323650898,.9951847266721969,.0980171403295606,.9996988186962042,.02454122852291229,.9999811752826011,.006135884649154475];function r(e,t,r){var a,o,s,c=0,u=t+(r<<=1);a=4;do{var l,d,p,h,f,v,m;m=a>>1,v=(f=a<<1)+(h=a),a=f<<1,s=(o=t)+m;do{x=e[o+0]-e[o+h],w=e[o+0]+e[o+h],P=e[o+f]-e[o+v],E=e[o+f]+e[o+v],e[o+f]=w-E,e[o+0]=w+E,e[o+v]=x-P,e[o+h]=x+P,x=e[s+0]-e[s+h],w=e[s+0]+e[s+h],P=i.SQRT2*e[s+v],E=i.SQRT2*e[s+f],e[s+f]=w-E,e[s+0]=w+E,e[s+v]=x-P,e[s+h]=x+P,s+=a,o+=a}while(o<u);for(d=n[c+0],l=n[c+1],p=1;p<m;p++){var g,y;g=1-2*l*l,y=2*l*d,o=t+p,s=t+h-p;do{var b,k,_,w,x,S,E,T,P,C;k=y*e[o+h]-g*e[s+h],b=g*e[o+h]+y*e[s+h],x=e[o+0]-b,w=e[o+0]+b,S=e[s+0]-k,_=e[s+0]+k,k=y*e[o+v]-g*e[s+v],b=g*e[o+v]+y*e[s+v],P=e[o+f]-b,E=e[o+f]+b,C=e[s+f]-k,T=e[s+f]+k,k=l*E-d*C,b=d*E+l*C,e[o+f]=w-b,e[o+0]=w+b,e[s+v]=S-k,e[s+h]=S+k,k=d*T-l*P,b=l*T+d*P,e[s+f]=_-b,e[s+0]=_+b,e[o+v]=x-k,e[o+h]=x+k,s+=a,o+=a}while(o<u);d=(g=d)*n[c+0]-l*n[c+1],l=g*n[c+1]+l*n[c+0]}c+=2}
2while(a<r)}var s=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254];this.fft_short=function(e,n,i,a,c){for(var u=0;u<3;u++){var l=o.BLKSIZE_s/2,d=65535&192*(u+1),p=o.BLKSIZE_s/8-1;do{var h,f,v,m,g,y=255&s[p<<2];f=(h=t[y]*a[i][c+y+d])-(g=t[127-y]*a[i][c+y+d+128]),h+=g,m=(v=t[y+64]*a[i][c+y+d+64])-(g=t[63-y]*a[i][c+y+d+192]),v+=g,l-=4,n[u][l+0]=h+v,n[u][l+2]=h-v,n[u][l+1]=f+m,n[u][l+3]=f-m,f=(h=t[y+1]*a[i][c+y+d+1])-(g=t[126-y]*a[i][c+y+d+129]),h+=g,m=(v=t[y+65]*a[i][c+y+d+65])-(g=t[62-y]*a[i][c+y+d+193]),v+=g,n[u][l+o.BLKSIZE_s/2+0]=h+v,n[u][l+o.BLKSIZE_s/2+2]=h-v,n[u][l+o.BLKSIZE_s/2+1]=f+m,n[u][l+o.BLKSIZE_s/2+3]=f-m}while(--p>=0);r(n[u],l,o.BLKSIZE_s/2)}},this.fft_long=function(t,n,i,a,c){var u=o.BLKSIZE/8-1,l=o.BLKSIZE/2;do{var d,p,h,f,v,m=255&s[u];p=(d=e[m]*a[i][c+m])-(v=e[m+512]*a[i][c+m+512]),d+=v,f=(h=e[m+256]*a[i][c+m+256])-(v=e[m+768]*a[i][c+m+768]),h+=v,n[(l-=4)+0]=d+h,n[l+2]=d-h,n[l+1]=p+f,n[l+3]=p-f,p=(d=e[m+1]*a[i][c+m+1])-(v=e[m+513]*a[i][c+m+513]),d+=v,f=(h=e[m+257]*a[i][c+m+257])-(v=e[m+769]*a[i][c+m+769]),h+=v,n[l+o.BLKSIZE/2+0]=d+h,n[l+o.BLKSIZE/2+2]=d-h,n[l+o.BLKSIZE/2+1]=p+f,n[l+o.BLKSIZE/2+3]=p-f}while(--u>=0);r(n,l,o.BLKSIZE/2)},this.init_fft=function(n){for(var r=0;r<o.BLKSIZE;r++)e[r]=.42-.5*Math.cos(2*Math.PI*(r+.5)/o.BLKSIZE)+.08*Math.cos(4*Math.PI*(r+.5)/o.BLKSIZE);for(r=0;r<o.BLKSIZE_s/2;r++)t[r]=.5*(1-Math.cos(2*Math.PI*(r+.5)/o.BLKSIZE_s))}}},7932:function(e,t,n){var r=n(8768),i=r.System,a=(r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays);r.new_array_n,r.new_byte,r.new_double,r.new_float,r.new_float_n,r.new_int,r.new_int_n,r.assert;function o(){o.YULE_ORDER,o.MAX_SAMP_FREQ;var e=o.RMS_WINDOW_TIME_NUMERATOR,t=o.RMS_WINDOW_TIME_DENOMINATOR,n=(o.MAX_SAMPLES_PER_WINDOW,[[.038575994352,-3.84664617118067,-.02160367184185,7.81501653005538,-.00123395316851,-11.34170355132042,-9291677959e-14,13.05504219327545,-.01655260341619,-12.28759895145294,.02161526843274,9.4829380631979,-.02074045215285,-5.87257861775999,.00594298065125,2.75465861874613,.00306428023191,-.86984376593551,.00012025322027,.13919314567432,.00288463683916],[.0541865640643,-3.47845948550071,-.02911007808948,6.36317777566148,-.00848709379851,-8.54751527471874,-.00851165645469,9.4769360780128,-.00834990904936,-8.81498681370155,.02245293253339,6.85401540936998,-.02596338512915,-4.39470996079559,.01624864962975,2.19611684890774,-.00240879051584,-.75104302451432,.00674613682247,.13149317958808,-.00187763777362],[.15457299681924,-2.37898834973084,-.09331049056315,2.84868151156327,-.06247880153653,-2.64577170229825,.02163541888798,2.23697657451713,-.05588393329856,-1.67148153367602,.04781476674921,1.00595954808547,.00222312597743,-.45953458054983,.03174092540049,.16378164858596,-.01390589421898,-.05032077717131,.00651420667831,.0234789740702,-.00881362733839],[.30296907319327,-1.61273165137247,-.22613988682123,1.0797749225997,-.08587323730772,-.2565625775407,.03282930172664,-.1627671912044,-.00915702933434,-.22638893773906,-.02364141202522,.39120800788284,-.00584456039913,-.22138138954925,.06276101321749,.04500235387352,-828086748e-14,.02005851806501,.00205861885564,.00302439095741,-.02950134983287],[.33642304856132,-1.49858979367799,-.2557224142557,.87350271418188,-.11828570177555,.12205022308084,.11921148675203,-.80774944671438,-.07834489609479,.47854794562326,-.0046997791438,-.12453458140019,-.0058950022444,-.04067510197014,.05724228140351,.08333755284107,.00832043980773,-.04237348025746,-.0163538138454,.02977207319925,-.0176017656815],[.4491525660845,-.62820619233671,-.14351757464547,.29661783706366,-.22784394429749,-.372563729424,-.01419140100551,.00213767857124,.04078262797139,-.42029820170918,-.12398163381748,.22199650564824,.04097565135648,.00613424350682,.10478503600251,.06747620744683,-.01863887810927,.05784820375801,-.03193428438915,.03222754072173,.00541907748707],[.56619470757641,-1.04800335126349,-.75464456939302,.29156311971249,.1624213774223,-.26806001042947,.16744243493672,.00819999645858,-.18901604199609,.45054734505008,.3093178284183,-.33032403314006,-.27562961986224,.0673936833311,.00647310677246,-.04784254229033,.08647503780351,.01639907836189,-.0378898455484,.01807364323573,-.00588215443421],[.58100494960553,-.51035327095184,-.53174909058578,-.31863563325245,-.14289799034253,-.20256413484477,.17520704835522,.1472815413433,.02377945217615,.38952639978999,.15558449135573,-.23313271880868,-.25344790059353,-.05246019024463,.01628462406333,-.02505961724053,.06920467763959,.02442357316099,-.03721611395801,.01818801111503,-.00749618797172],[.53648789255105,-.2504987195602,-.42163034350696,-.43193942311114,-.00275953611929,-.03424681017675,.04267842219415,-.04678328784242,-.10214864179676,.264083
vendor: 6,320 bytes, line 2
200200955,.14590772289388,.15113130533216,-.02459864859345,-.17556493366449,-.11202315195388,-.18823009262115,-.04060034127,.05477720428674,.0478866554818,.0470440968812,-.02217936801134]]),r=[[.98621192462708,-1.97223372919527,-1.97242384925416,.97261396931306,.98621192462708],[.98500175787242,-1.96977855582618,-1.97000351574484,.9702284756635,.98500175787242],[.97938932735214,-1.95835380975398,-1.95877865470428,.95920349965459,.97938932735214],[.97531843204928,-1.95002759149878,-1.95063686409857,.95124613669835,.97531843204928],[.97316523498161,-1.94561023566527,-1.94633046996323,.94705070426118,.97316523498161],[.96454515552826,-1.92783286977036,-1.92909031105652,.93034775234268,.96454515552826],[.96009142950541,-1.91858953033784,-1.92018285901082,.92177618768381,.96009142950541],[.95856916599601,-1.9154210807478,-1.91713833199203,.91885558323625,.95856916599601],[.94597685600279,-1.88903307939452,-1.89195371200558,.89487434461664,.94597685600279]];function s(e,t,n,r,i,a){for(;0!=i--;)n[r]=1e-10+e[t+0]*a[0]-n[r-1]*a[1]+e[t-1]*a[2]-n[r-2]*a[3]+e[t-2]*a[4]-n[r-3]*a[5]+e[t-3]*a[6]-n[r-4]*a[7]+e[t-4]*a[8]-n[r-5]*a[9]+e[t-5]*a[10]-n[r-6]*a[11]+e[t-6]*a[12]-n[r-7]*a[13]+e[t-7]*a[14]-n[r-8]*a[15]+e[t-8]*a[16]-n[r-9]*a[17]+e[t-9]*a[18]-n[r-10]*a[19]+e[t-10]*a[20],++r,++t}function c(e,t,n,r,i,a){for(;0!=i--;)n[r]=e[t+0]*a[0]-n[r-1]*a[1]+e[t-1]*a[2]-n[r-2]*a[3]+e[t-2]*a[4],++r,++t}function u(e){return e*e}this.InitGainAnalysis=function(n,r){return function(n,r){for(var i=0;i<MAX_ORDER;i++)n.linprebuf[i]=n.lstepbuf[i]=n.loutbuf[i]=n.rinprebuf[i]=n.rstepbuf[i]=n.routbuf[i]=0;switch(0|r){case 48e3:n.reqindex=0;break;case 44100:n.reqindex=1;break;case 32e3:n.reqindex=2;break;case 24e3:n.reqindex=3;break;case 22050:n.reqindex=4;break;case 16e3:n.reqindex=5;break;case 12e3:n.reqindex=6;break;case 11025:n.reqindex=7;break;case 8e3:n.reqindex=8;break;default:return INIT_GAIN_ANALYSIS_ERROR}return n.sampleWindow=0|(r*e+t-1)/t,n.lsum=0,n.rsum=0,n.totsamp=0,a.ill(n.A,0),INIT_GAIN_ANALYSIS_OK}(n,r)!=INIT_GAIN_ANALYSIS_OK?INIT_GAIN_ANALYSIS_ERROR:(n.linpre=MAX_ORDER,n.rinpre=MAX_ORDER,n.lstep=MAX_ORDER,n.rstep=MAX_ORDER,n.lout=MAX_ORDER,n.rout=MAX_ORDER,a.fill(n.B,0),INIT_GAIN_ANALYSIS_OK)},this.AnalyzeSamples=function(e,t,a,l,d,p,h){var f,v,m,g,y,b,k;if(0==p)return GAIN_ANALYSIS_OK;switch(k=0,y=p,h){case 1:l=t,d=a;break;case 2:break;default:return GAIN_ANALYSIS_ERROR}for(p<MAX_ORDER?(i.arraycopy(t,a,e.linprebuf,MAX_ORDER,p),i.arraycopy(l,d,e.rinprebuf,MAX_ORDER,p)):(i.arraycopy(t,a,e.linprebuf,MAX_ORDER,MAX_ORDER),i.arraycopy(l,d,e.rinprebuf,MAX_ORDER,MAX_ORDER));y>0;){b=y>e.sampleWindow-e.totsamp?e.sampleWindow-e.totsamp:y,k<MAX_ORDER?(f=e.linpre+k,v=e.linprebuf,m=e.rinpre+k,g=e.rinprebuf,b>MAX_ORDER-k&&(b=MAX_ORDER-k)):(f=a+k,v=t,m=d+k,g=l),s(v,f,e.lstepbuf,e.lstep+e.totsamp,b,n[e.reqindex]),s(g,m,e.rstepbuf,e.rstep+e.totsamp,b,n[e.reqindex]),c(e.lstepbuf,e.lstep+e.totsamp,e.loutbuf,e.lout+e.totsamp,b,r[e.reqindex]),c(e.rstepbuf,e.rstep+e.totsamp,e.routbuf,e.rout+e.totsamp,b,r[e.reqindex]),f=e.lout+e.totsamp,v=e.loutbuf,m=e.rout+e.totsamp,g=e.routbuf;for(var _=b%8;0!=_--;)e.lsum+=u(v[f++]),e.rsum+=u(g[m++]);for(_=b/8;0!=_--;)e.lsum+=u(v[f+0])+u(v[f+1])+u(v[f+2])+u(v[f+3])+u(v[f+4])+u(v[f+5])+u(v[f+6])+u(v[f+7]),f+=8,e.rsum+=u(g[m+0])+u(g[m+1])+u(g[m+2])+u(g[m+3])+u(g[m+4])+u(g[m+5])+u(g[m+6])+u(g[m+7]),m+=8;if(y-=b,k+=b,e.totsamp+=b,e.totsamp==e.sampleWindow){var w=10*o.STEPS_per_dB*Math.log10((e.lsum+e.rsum)/e.totsamp*.5+1e-37),x=w<=0?0:0|w;x>=e.A.length&&(x=e.A.length-1),e.A[x]++,e.lsum=e.rsum=0,i.arraycopy(e.loutbuf,e.totsamp,e.loutbuf,0,MAX_ORDER),i.arraycopy(e.routbuf,e.totsamp,e.routbuf,0,MAX_ORDER),i.arraycopy(e.lstepbuf,e.totsamp,e.lstepbuf,0,MAX_ORDER),i.arraycopy(e.rstepbuf,e.totsamp,e.rstepbuf,0,MAX_ORDER),e.totsamp=0}if(e.totsamp>e.sampleWindow)return GAIN_ANALYSIS_ERROR}return p<MAX_ORDER?(i.arraycopy(e.linprebuf,p,e.linprebuf,0,MAX_ORDER-p),i.arraycopy(e.rinprebuf,p,e.rinprebuf,0,MAX_ORDER-p),i.arraycopy(t,a,e.linprebuf,MAX_ORDER-p,p),i.arraycopy(l,d,e.rinprebuf,MAX_ORDER-p,p)):(i.arraycopy(t,a+p-MAX_ORDER,e.linprebuf,0,MAX_ORDER),i.arraycopy(l,d+p-MAX_ORDER,e.rinprebuf,0,MAX_ORDER)),GAIN_ANALYSIS_OK},this.GetTitleGain=function(e){for(var t=function(e,t){var n,r=0;for(n=0;n<t;n++)r+=e[n];if(0==r)return GAIN_NOT_ENOUGH_SAMPLES;var i=0|Math.ceil(r*(1-.95));for(n=t;n-- >0&&!((i-=e[n])<=0););return 64.82-n/o.STEPS_per_dB}(e.A,e.A.length),n=0;n<e.A.length;n++)e.B[n]+=e.A[n],e.A[n]=0;for(n=0;n<MAX_ORDER;n++)e.linprebuf[n]=e.lstepbuf[n]=e.loutbuf[n]=e.rinprebuf[n]=e.rstepbuf[n]=e.routbuf[n]=0;return e.totsamp=0,e.lsum=e.rsum=0,t}}o.STEPS_per_dB=100,o.MAX_dB=120,o.GAIN_NOT_ENOUGH_SAMPLES=-24601,o.GAIN_ANALYSIS_ERROR=0,o.GAIN_ANALYSIS_OK=1,o.INIT_GAIN_ANALYSIS_ERROR=0,o.INIT_GAIN_ANALYSIS_OK=1,o.YULE_ORDER=10,o.MAX_ORDER=o.YULE_ORDER,o.MAX_SAMP_FREQ=48e3,o.RMS_WINDOW_TIME_NUMERATOR=1,o.RMS_WINDOW_TIME_DENOMINATOR=20,o.MAX_SAMPLES_PER_WINDOW=o.MAX_SAMP_FREQ*o.RMS_WINDOW_TIME_NUMERATOR/o.RMS_WINDOW_TIME_DENOMINATOR+1,e.exports=o},637:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float),a=(r.new_float_n,r.new_int),o=(r.new_int_n,r.assert,n(2963));e.exports=function(){this.xr=i(576),this.l3_enc=a(576),this.scalefac=a(o.SFBMAX),this.xrpow_max=0,this.part2_3_length=0,this.big_values=0,this.count1=0,this.global_gain=0,this.scalefac_compress=0,this.block_type=0,this.mixed_block_flag=0,this.table_select=a(3),this.subblock_gain=a(4),this.region0_count=0,this.region1_count=0,this.preflag=0,this.scalefac_scale=0,this.count1table_select=0,this.part2_length=0,this.sfb_lmax=0,this.sfb_smin=0,this.psy_lmax=0,this.sfbmax=0,this.psymax=0,this.sfbdivide=0,this.width=a(o.SFBMAX),this.window=a(o.SFBMAX),this.count1bits=0,this.sfb_partition_table=null,this.slen=a(4),this.max_nonzero_coeff=0;var e=this;function t(e){return new Int32Array(e)}this.assign=function(n){var r;e.xr=(r=n.xr,new Float32Array(r)),e.l3_enc=t(n.l3_enc),e.scalefac=t(n.scalefac),e.xrpow_max=n.xrpow_max,e.part2_3_length=n.part2_3_length,e.big_values=n.big_values,e.count1=n.count1,e.global_gain=n.global_gain,e.scalefac_compress=n.scalefac_compress,e.block_type=n.block_type,e.mixed_block_flag=n.mixed_block_flag,e.table_select=t(n.table_select),e.subblock_gain=t(n.subblock_gain),e.regi
2on0_count=n.region0_count,e.region1_count=n.region1_count,e.preflag=n.preflag,e.scalefac_scale=n.scalefac_scale,e.count1table_select=n.count1table_select,e.part2_length=n.part2_length,e.sfb_lmax=n.sfb_lmax,e.sfb_smin=n.sfb_smin,e.psy_lmax=n.psy_lmax,e.sfbmax=n.sfbmax,e.psymax=n.psymax,e.sfbdivide=n.sfbdivide,e.width=t(n.width),e.window=t(n.window),e.count1bits=n.count1bits,e.sfb_partition_table=n.sfb_partition_table.slice(0),e.slen=t(n.slen),e.max_nonzero_coeff=n.max_nonzero_coeff}}},8032:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float,r.new_float_n,r.new_int),a=(r.new_int_n,r.assert,n(637));e.exports=function(){this.tt=[[null,null],[null,null]],this.main_data_begin=0,this.private_bits=0,this.resvDrain_pre=0,this.resvDrain_post=0,this.scfsi=[i(4),i(4)];for(var e=0;e<2;e++)for(var t=0;t<2;t++)this.tt[e][t]=new a}},6868:function(e,t,n){var r=n(8906);e.exports=function(){this.thm=new r,this.en=new r}},8906:function(e,t,n){var r=n(610),i=n(8768),a=i.System,o=(i.VbrMode,i.Float,i.ShortBlock,i.Util,i.Arrays,i.new_array_n,i.new_byte,i.new_double,i.new_float),s=i.new_float_n;i.new_int,i.new_int_n,i.assert;e.exports=function(){this.l=o(r.SBMAX_l),this.s=s([r.SBMAX_s,3]);var e=this;this.assign=function(t){a.arraycopy(t.l,0,e.l,0,r.SBMAX_l);for(var n=0;n<r.SBMAX_s;n++)for(var i=0;i<3;i++)e.s[n][i]=t.s[n][i]}}},2963:function(e,t,n){var r=n(610),i={};i.SFBMAX=3*r.SBMAX_s,e.exports=i},7589:function(e,t,n){var r=n(8768),i=r.System,a=r.VbrMode,o=(r.Float,r.ShortBlock),s=(r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float),c=(r.new_float_n,r.new_int,r.new_int_n),u=r.new_short_n,l=r.assert,d=n(8817),p=n(9482),h=n(4330),f=n(8828),v=n(4397),m=n(6935),g=n(6435),y=n(2804),b=n(610);e.exports=function e(){var t,r,k,_,w,x=n(8299),S=this;e.V9=410,e.V8=420,e.V7=430,e.V6=440,e.V5=450,e.V4=460,e.V3=470,e.V2=480,e.V1=490,e.V0=500,e.R3MIX=1e3,e.STANDARD=1001,e.EXTREME=1002,e.INSANE=1003,e.STANDARD_FAST=1004,e.EXTREME_FAST=1005,e.MEDIUM=1006,e.MEDIUM_FAST=1007,e.LAME_MAXMP3BUFFER=147456;var E,T,P,C=new d;function R(){this.mask_adjust=0,this.mask_adjust_short=0,this.bo_l_weight=s(b.SBMAX_l),this.bo_s_weight=s(b.SBMAX_s)}function Z(){this.lowerlimit=0}function M(e,t){this.lowpass=t}this.enc=new b,this.setModules=function(e,n,i,a,o,s,c,u,l){t=e,r=n,k=i,_=a,w=o,E=s,c,T=u,P=l,this.enc.setModules(r,C,_,E)};var A=4294479419;function I(e){return e>1?0:e<=0?1:Math.cos(Math.PI/2*e)}function O(e,t){switch(e){case 44100:return t.version=1,0;case 48e3:return t.version=1,1;case 32e3:return t.version=1,2;case 22050:case 11025:return t.version=0,0;case 24e3:case 12e3:return t.version=0,1;case 16e3:case 8e3:return t.version=0,2;default:return t.version=0,-1}}function L(e,t,n){n<16e3&&(t=2);for(var r=y.bitrate_table[t][1],i=2;i<=14;i++)y.bitrate_table[t][i]>0&&Math.abs(y.bitrate_table[t][i]-e)<Math.abs(r-e)&&(r=y.bitrate_table[t][i]);return r}function D(e,t,n){n<16e3&&(t=2);for(var r=0;r<=14;r++)if(y.bitrate_table[t][r]>0&&y.bitrate_table[t][r]==e)return r;return-1}function N(e,t){var n=[new M(8,2e3),new M(16,3700),new M(24,3900),new M(32,5500),new M(40,7e3),new M(48,7500),new M(56,1e4),new M(64,11e3),new M(80,13500),new M(96,15100),new M(112,15600),new M(128,17e3),new M(160,17500),new M(192,18600),new M(224,19400),new M(256,19700),new M(320,20500)],r=S.nearestBitrateFullIndex(t);e.lowerlimit=n[r].lowpass}function j(e){var t=b.BLKSIZE+e.framesize-b.FFTOFFSET;return t=Math.max(t,512+e.framesize-32),l(h.MFSIZE>=t),t}function B(e,t,n,r,i,a){var o=S.enc.lame_encode_mp3_frame(e,t,n,r,i,a);return e.frameNum++,o}function U(){this.n_in=0,this.n_out=0}function V(){this.num_used=0}function F(e,t){return 0!=t?F(t,e%t):e}function z(e,t,n){var r=Math.PI*t;(e/=n)<0&&(e=0),e>1&&(e=1);var i=e-.5,a=.42-.5*Math.cos(2*e*Math.PI)+.08*Math.cos(4*e*Math.PI);return Math.abs(i)<1e-9?r/Math.PI:a*Math.sin(n*r*i)/(Math.PI*n*i)}function H(e,t,n,r,i,a,o,c,u){var d,p,f=e.internal_flags,v=0,m=e.out_samplerate/F(e.out_samplerate,e.in_samplerate);m>h.BPC&&(m=h.BPC);var g=Math.abs(f.resample_ratio-Math.floor(.5+f.resample_ratio))<1e-4?1:0,y=1/f.resample_ratio;y>1&&(y=1);var b=31;0==b%2&&--b;var k=(b+=g)+1;if(0==f.fill_buffer_resample_init){for(f.inbuf_old[0]=s(k),f.inbuf_old[1]=s(k),d=0;d<=2*m;++d)f.blackfilt[d]=s(k);for(f.itime[0]=0,f.itime[1]=0,v=0;v<=2*m;v++){var _=0,w=(v-m)/(2*m);for(d=0;d<=b;d++)_+=f.blackfilt[v][d]=z(d-w,y,b);for(d=0;d<=b;d++)f.blackfilt[v][d]/=_}f.fill_buffer_resample_init=1}var x=f.inbuf_old[u];for(p=0;p<r;p++){var S,E;if(S=p*f.resample_ratio,b+(v=0|Math.floor(S-f.itime[u]))-b/2>=o)break;w=S-f.itime[u]-(v+b%2*.5);l(Math.abs(w)<=.501),E=0|Math.floor(2*w*m+m+.5);var T=0;for(d=0;d<=b;++d){var P=0|d+v-b/2;l(P<o),l(P+k>=0),T+=(P<0?x[k+P]:i[a+P])*f.blackfilt[E][d]}t[n+p]=T}if(c.num_used=Math.min(o,b+v-b/2),f.itime[u]+=c.num_used-p*f.resample_ratio,c.num_used>=k)for(d=0;d<k;d++)x[d]=i[a+c.num_used+d-k];else{var C=k-c.num_used;for(d=0;d<C;++d)x[d]=x[d+c.num_used];for(v=0;d<k;++d,++v)x[d]=i[a+v];l(v==c.num_used)}return p}function q(e,t,n,r,i,a){var o=e.internal_flags;if(o.resample_ratio<.9999||o.resample_ratio>1.0001)for(var s=0;s<o.channels_out;s++){var c=new V;a.n_out=H(e,t[s],o.mf_size,e.framesize,n[s],r,i,c,s),a.n_in=c.num_used}else{a.n_out=Math.min(e.framesize,i),a.n_in=a.n_out;for(var u=0;u<a.n_out;++u)t[0][o.mf_size+u]=n[0][r+u],2==o.channels_out&&(t[1][o.mf_size+u]=n[1][r+u])}}this.lame_init=function(){var e=new p,t=function(e){var t;return e.class_id=A,t=e.internal_flags=new h,e.mode=x.NOT_SET,e.original=1,e.in_samplerate=44100,e.num_channels=2,e.num_samples=-1,e.bWriteVbrTag=!0,e.quality=-1,e.short_blocks=null,t.subblock_gain=-1,e.lowpassfreq=0,e.highpassfreq=0,e.lowpasswidth=-1,e.highpasswidth=-1,e.VBR=a.vbr_off,e.VBR_q=4,e.ATHcurve=-1,e.VBR_mean_bitrate_kbps=128,e.VBR_min_bitrate_kbps=0,e.VBR_max_bitrate_kbps=0,e.VBR_hard_min=0,t.VBR_min_bitrate=1,t.VBR_max_bitrate=13,e.quant_comp=-1,e.quant_comp_short=-1,e.msfix=-1,t.resample_ratio=1,t.OldValue[0]=180,t.OldValue[1]=180,t.CurrentStep[0]=4,t.CurrentStep[1]=4,t.masking_lower=1,t.nsPsy.attackthre=-1,t.nsPsy.attackthre_s=-1,e.scale=-1,e.athaa_type=-1,e.ATHtype=-1,e.athaa_loudapprox=-1,e.athaa_sensitivity=0,e.useTemporal=null,e.interChRatio=-1,t.mf_samples_to_encode=b.ENCDELAY+b.POSTDELAY,e.encoder_padding=0,t.mf_size=b.ENCDELAY-b.MDCTDELAY,e.findReplayGain=!1,e.decode_on_the_fly=!1,t.decode_on_the_fly=!1,t.findReplayGain=!1,t.findPeakSample=!1,t.RadioGain=0,t.AudiophileGain=0,t.noclipGainChange=0,t.noclipScale=-1,e.preset=0,e.write_id3tag_automatic=!0,0}(e);return 0!=t?null:(e.lame_allocated_gfp=1,e)},this.nearestBitrateFullIndex=function(e){var t=[8,16,24,32,40,48,56,64,80,96,112,128,160,192,224,256,320],n=0,r=0,i=0,a=0;a=t[16],i=16,r=t[16],n=16;for(var o=0;o<16;o++)if(Math.max(e,t[o+1])!=e){a=t[o+1],i=o+1,r=t[o],n=o;break}return a-e>e-r?n:i},this.lame_init_params=function(e){var n=e.internal_flags;if(n.Class_ID=0,null==n.ATH&&(n.ATH=new f),null==n.PSY&&(n.PSY=new R),null==n.rgdata&&(n.rgdata=new v),n.channels_in=e.num_channels,1==n.channels_in&&(e.mode=x.MONO),n.channels_out=e.mode==x.MONO?1:2,n.mode_ext=b.MPG_MD_MS_LR,e.mode==x.MONO&&(e.force_ms=!1),e.VBR==a.vbr_off&&128!=e.VBR_mean_bitrate_kbps&&0==e.brate&&(e.brate=e.VBR_mean_bitrate_kbps),e.V
vendor: 1,268 bytes, line 2
2BR==a.vbr_off||e.VBR==a.vbr_mtrh||e.VBR==a.vbr_mt||(e.free_format=!1),e.VBR==a.vbr_off&&0==e.brate&&g.EQ(e.compression_ratio,0)&&(e.compression_ratio=11.025),e.VBR==a.vbr_off&&e.compression_ratio>0&&(0==e.out_samplerate&&(e.out_samplerate=map2MP3Frequency(int(.97*e.in_samplerate))),e.brate=0|16*e.out_samplerate*n.channels_out/(1e3*e.compression_ratio),n.samplerate_index=O(e.out_samplerate,e),e.free_format||(e.brate=L(e.brate,e.version,e.out_samplerate))),0!=e.out_samplerate&&(e.out_samplerate<16e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,64)):e.out_samplerate<32e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,160)):(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,32),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320))),0==e.lowpassfreq){var s=16e3;switch(e.VBR){case a.vbr_off:N(u=new Z,e.brate),s=u.lowerlimit;break;case a.vbr_abr:var u;N(u=new Z,e.VBR_mean_bitrate_kbps),s=u.lowerlimit;break;case a.vbr_rh:var p=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=e.VBR_q&&e.VBR_q<=9){var h=p[e.VBR_q],S=p[e.VBR_q+1],M=e.VBR_q_frac;s=linear_int(h,S,M)}else s=19500;break;
2default:p=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=e.VBR_q&&e.VBR_q<=9){h=p[e.VBR_q],S=p[e.VBR_q+1],M=e.VBR_q_frac;s=linear_int(h,S,M)}else s=19500}e.mode!=x.MONO||e.VBR!=a.vbr_off&&e.VBR!=a.vbr_abr||(s*=1.5),e.lowpassfreq=0|s}if(0==e.out_samplerate&&(2*e.lowpassfreq>e.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=function(e,t){var n=44100;return t>=48e3?n=48e3:t>=44100?n=44100:t>=32e3?n=32e3:t>=24e3?n=24e3:t>=22050?n=22050:t>=16e3?n=16e3:t>=12e3?n=12e3:t>=11025?n=11025:t>=8e3&&(n=8e3),-1==e?n:(e<=15960&&(n=44100),e<=15250&&(n=32e3),e<=11220&&(n=24e3),e<=9970&&(n=22050),e<=7230&&(n=16e3),e<=5420&&(n=12e3),e<=4510&&(n=11025),e<=3970&&(n=8e3),t<n?t>44100?48e3:t>32e3?44100:t>24e3?32e3:t>22050?24e3:t>16e3?22050:t>12e3?16e3:t>11025?12e3:t>8e3?11025:8e3:n)}(0|e.lowpassfreq,e.in_samplerate)),e.lowpassfreq=Math.min(20500,e.lowpassfreq),e.lowpassfreq=Math.min(e.out_samplerate/2,e.lowpassfreq),e.VBR==a.vbr_off&&(e.compression_ratio=16*e.out_samplerate*n.channels_out/(1e3*e.brate)),e.VBR==a.vbr_abr&&(e.compression_ratio=16*e.out_samplerate*n.channels_out/(1e3*e.VBR_mean_bitrate_kbps)),e.bWriteVbrTag||(e.findReplayGain=!1,e.decode_on_the_fly=!1,n.findPeakSample=!1),n.findReplayGain=e.findReplayGain,n.decode_on_the_fly=e.decode_on_the_fly,n.decode_on_the_fly&&(n.findPeakSample=!0),n.findReplayGain&&t.InitGainAnalysis(n.rgdata,e.out_samplerate)==GainAnalysis.INIT_GAIN_ANALYSIS_ERROR)return e.internal_flags=null,-6;switch(n.decode_on_the_fly&&!e.decode_only&&(null!=n.hip&&P.hip_decode_exit(n.hip),n.hip=P.hip_decode_init()),n.mode_gr=e.out_samplerate<=24e3?1:2,e.framesize=576*n.mode_gr,e.encoder_delay=b.ENCDELAY,n.resample_ratio=e.in_samplerate/e.out_samplerate,e.VBR){case a.vbr_mt:case a.vbr_rh:case a.vbr_mtrh:e.compression_ratio=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5][e.VBR_q];break;case a.vbr_abr:e.compression_ratio=16*e.out_samplerate*n.channels_out/(1e3*e.VBR_mean_bitrate_kbps);break;default:e.compression_ratio=16*e.out_samplerate*n.channels_out/(1e3*e.brate)}if(e.mode==x.NOT_SET&&(e.mode=x.JOINT_STEREO),e.highpassfreq>0?(n.highpass1=2*e.highpassfreq,e.highpasswidth>=0?n.highpass2=2*(e.highpassfreq+e.highpasswidth):n.highpass2=2*e.highpassfreq,n.highpass1/=e.out_samplerate,n.highpass2/=e.out_samplerate):(n.highpass1=0,n.highpass2=0),e.lowpassfreq>0?(n.lowpass2=2*e.lowpassfreq,e.lowpasswidth>=0?(n.lowpass1=2*(e.lowpassfreq-e.lowpasswidth),n.lowpass1<0&&(n.lowpass1=0)):n.lowpass1=2*e.lowpassfreq,n.lowpass1/=e.out_samplerate,n.lowpass2/=e.out_samplerate):(n.lowpass1=0,n.lowpass2=0),function(e){var t=e.internal_flags,n=32,r=-1;if(t.lowpass1>0){for(var a=999,o=0;o<=31;o++)(l=o/31)>=t.lowpass2&&(n=Math.min(n,o)),t.lowpass1<l&&l<t.lowpass2&&(a=Math.min(a,o));t.lowpass1=999==a?(n-.75)/31:(a-.75)/31,t.lowpass2=n/31}if(t.highpass2>0&&t.highpass2<.75/31*.9&&(t.highpass1=0,t.highpass2=0,i.err.println("Warning: highpass filter disabled.  highpass frequency too small\n")),t.highpass2>0){var s=-1;for(o=0;o<=31;o++)(l=o/31)<=t.highpass1&&(r=Math.max(r,o)),t.highpass1<l&&l<t.highpass2&&(s=Math.max(s,o));t.highpass1=r/31,t.highpass2=-1==s?(r+.75)/31:(s+.75)/31}for(o=0;o<32;o++){var c,u,l=o/31;c=t.highpass2>t.highpass1?I((t.highpass2-l)/(t.highpass2-t.highpass1+1e-20)):1,u=t.lowpass2>t.lowpass1?I((l-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[o]=c*u}}(e),n.samplerate_index=O(e.out_samplerate,e),n.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==a.vbr_off){if(e.free_format)n.bitrate_index=0;else if(e.brate=L(e.brate,e.version,e.out_samplerate),n.bitrate_index=D(e.brate,e.version,e.out_samplerate),n.bitrate_index<=0)return e.internal_flags=null,-1}else n.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=n.pinfo&&(e.bWriteVbrTag=!1),r.init_bit_stream_w(n);for(var j,B=n.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),U=0;U<b.SBMAX_l+1;U++)n.scalefac_band.l[U]=_.sfBandIndex[B].l[U];for(U=0;
2U<b.PSFB21+1;U++){var V=(n.scalefac_band.l[22]-n.scalefac_band.l[21])/b.PSFB21,F=n.scalefac_band.l[21]+U*V;n.scalefac_band.psfb21[U]=F}n.scalefac_band.psfb21[b.PSFB21]=576;for(U=0;U<b.SBMAX_s+1;U++)n.scalefac_band.s[U]=_.sfBandIndex[B].s[U];for(U=0;U<b.PSFB12+1;U++){V=(n.scalefac_band.s[13]-n.scalefac_band.s[12])/b.PSFB12,F=n.scalefac_band.s[12]+U*V;n.scalefac_band.psfb12[U]=F}for(n.scalefac_band.psfb12[b.PSFB12]=192,1==e.version?n.sideinfo_len=1==n.channels_out?21:36:n.sideinfo_len=1==n.channels_out?13:21,e.error_protection&&(n.sideinfo_len+=2),function(e){var t=e.internal_flags;e.frameNum=0,e.write_id3tag_automatic&&T.id3tag_write_v2(e),t.bitrate_stereoMode_Hist=c([16,5]),t.bitrate_blockType_Hist=c([16,6]),t.PeakSample=0,e.bWriteVbrTag&&E.InitVbrTag(e)}(e),n.Class_ID=A,j=0;j<19;j++)n.nsPsy.pefirbuf[j]=700*n.mode_gr*n.channels_out;switch(-1==e.ATHtype&&(e.ATHtype=4),l(e.VBR_q<=9),l(e.VBR_q>=0),e.VBR){case a.vbr_mt:e.VBR=a.vbr_mtrh;case a.vbr_mtrh:null==e.useTemporal&&(e.useTemporal=!1),k.apply_preset(e,500-10*e.VBR_q,0),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),e.quality<5&&(e.quality=0),e.quality>5&&(e.quality=5),n.PSY.mask_adjust=e.maskingadjust,n.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?n.sfb21_extra=!1:n.sfb21_extra=e.out_samplerate>44e3,n.iteration_loop=new VBRNewIterationLoop(w);break;case a.vbr_rh:k.apply_preset(e,500-10*e.VBR_q,0),n.PSY.mask_adjust=e.maskingadjust,n.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?n.sfb21_extra=!1:n.sfb21_extra=e.out_samplerate>44e3,e.quality>6&&(e.quality=6),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),n.iteration_loop=new VBROldIterationLoop(w);break;default:var z;n.sfb21_extra=!1,e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),(z=e.VBR)==a.vbr_off&&(e.VBR_mean_bitrate_kbps=e.brate),k.apply_preset(e,e.VBR_mean_bitrate_kbps,0),e.VBR=z,n.PSY.mask_adjust=e.maskingadjust,n.PSY.mask_adjust_short=e.maskingadjust_short,z==a.vbr_off?n.iteration_loop=new m(w):n.iteration_loop=new ABRIterationLoop(w)}if(l(e.scale>=0),e.VBR!=a.vbr_off){if(n.VBR_min_bitrate=1,n.VBR_max_bitrate=14,e.out_samplerate<16e3&&(n.VBR_max_bitrate=8),0!=e.VBR_min_bitrate_kbps&&(e.VBR_min_bitrate_kbps=L(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),n.VBR_min_bitrate=D(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),n.VBR_min_bitrate<0))return-1;if(0!=e.VBR_max_bitrate_kbps&&(e.VBR_max_bitrate_kbps=L(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),n.VBR_max_bitrate=D(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),n.VBR_max_bitrate<0))return-1;e.VBR_min_bitrate_kbps=y.bitrate_table[e.version][n.VBR_min_bitrate],e.VBR_max_bitrate_kbps=y.bitrate_table[e.version][n.VBR_max_bitrate],e.VBR_mean_bitrate_kbps=Math.min(y.bitrate_table[e.version][n.VBR_max_bitrate],e.VBR_mean_bitrate_kbps),e.VBR_mean_bitrate_kbps=Math.max(y.bitrate_table[e.version][n.VBR_min_bitrate],e.VBR_mean_bitrate_kbps)}return e.tune&&(n.PSY.mask_adjust+=e.tune_value_a,n.PSY.mask_adjust_short+=e.tune_value_a),function(e){var t=e.internal_flags;switch(e.quality){default:case 9:t.psymodel=0,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 8:e.quality=7;case 7:t.psymodel=1,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 6:case 5:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=0,t.full_outer_loop=0;break;case 4:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 3:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 2:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 1:case 0:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=2,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0}}(e),l(e.scale>=0),e.athaa_type<0?n.ATH.useAdjust=3:n.ATH.useAdjust=e.athaa_type,n.ATH.aaSensitivityP=Math.pow(10,e.athaa_sensitivity/-10),null==e.short_blocks&&(e.short_blocks=o.short_block_allowed),e.short_blocks!=o.short_block_allowed||e.mode!=x.JOINT_STEREO&&e.mode!=x.STEREO||(e.short_blocks=o.short_block_coupled),e.quant_comp<0&&(e.quant_comp=1),e.quant_comp_short<0&&(e.quant_comp_short=0),e.msfix<0&&(e.msfix=0),e.exp_nspsytune=1|e.exp_nspsytune,e.internal_flags.nsPsy.attackthre<0&&(e.internal_flags.nsPsy.attackthre=d.NSATTACKTHRE),e.internal_flags.nsPsy.attackthre_s<0&&(e.internal_flags.nsPsy.attackthre_s=d.NSATTACKTHRE_S),l(e.scale>=0),e.scale<0&&(e.scale=1),e.ATHtype<0&&(e.ATHtype=4),e.ATHcurve<0&&(e.ATHcurve=4),e.athaa_loudapprox<0&&(e.athaa_loudapprox=2),e.interChRatio<0&&(e.interChRatio=0),null==e.useTemporal&&(e.useTemporal=!0),n.slot_lag=n.frac_SpF=0,e.VBR==a.vbr_off&&(n.slot_lag=n.frac_SpF=72e3*(e.version+1)*e.brate%e.out_samplerate|0),_.iteration_init(e),C.psymodel_init(e),l(e.scale>=0),0},this.lame_encode_flush=function(e,t,n,i){var a,o,s,c,l=e.internal_flags,d=u([2,1152]),p=0,h=l.mf_samples_to_encode-b.POSTDELAY,f=j(e);if(l.mf_samples_to_encode<1)return 0;for(a=0,e.in_samplerate!=e.out_samplerate&&(h+=16*e.out_samplerate/e.in_samplerate),(s=e.framesize-h%e.framesize)<576&&(s+=e.framesize),e.encoder_padding=s,c=(h+s)/e.framesize;c>0&&p>=0;){var v=f-l.mf_size,m=e.frameNum;v*=e.in_samplerate,(v/=e.out_samplerate)>1152&&(v=1152),v<1&&(v=1),o=i-a,0==i&&(o=0),n+=p=this.lame_encode_buffer(e,d[0],d[1],v,t,n,o),a+=p,c-=m!=e.frameNum?1:0}if(l.mf_samples_to_encode=0,p<0)return p;if(o=i-a,0==i&&(o=0),r.flush_bitstream(e),(p=r.copy_buffer(l,t,n,o,1))<0)return p;if(n+=p,o=i-(a+=p),0==i&&(o=0),e.write_id3tag_automatic){if(T.id3tag_write_v1(e),(p=r.copy_buffer(l,t,n,o,0))<0)return p;a+=p}return a},this.lame_encode_buffer=function(e,n,i,a,o,c,u){var d=e.internal_flags,p=[null,null];if(d.Class_ID!=A)return-3;if(0==a)return 0;!function(e,t){(null==e.in_buffer_0||e.in_buffer_nsamples<t)&&(e.in_buffer_0=s(t),e.in_buffer_1=s(t),e.in_buffer_nsamples=t)}(d,a),p[0]=d.in_buffer_0,p[1]=d.in_buffer_1;for(var f=0;f<a;f++)p[0][f]=n[f],d.channels_in>1&&(p[1][f]=i[f]);return function(e,n,i,a,o,s,c){var u,d,p,f,v,m=e.internal_flags,y=0,k=[null,null],_=[null,null];if(m.Class_ID!=A)return-3;if(0==a)return 0;if(v=r.copy_buffer(m,o,s,c,0),v<0)return v;if(s+=v,y+=v,_[0]=n,_[1]=i,g.NEQ(e.scale,0)&&g.NEQ(e.scale,1))for(d=0;d<a;++d)_[0][d]*=e.scale,2==m.channels_out&&(_[1][d]*=e.scale);if(g.NEQ(e.scale_left,0)&&g.NEQ(e.scale_left,1))for(d=0;d<a;++d)_[0][d]*=e.scale_left;if(g.NEQ(e.scale_right,0)&&g.NEQ(e.scale_right,1))for(d=0;d<a;++d)_[1][d]*=e.scale_right;if(2==e.num_channels&&1==m.channels_out)for(d=0;d<a;++d)_[0][d]=.5*(_[0][d]+_[1][d]),_[1][d]=0;
2f=j(e),k[0]=m.mfbuf[0],k[1]=m.mfbuf[1];var w=0;for(;a>0;){var x=[null,null],S=0,E=0;x[0]=_[0],x[1]=_[1];var T=new U;if(q(e,k,x,w,a,T),S=T.n_in,E=T.n_out,m.findReplayGain&&!m.decode_on_the_fly&&t.AnalyzeSamples(m.rgdata,k[0],m.mf_size,k[1],m.mf_size,E,m.channels_out)==GainAnalysis.GAIN_ANALYSIS_ERROR)return-6;if(a-=S,w+=S,m.channels_out,m.mf_size+=E,l(m.mf_size<=h.MFSIZE),m.mf_samples_to_encode<1&&(m.mf_samples_to_encode=b.ENCDELAY+b.POSTDELAY),m.mf_samples_to_encode+=E,m.mf_size>=f){var P=c-y;if(0==c&&(P=0),(u=B(e,k[0],k[1],o,s,P))<0)return u;for(s+=u,y+=u,m.mf_size-=e.framesize,m.mf_samples_to_encode-=e.framesize,p=0;p<m.channels_out;p++)for(d=0;d<m.mf_size;d++)k[p][d]=k[p][d+e.framesize]}}return l(0==a),y}(e,p[0],p[1],a,o,c,u)}}},9482:function(e,t,n){var r=n(8299);e.exports=function(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=r.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}},4330:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte),a=r.new_double,o=r.new_float,s=r.new_float_n,c=r.new_int,u=r.new_int_n,l=(r.assert,n(8032)),d=n(7407),p=n(455),h=n(994),f=n(8906),v=n(610),m=n(2963);function g(){function e(){this.write_timing=0,this.ptr=0,this.buf=i(40)}this.Class_ID=0,this.lame_encode_frame_init=0,this.iteration_init_init=0,this.fill_buffer_resample_init=0,this.mfbuf=s([2,g.MFSIZE]),this.mode_gr=0,this.channels_in=0,this.channels_out=0,this.resample_ratio=0,this.mf_samples_to_encode=0,this.mf_size=0,this.VBR_min_bitrate=0,this.VBR_max_bitrate=0,this.bitrate_index=0,this.samplerate_index=0,this.mode_ext=0,this.lowpass1=0,this.lowpass2=0,this.highpass1=0,this.highpass2=0,this.noise_shaping=0,this.noise_shaping_amp=0,this.substep_shaping=0,this.psymodel=0,this.noise_shaping_stop=0,this.subblock_gain=0,this.use_best_huffman=0,this.full_outer_loop=0,this.l3_side=new l,this.ms_ratio=o(2),this.padding=0,this.frac_SpF=0,this.slot_lag=0,this.tag_spec=null,this.nMusicCRC=0,this.OldValue=c(2),this.CurrentStep=c(2),this.masking_lower=0,this.bv_scf=c(576),this.pseudohalf=c(m.SFBMAX),this.sfb21_extra=!1,this.inbuf_old=new Array(2),this.blackfilt=new Array(2*g.BPC+1),this.itime=a(2),this.sideinfo_len=0,this.sb_sample=s([2,2,18,v.SBLIMIT]),this.amp_filter=o(32),this.header=new Array(g.MAX_HEADER_BUF),this.h_ptr=0,this.w_ptr=0,this.ancillary_flag=0,this.ResvSize=0,this.ResvMax=0,this.scalefac_band=new d,this.minval_l=o(v.CBANDS),this.minval_s=o(v.CBANDS),this.nb_1=s([4,v.CBANDS]),this.nb_2=s([4,v.CBANDS]),this.nb_s1=s([4,v.CBANDS]),this.nb_s2=s([4,v.CBANDS]),this.s3_ss=null,this.s3_ll=null,this.decay=0,this.thm=new Array(4),this.en=new Array(4),this.tot_ener=o(4),this.loudness_sq=s([2,2]),this.loudness_sq_save=o(2),this.mld_l=o(v.SBMAX_l),this.mld_s=o(v.SBMAX_s),this.bm_l=c(v.SBMAX_l),this.bo_l=c(v.SBMAX_l),this.bm_s=c(v.SBMAX_s),this.bo_s=c(v.SBMAX_s),this.npart_l=0,this.npart_s=0,this.s3ind=u([v.CBANDS,2]),this.s3ind_s=u([v.CBANDS,2]),this.numlines_s=c(v.CBANDS),this.numlines_l=c(v.CBANDS),this.rnumlines_l=o(v.CBANDS),this.mld_cb_l=o(v.CBANDS),this.mld_cb_s=o(v.CBANDS),this.numlines_s_num1=0,this.numlines_l_num1=0,this.pe=o(4),this.ms_ratio_s_old=0,this.ms_ratio_l_old=0,this.ms_ener_ratio_old=0,this.blocktype_old=c(2),this.nsPsy=new p,this.VBR_seek_table=new h,this.ATH=null,this.PSY=null,this.nogap_total=0,this.nogap_current=0,this.decode_on_the_fly=!0,this.findReplayGain=!0,this.findPeakSample=!0,this.PeakSample=0,this.RadioGain=0,this.AudiophileGain=0,this.rgdata=null,this.noclipGainChange=0,this.noclipScale=0,this.bitrate_stereoMode_Hist=u([16,5]),this.bitrate_blockType_Hist=u([16,6]),this.pinfo=null,this.hip=null,this.in_buffer_nsamples=0,this.in_buffer_0=null,this.in_buffer_1=null,this.iteration_loop=null;for(var t=0;t<this.en.length;t++)this.en[t]=new f;for(t=0;t<this.thm.length;t++)this.thm[t]=new f;for(t=0;t<this.header.length;t++)this.header[t]=new e}g.MFSIZE=3456+v.ENCDELAY-v.MDCTDELAY,g.MAX_HEADER_BUF=256,g.MAX_BITS_PER_CHANNEL=4095,g.MAX_BITS_PER_GRANULE=7680,g.BPC=320,e.exports=g},8299:function(e){function t(e){var t=e;this.ordinal=function(){return t}}t.STEREO=new t(0),t.JOINT_STEREO=new t(1),t.DUAL_CHANNEL=new t(2),t.MONO=new t(3),t.NOT_SET=new t(4),e.exports=t},8767:function(e){e.exports=function(e){this.bits=e}},6592:function(e,t,n){var r=n(8768),i=r.System,a=(r.VbrMode,r.Float,r.ShortBlock,r.Util),o=r.Arrays,s=(r.new_array_n,r.new_byte,r.new_double,r.new_float),c=(r.new_float_n,r.new_int,r.new_int_n,r.assert,n(610));e.exports=function(){var e=[-.1482523854003001,32.308141959636465,296.40344946382766,883.1344870032432,11113.947376231741,1057.2713659324597,305.7402417275812,30.825928907280012,3.8533188138216365,59.42900443849514,709.5899960123345,5281.91112291017,-5829.66483675846,-817.6293103748613,-76.91656988279972,-4.594269939176596,.9063471690191471,.1960342806591213,-.15466694054279598,34.324387823855965,301.8067566458425,817.599602898885,11573.795901679885,1181.2520595540152,321.59731579894424,31.232021761053772,3.7107095756221318,53.650946155329365,684.167428119626,5224.56624370173,-6366.391851890084,-908.9766368219582,-89.83068876699639,-5.411397422890401,.8206787908286602,.3901806440322567,-.16070888947830023,36.147034243915876,304.11815768187864,732.7429163887613,11989.60988270091,1300.012278487897,335.28490093152146,31.48816102859945,3.373875931311736,47.232241542899175,652.7371796173471,5132.414255594984,-6909.087078780055,-1001.9990371107289,-103.62185754286375,-6.104916304710272,.7416505462720353,.5805693545089249,-.16636367662261495,37.751650073343995,303.01103387567713,627.9747488785183,12358.763425278165,1412.2779918482834,346.7496836825721,31.598286663170416,3.1598635433980946,40.57878626349686,616.1671130880391,5007.833007176154,-7454.040671756168,-1095.796034186711
vendor: 6,169 bytes, line 2
25,-118.24411666465777,-6.818469345853504,.6681786379192989,.7653668647301797,-.1716176790982088,39.11551877123304,298.3413246578966,503.5259106886539,12679.589408408976,1516.5821921214542,355.9850766329023,31.395241710249053,2.9164211881972335,33.79716964664243,574.8943997801362,4853.234992253242,-7997.57021486075,-1189.7624067269965,-133.6444792601766,-7.7202770609839915,.5993769336819237,.9427934736519954,-.17645823955292173,40.21879108166477,289.9982036694474,359.3226160751053,12950.259102786438,1612.1013903507662,362.85067106591504,31.045922092242872,2.822222032597987,26.988862316190684,529.8996541764288,4671.371946949588,-8535.899136645805,-1282.5898586244496,-149.58553632943463,-8.643494270763135,.5345111359507916,1.111140466039205,-.36174739330527045,41.04429910497807,277.5463268268618,195.6386023135583,13169.43812144731,1697.6433561479398,367.40983966190305,30.557037410382826,2.531473372857427,20.070154905927314,481.50208566532336,4464.970341588308,-9065.36882077239,-1373.62841526722,-166.1660487028118,-9.58289321133207,.4729647758913199,1.268786568327291,-.36970682634889585,41.393213350082036,261.2935935556502,12.935476055240873,13336.131683328815,1772.508612059496,369.76534388639965,29.751323653701338,2.4023193045459172,13.304795348228817,430.5615775526625,4237.0568611071185,-9581.931701634761,-1461.6913552409758,-183.12733958476446,-10.718010163869403,.41421356237309503,1.414213562373095,-.37677560326535325,41.619486213528496,241.05423794991074,-187.94665032361226,13450.063605744153,1836.153896465782,369.4908799925761,29.001847876923147,2.0714759319987186,6.779591200894186,377.7767837205709,3990.386575512536,-10081.709459700915,-1545.947424837898,-200.3762958015653,-11.864482073055006,.3578057213145241,1.546020906725474,-.3829366947518991,41.1516456456653,216.47684307105183,-406.1569483347166,13511.136535077321,1887.8076599260432,367.3025214564151,28.136213436723654,1.913880671464418,.3829366947518991,323.85365704338597,3728.1472257487526,-10561.233882199509,-1625.2025997821418,-217.62525175416,-13.015432208941645,.3033466836073424,1.66293922460509,-.5822628872992417,40.35639251440489,188.20071124269245,-640.2706748618148,13519.21490106562,1927.6022433578062,362.8197642637487,26.968821921868447,1.7463817695935329,-5.62650678237171,269.3016715297017,3453.386536448852,-11016.145278780888,-1698.6569643425091,-234.7658734267683,-14.16351421663124,.2504869601913055,1.76384252869671,-.5887180101749253,39.23429103868072,155.76096234403798,-889.2492977967378,13475.470561874661,1955.0535223723712,356.4450994756727,25.894952980042156,1.5695032905781554,-11.181939564328772,214.80884394039484,3169.1640829158237,-11443.321309975563,-1765.1588461316153,-251.68908574481912,-15.49755935939164,.198912367379658,1.847759065022573,-.7912582233652842,37.39369355329111,119.699486012458,-1151.0956593239027,13380.446257078214,1970.3952110853447,348.01959814116185,24.731487364283044,1.3850130831637748,-16.421408865300393,161.05030052864092,2878.3322807850063,-11838.991423510031,-1823.985884688674,-268.2854986386903,-16.81724543849939,.1483359875383474,1.913880671464418,-.7960642926861912,35.2322109610459,80.01928065061526,-1424.0212633405113,13235.794061869668,1973.804052543835,337.9908651258184,23.289159354463873,1.3934255946442087,-21.099669467133474,108.48348407242611,2583.700758091299,-12199.726194855148,-1874.2780658979746,-284.2467154529415,-18.11369784385905,.09849140335716425,1.961570560806461,-.998795456205172,32.56307803611191,36.958364584370486,-1706.075448829146,13043.287458812016,1965.3831106103316,326.43182772364605,22.175018750622293,1.198638339011324,-25.371248002043963,57.53505923036915,2288.41886619975,-12522.674544337233,-1914.8400385312243,-299.26241273417224,-19.37805630698734,.04912684976946725,1.990369453344394,.035780907*a.SQRT2*.5/2384e-9,.017876148*a.SQRT2*.5/2384e-9,.003134727*a.SQRT2*.5/2384e-9,.002457142*a.SQRT2*.5/2384e-9,971317e-9*a.SQRT2*.5/2384e-9,218868e-9*a.SQRT2*.5/2384e-9,101566e-9*a.SQRT2*.5/2384e-9,13828e-9*a.SQRT2*.5/2384e-9,12804.797818791945,1945.5515939597317,313.4244966442953,20.801593959731544,1995.1556208053692,9.000838926174497,-29.20218120805369],t=[[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,940084909404969e-27,6423305872147839e-28,2382191739347918e-28,5456116108943412e-27,4878985199565852e-27,4240448995017367e-27,3559909094758252e-27,2858043359288075e-27,2156177623817898e-27,1475637723558783e-27,8371015190102974e-28,2599706096327376e-28,-5456116108943412e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758252e-27,-2858043359288076e-27,-2156177623817898e-27,-1475637723558783e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347923e-28,-6423305872147843e-28,-9400849094049696e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049694e-28,-642330587214784e-27,-2382191739347918e-28],[2382191739347913e-28,6423305872147834e-28,9400849094049688e-28,1122435026096556e-27,1183840321267481e-27,1122435026096556e-27,9400849094049688e-28,6423305872147841e-28,2382191739347918e-28,5456116108943413e-27,4878985199565852e-27,4240448995017367e-27,3559909094758253e-27,2858043359288075e-27,2156177623817898e-27,1475637723558782e-27,8371015190102975e-28,2599706096327376e-28,-5461314069809755e-27,-4921085770524055e-27,-4343405037091838e-27,-3732668368707687e-27,-3093523840190885e-27,-2430835727329465e-27,-1734679010007751e-27,-974825365660928e-27,-2797435120168326e-28,0,0,0,0,0,0,-2283748241799531e-28,-4037858874020686e-28,-2146547464825323e-28],[.1316524975873958,.414213562373095,.7673269879789602,1.091308501069271,1.303225372841206,1.56968557711749,1.920982126971166,2.414213562373094,3.171594802363212,4.510708503662055,7.595754112725146,22.90376554843115,.984807753012208,.6427876096865394,.3420201433256688,.9396926207859084,-.1736481776669303,-.7660444431189779,.8660254037844387,.5,-.5144957554275265,-.4717319685649723,-.3133774542039019,-.1819131996109812,-.09457419252642064,-.04096558288530405,-.01419856857247115,-.003699974673760037,.8574929257125442,.8817419973177052,.9496286491027329,.9833145924917901,.99551
278160675857,.9991605581781475,.999899195244447,.9999931550702802],[0,0,0,0,0,0,2283748241799531e-28,4037858874020686e-28,2146547464825323e-28,5461314069809755e-27,4921085770524055e-27,4343405037091838e-27,3732668368707687e-27,3093523840190885e-27,2430835727329466e-27,1734679010007751e-27,974825365660928e-27,2797435120168326e-28,-5456116108943413e-27,-4878985199565852e-27,-4240448995017367e-27,-3559909094758253e-27,-2858043359288075e-27,-2156177623817898e-27,-1475637723558782e-27,-8371015190102975e-28,-2599706096327376e-28,-2382191739347913e-28,-6423305872147834e-28,-9400849094049688e-28,-1122435026096556e-27,-1183840321267481e-27,-1122435026096556e-27,-9400849094049688e-28,-6423305872147841e-28,-2382191739347918e-28]],n=t[c.SHORT_TYPE],r=t[c.SHORT_TYPE],u=t[c.SHORT_TYPE],l=t[c.SHORT_TYPE],d=[0,1,16,17,8,9,24,25,4,5,20,21,12,13,28,29,2,3,18,19,10,11,26,27,6,7,22,23,14,15,30,31];function p(t,n,r){for(var i,o,s,c=10,u=n+238-14-286,l=-15;l<0;l++){var d,p,h;d=e[c+-10],p=t[u+-224]*d,h=t[n+224]*d,d=e[c+-9],p+=t[u+-160]*d,h+=t[n+160]*d,d=e[c+-8],p+=t[u+-96]*d,h+=t[n+96]*d,d=e[c+-7],p+=t[u+-32]*d,h+=t[n+32]*d,d=e[c+-6],p+=t[u+32]*d,h+=t[n+-32]*d,d=e[c+-5],p+=t[u+96]*d,h+=t[n+-96]*d,d=e[c+-4],p+=t[u+160]*d,h+=t[n+-160]*d,d=e[c+-3],p+=t[u+224]*d,h+=t[n+-224]*d,d=e[c+-2],p+=t[n+-256]*d,h-=t[u+256]*d,d=e[c+-1],p+=t[n+-192]*d,h-=t[u+192]*d,d=e[c+0],p+=t[n+-128]*d,h-=t[u+128]*d,d=e[c+1],p+=t[n+-64]*d,h-=t[u+64]*d,d=e[c+2],p+=t[n+0]*d,h-=t[u+0]*d,d=e[c+3],p+=t[n+64]*d,h-=t[u+-64]*d,d=e[c+4],p+=t[n+128]*d,h-=t[u+-128]*d,d=e[c+5],p+=t[n+192]*d,d=(h-=t[u+-192]*d)-(p*=e[c+6]),r[30+2*l]=h+p,r[31+2*l]=e[c+7]*d,c+=18,n--,u++}h=t[n+-16]*e[c+-10],p=t[n+-32]*e[c+-2],h+=(t[n+-48]-t[n+16])*e[c+-9],p+=t[n+-96]*e[c+-1],h+=(t[n+-80]+t[n+48])*e[c+-8],p+=t[n+-160]*e[c+0],h+=(t[n+-112]-t[n+80])*e[c+-7],p+=t[n+-224]*e[c+1],h+=(t[n+-144]+t[n+112])*e[c+-6],p-=t[n+32]*e[c+2],h+=(t[n+-176]-t[n+144])*e[c+-5],p-=t[n+96]*e[c+3],h+=(t[n+-208]+t[n+176])*e[c+-4],p-=t[n+160]*e[c+4],h+=(t[n+-240]-t[n+208])*e[c+-3],i=(p-=t[n+224])-h,o=p+h,h=r[14],p=r[15]-h,r[31]=o+h,r[30]=i+p,r[15]=i-p,r[14]=o-h,s=r[28]-r[0],r[0]+=r[28],r[28]=s*e[c+-36+
27],s=r[29]-r[1],r[1]+=r[29],r[29]=s*e[c+-36+7],s=r[26]-r[2],r[2]+=r[26],r[26]=s*e[c+-72+7],s=r[27]-r[3],r[3]+=r[27],r[27]=s*e[c+-72+7],s=r[24]-r[4],r[4]+=r[24],r[24]=s*e[c+-108+7],s=r[25]-r[5],r[5]+=r[25],r[25]=s*e[c+-108+7],s=r[22]-r[6],r[6]+=r[22],r[22]=s*a.SQRT2,s=r[23]-r[7],r[7]+=r[23],r[23]=s*a.SQRT2-r[7],r[7]-=r[6],r[22]-=r[7],r[23]-=r[22],s=r[6],r[6]=r[31]-s,r[31]=r[31]+s,s=r[7],r[7]=r[30]-s,r[30]=r[30]+s,s=r[22],r[22]=r[15]-s,r[15]=r[15]+s,s=r[23],r[23]=r[14]-s,r[14]=r[14]+s,s=r[20]-r[8],r[8]+=r[20],r[20]=s*e[c+-180+7],s=r[21]-r[9],r[9]+=r[21],r[21]=s*e[c+-180+7],s=r[18]-r[10],r[10]+=r[18],r[18]=s*e[c+-216+7],s=r[19]-r[11],r[11]+=r[19],r[19]=s*e[c+-216+7],s=r[16]-r[12],r[12]+=r[16],r[16]=s*e[c+-252+7],s=r[17]-r[13],r[13]+=r[17],r[17]=s*e[c+-252+7],s=-r[20]+r[24],r[20]+=r[24],r[24]=s*e[c+-216+7],s=-r[21]+r[25],r[21]+=r[25],r[25]=s*e[c+-216+7],s=r[4]-r[8],r[4]+=r[8],r[8]=s*e[c+-216+7],s=r[5]-r[9],r[5]+=r[9],r[9]=s*e[c+-216+7],s=r[0]-r[12],r[0]+=r[12],r[12]=s*e[c+-72+7],s=r[1]-r[13],r[1]+=r[13],r[13]=s*e[c+-72+7],s=r[16]-r[28],r[16]+=r[28],r[28]=s*e[c+-72+7],s=-r[17]+r[29],r[17]+=r[29],r[29]=s*e[c+-72+7],s=a.SQRT2*(r[2]-r[10]),r[2]+=r[10],r[10]=s,s=a.SQRT2*(r[3]-r[11]),r[3]+=r[11],r[11]=s,s=a.SQRT2*(-r[18]+r[26]),r[18]+=r[26],r[26]=s-r[18],s=a.SQRT2*(-r[19]+r[27]),r[19]+=r[27],r[27]=s-r[19],s=r[2],r[19]-=r[3],r[3]-=s,r[2]=r[31]-s,r[31]+=s,s=r[3],r[11]-=r[19],r[18]-=s,r[3]=r[30]-s,r[30]+=s,s=r[18],r[27]-=r[11],r[19]-=s,r[18]=r[15]-s,r[15]+=s,s=r[19],r[10]-=s,r[19]=r[14]-s,r[14]+=s,s=r[10],r[11]-=s,r[10]=r[23]-s,r[23]+=s,s=r[11],r[26]-=s,r[11]=r[22]-s,r[22]+=s,s=r[26],r[27]-=s,r[26]=r[7]-s,r[7]+=s,s=r[27],r[27]=r[6]-s,r[6]+=s,s=a.SQRT2*(r[0]-r[4]),r[0]+=r[4],r[4]=s,s=a.SQRT2*(r[1]-r[5]),r[1]+=r[5],r[5]=s,s=a.SQRT2*(r[16]-r[20]),r[16]+=r[20],r[20]=s,s=a.SQRT2*(r[17]-r[21]),r[17]+=r[21],r[21]=s,s=-a.SQRT2*(r[8]-r[12]),r[8]+=r[12],r[12]=s-r[8],s=-a.SQRT2*(r[9]-r[13]),r[9]+=r[13],r[13]=s-r[9],s=-a.SQRT2*(r[25]-r[29]),r[25]+=r[29],r[29]=s-r[25],s=-a.SQRT2*(r[24]+r[28]),r[24]-=r[28],r[28]=s-r[24],s=r[24]-r[16],r[24]=s,s=r[20]-s,r[20]=s,s=r[28]-s,r[28]=s,s=r[25]-r[17],r[25]=s,s=r[21]-s,r[21]=s,s=r[29]-s,r[29]=s,s=r[17]-r[1],r[17]=s,s=r[9]-s,r[9]=s,s=r[25]-s,r[25]=s,s=r[5]-s,r[5]=s,s=r[21]-s,r[21]=s,s=r[13]-s,r[13]=s,s=r[29]-s,r[29]=s,s=r[1]-r[0],r[1]=s,s=r[16]-s,r[16]=s,s=r[17]-s,r[17]=s,s=r[8]-s,r[8]=s,s=r[9]-s,r[9]=s,s=r[24]-s,r[24]=s,s=r[25]-s,r[25]=s,s=r[4]-s,r[4]=s,s=r[5]-s,r[5]=s,s=r[20]-s,r[20]=s,s=r[21]-s,r[21]=s,s=r[12]-s,r[12]=s,s=r[13]-s,r[13]=s,s=r[28]-s,r[28]=s,s=r[29]-s,r[29]=s,s=r[0],r[0]+=r[31],r[31]-=s,s=r[1],r[1]+=r[30],r[30]-=s,s=r[16],r[16]+=r[15],r[15]-=s,s=r[17],r[17]+=r[14],r[14]-=s,s=r[8],r[8]+=r[23],r[23]-=s,s=r[9],r[9]+=r[22],r[22]-=s,s=r[24],r[24]+=r[7],r[7]-=s,s=r[25],r[25]+=r[6],r[6]-=s,s=r[4],r[4]+=r[27],r[27]-=s,s=r[5],r[5]+=r[26],r[26]-=s,s=r[20],r[20]+=r[11],r[11]-=s,s=r[21],r[21]+=r[10],r[10]-=s,s=r[12],r[12]+=r[19],r[19]-=s,s=r[13],r[13]+=r[18],r[18]-=s,s=r[28],r[28]+=r[3],r[3]-=s,s=r[29],r[29]+=r[2],r[2]-=s}function h(e,n){for(var r=0;r<3;r++){var i,a,o,s,u,l;a=(s=e[n+6]*t[c.SHORT_TYPE][0]-e[n+15])+(i=e[n+0]*t[c.SHORT_TYPE][2]-e[n+9]),o=s-i,u=(s=e[n+15]*t[c.SHORT_TYPE][0]+e[n+6])+(i=e[n+9]*t[c.SHORT_TYPE][2]+e[n+0]),l=-s+i,i=2069978111953089e-26*(e[n+3]*t[c.SHORT_TYPE][1]-e[n+12]),s=2069978111953089e-26*(e[n+12]*t[c.SHORT_TYPE][1]+e[n+3]),e[n+0]=190752519173728e-25*a+i,e[n+15]=190752519173728e-25*-u+s,o=.8660254037844387*o*1907525191737281e-26,u=.5*u*1907525191737281e-26+s,e[n+3]=o-u,e[n+6]=o+u,a=.5*a*1907525191737281e-26-i,l=.8660254037844387*l*1907525191737281e-26,e[n+9]=a+l,e[n+12]=a-l,n++}}function f(e,t,n){var i,a,o,s,c,u,l,d,p,h,f,v,m,g,y,b,k,_;o=n[17]-n[9],c=n[15]-n[11],u=n[14]-n[12],l=n[0]+n[8],d=n[1]+n[7],p=n[2]+n[6],h=n[3]+n[5],e[t+17]=l+p-h-(d-n[4]),a=(l+p-h)*r[19]+(d-n[4]),i=(o-c-u)*r[18],e[t+5]=i+a,e[t+6]=i-a,s=(n[16]-n[10])*r[18],d=d*r[19]+n[4],i=o*r[12]+s+c*r[13]+u*r[14],a=-l*r[16]+d-p*r[17]+h*r[15],e[t+1]=i+a,e[t+2]=i-a,i=o*r[13]-s-c*r[14]+u*r[12],a=-l*r[17]+d-p*r[15]+h*r[16],e[t+9]=i+a,e[t+10]=i-a,i=o*r[14]-s+c*r[12]-u*r[13],a=l*r[15]-d+p*r[16]-h*r[17],e[t+13]=i+a,e[t+14]=i-a,f=n[8]-n[0],m=n[6]-n[2],g=n[5]-n[3],y=n[17]+n[9],b=n[16]+n[10],k=n[15]+n[11],_=n[14]+n[12],e[t+0]=y+k+_+(b+n[13]),i=(y+k+_)*r[19]-(b+n[13]),a=(f-m+g)*r[18],e[t+11]=i+a,e[t+12]=i-a,v=(n[7]-n[1])*r[18],b=n[13]-b*r[19],i=y*r[15]-b+k*r[16]+_*r[17],a=f*r[14]+v+m*r[12]+g*r[13],e[t+3]=i+a,e[t+4]=i-a,i=-y*r[17]+b-k*r[15]-_*r[16],a=f*r[13]+v-m*r[14]-g*r[12],e[t+7]=i+a,e[t+8]=i-a,i=-y*r[16]+b-k*r[17]-_*r[15],a=f*r[12]-v+m*r[13]-g*r[14],e[t+15]=i+a,e[t+16]=i-a}this.mdct_sub48=function(e,r,a){for(var v=r,m=286,g=0;g<e.channels_out;g++){for(var y=0;y<e.mode_gr;y++){for(var b,k=e.l3_side.tt[y][g],_=k.xr,w=0,x=e.sb_sample[g][1-y],S=0,E=0;E<9;E++)for(p(v,m,x[S]),p(v,m+32,x[S+1]),S+=2,m+=64,b=1;b<32;b+=2)x[S-1][b]*=-1;for(b=0;b<32;b++,w+=18){var T=k.block_type,P=e.sb_sample[g][y],C=e.sb_sample[g][1-y];if(0!=k.mixed_block_flag&&b<2&&(T=0),e.amp_filter[b]<1e-12)o.fill(_,w+0,w+18,0);else{if(e.amp_filter[b]<1)for(E=0;E<18;E++)C[E][d[b]]*=e.amp_filter[b];if(T==c.SHORT_TYPE){for(E=-3;E<0;E++){var R=t[c.SHORT_TYPE][E+3];_[w+3*E+9]=P[9+E][d[b]]*R-P[8-E][d[b]],_[w+3*E+18]=P[14-E][d[b]]*R+P[15+E][d[b]],_[w+3*E+10]=P[15+E][d[b]]*R-P[14-E][d[b]],_[w+3*E+19]=C[2-E][d[b]]*R+C[3+E][d[b]],_[w+3*E+11]=C[3
2+E][d[b]]*R-C[2-E][d[b]],_[w+3*E+20]=C[8-E][d[b]]*R+C[9+E][d[b]]}h(_,w)}else{var Z=s(18);for(E=-9;E<0;E++){var M,A;M=t[T][E+27]*C[E+9][d[b]]+t[T][E+36]*C[8-E][d[b]],A=t[T][E+9]*P[E+9][d[b]]-t[T][E+18]*P[8-E][d[b]],Z[E+9]=M-A*n[3+E+9],Z[E+18]=M*n[3+E+9]+A}f(_,w,Z)}}if(T!=c.SHORT_TYPE&&0!=b)for(E=7;E>=0;--E){var I,O;I=_[w+E]*u[20+E]+_[w+-1-E]*l[28+E],O=_[w+E]*l[28+E]-_[w+-1-E]*u[20+E],_[w+-1-E]=I,_[w+E]=O}}}if(v=a,m=286,1==e.mode_gr)for(var L=0;L<18;L++)i.arraycopy(e.sb_sample[g][1][L],0,e.sb_sample[g][0][L],0,32)}}}},455:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float),a=r.new_float_n,o=r.new_int,s=(r.new_int_n,r.assert,n(610));e.exports=function(){this.last_en_subshort=a([4,9]),this.lastAttacks=o(4),this.pefirbuf=i(19),this.longfact=i(s.SBMAX_l),this.shortfact=i(s.SBMAX_s),this.attackthre=0,this.attackthre_s=0}},1084:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode);r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float,r.new_float_n,r.new_int,r.new_int_n,r.assert;e.exports=function(){var e,t=n(7589);function r(e,t,n,r,i,a,o,s,c,u,l,d,p,h,f){this.vbr_q=e,this.quant_comp=t,this.quant_comp_s=n,this.expY=r,this.st_lrm=i,this.st_s=a,this.masking_adj=o,this.masking_adj_short=s,this.ath_lower=c,this.ath_curve=u,this.ath_sensitivity=l,this.interch=d,this.safejoint=p,this.sfb21mod=h,this.msfix=f}function a(e,t,n,r,i,a,o,s,c,u,l,d,p,h){this.quant_comp=t,this.quant_comp_s=n,this.safejoint=r,this.nsmsfix=i,this.st_lrm=a,this.st_s=o,this.nsbass=s,this.scale=c,this.masking_adj=u,this.ath_lower=l,this.ath_curve=d,this.interch=p,this.sfscale=h}this.setModules=function(t){e=t};var o=[new r(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new r(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new r(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new r(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new r(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new r(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new r(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new r(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new r(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new r(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new r(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],s=[new r(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new r(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new r(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new r(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new r(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new r(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new r(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new r(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new r(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new r(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new r(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function c(e,t,n){var r=e.VBR==i.vbr_rh?o:s,a=e.VBR_q_frac,c=r[t],u=r[t+1],l=c;c.st_lrm=c.st_lrm+a*(u.st_lrm-c.st_lrm),c.st_s=c.st_s+a*(u.st_s-c.st_s),c.masking_adj=c.masking_adj+a*(u.masking_adj-c.masking_adj),c.masking_adj_short=c.masking_adj_short+a*(u.masking_adj_short-c.masking_adj_short),c.ath_lower=c.ath_lower+a*(u.ath_lower-c.ath_lower),c.ath_curve=c.ath_curve+a*(u.ath_curve-c.ath_curve),
vendor: 5,163 bytes, line 2
2c.ath_sensitivity=c.ath_sensitivity+a*(u.ath_sensitivity-c.ath_sensitivity),c.interch=c.interch+a*(u.interch-c.interch),c.msfix=c.msfix+a*(u.msfix-c.msfix),function(e,t){var n=0;0>t&&(n=-1,t=0);9<t&&(n=-1,t=9);e.VBR_q=t,e.VBR_q_frac=0}(e,l.vbr_q),0!=n?e.quant_comp=l.quant_comp:Math.abs(e.quant_comp- -1)>0||(e.quant_comp=l.quant_comp),0!=n?e.quant_comp_short=l.quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=l.quant_comp_s),0!=l.expY&&(e.experimentalY=0!=l.expY),0!=n?e.internal_flags.nsPsy.attackthre=l.st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=l.st_lrm),0!=n?e.internal_flags.nsPsy.attackthre_s=l.st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=l.st_s),0!=n?e.maskingadjust=l.masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=l.masking_adj),0!=n?e.maskingadjust_short=l.masking_adj_short:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=l.masking_adj_short),0!=n?e.ATHlower=-l.ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-l.ath_lower/10),0!=n?e.ATHcurve=l.ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=l.ath_curve),0!=n?e.athaa_sensitivity=l.ath_sensitivity:Math.abs(e.athaa_sensitivity- -1)>0||(e.athaa_sensitivity=l.ath_sensitivity),l.interch>0&&(0!=n?e.interChRatio=l.interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=l.interch)),l.safejoint>0&&(e.exp_nspsytune=e.exp_nspsytune|l.safejoint),l.sfb21mod>0&&(e.exp_nspsytune=e.exp_nspsytune|l.sfb21mod<<20),0!=n?e.msfix=l.msfix:Math.abs(e.msfix- -1)>0||(e.msfix=l.msfix),0==n&&(e.VBR_q=t,e.VBR_q_frac=a)}var u=[new a(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new a(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new a(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new a(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new a(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new a(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new a(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new a(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new a(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new a(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new a(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new a(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new a(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new a(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new a(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new a(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new a(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function l(t,n,r){var a=n,o=e.nearestBitrateFullIndex(n);if(t.VBR=i.vbr_abr,t.VBR_mean_bitrate_kbps=a,t.VBR_mean_bitrate_kbps=Math.min(t.VBR_mean_bitrate_kbps,320),t.VBR_mean_bitrate_kbps=Math.max(t.VBR_mean_bitrate_kbps,8),t.brate=t.VBR_mean_bitrate_kbps,t.VBR_mean_bitrate_kbps>320&&(t.disable_reservoir=!0),u[o].safejoint>0&&(t.exp_nspsytune=2|t.exp_nspsytune),u[o].sfscale>0&&(t.internal_flags.noise_shaping=2),Math.abs(u[o].nsbass)>0){var s=int(4*u[o].nsbass);s<0&&(s+=64),t.exp_nspsytune=t.exp_nspsytune|s<<2}return 0!=r?t.quant_comp=u[o].quant_comp:Math.abs(t.quant_comp- -1)>0||(t.quant_comp=u[o].quant_comp),0!=r?t.quant_comp_short=u[o].quant_comp_s:Math.abs(t.quant_comp_short- -1)>0||(t.quant_comp_short=u[o].quant_comp_s),0!=r?t.msfix=u[o].nsmsfix:Math.abs(t.msfix- -1)>0||(t.msfix=u[o].nsmsfix),0!=r?t.internal_flags.nsPsy.attackthre=u[o].st_lrm:Math.abs(t.internal_flags.nsPsy.attackthre- -1)>0||(t.internal_flags.nsPsy.attackthre=u[o].st_lrm),0!=r?t.internal_flags.nsPsy.attackthre_s=u[o].st_s:Math.abs(t.internal_flags.nsPsy.attackthre_s- -1)>0||(t.internal_flags.nsPsy.attackthre_s=u[o].st_s),0!=r?t.scale=u[o].scale:Math.abs(t.scale- -1)>0||(t.scale=u[o].scale),0!=r?t.maskingadjust=u[o].masking_adj:Math.abs(t.maskingadjust-0)>0||(t.maskingadjust=u[o].masking_adj),u[o].masking_adj>0?0!=r?t.maskingadjust_short=.9*u[o].masking_adj:Math.abs(t.maskingadjust_short-0)>0||(t.maskingadjust_short=.9*u[o].masking_adj):0!=r?t.maskingadjust_short=1.1*u[o].masking_adj:Math.abs(t.maskingadjust_short-0)>0||(t.maskingadjust_short=1.1*u[o].masking_adj),0!=r?t.ATHlower=-u[o].ath_lower/10:Math.abs(10*-t.ATHlower-0)>0||(t.ATHlower=-u[o].ath_lower/10),0!=r?t.ATHcurve=u[o].ath_curve:Math.abs(t.ATHcurve- -1)>0||(t.ATHcurve=u[o].ath_curve),0!=r?t.interChRatio=u[o].interch:Math.abs(t.interChRatio- -1)>0||(t.interChRatio=u[o].interch),n}this.apply_preset=function(e,n,r){switch(n){case t.R3MIX:n=t.V3,e.VBR=i.vbr_mtrh;break;case t.MEDIUM:n=t.V4,e.VBR=i.vbr_rh;break;case t.MEDIUM_FAST:n=t.V4,e.VBR=i.vbr_mtrh;break;case t.STANDARD:n=t.V2,e.VBR=i.vbr_rh;break;case t.STANDARD_FAST:n=t.V2,e.VBR=i.vbr_mtrh;break;case t.EXTREME:n=t.V0,e.VBR=i.vbr_rh;break;case t.EXTREME_FAST:n=t.V0,e.VBR=i.vbr_mtrh;break;case t.INSANE:return n=320,e.preset=n,l(e,n,r),e.VBR=i.vbr_off,n}switch(e.preset=n,n){case t.V9:return c(e,9,r),n;case t.V8:return c(e,8,r),n;case t.V7:return c(e,7,r),n;case t.V6:return c(e,6,r),n;case t.V5:return c(e,5,r),n;case t.V4:return c(e,4,r),n;case t.V3:return c(e,3,r),n;case t.V2:return c(e,2,r),n;case t.V1:return c(e,1,r),n;case t.V0:return c(e,0,r),n}return 8<=n&&n<=320?l(e,n,r):(e.preset=0,n)}}},8817:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode),a=r.Float,o=r.ShortBlock,s=r.Util,c=r.Arrays,u=(r.
2new_array_n,r.new_byte,r.new_double,r.new_float),l=r.new_float_n,d=r.new_int,p=(r.new_int_n,r.assert),h=n(4525),f=n(610);e.exports=function(){var e=n(8299),t=new h,r=2.302585092994046,v=1/217621504/(f.BLKSIZE/2),m=.3,g=21,y=.2302585093;function b(e,t){for(var n=0,r=0;r<f.BLKSIZE/2;++r)n+=e[r]*t.ATH.eql_w[r];return n*=v}function k(e,n,r,i,a,o,c,u,l,d,p){var h=e.internal_flags;if(l<2)t.fft_long(h,i[a],l,d,p),t.fft_short(h,o[c],l,d,p);else if(2==l){for(var v=f.BLKSIZE-1;v>=0;--v){var m=i[a+0][v],g=i[a+1][v];i[a+0][v]=(m+g)*s.SQRT2*.5,i[a+1][v]=(m-g)*s.SQRT2*.5}for(var y=2;y>=0;--y)for(v=f.BLKSIZE_s-1;v>=0;--v){m=o[c+0][y][v],g=o[c+1][y][v];o[c+0][y][v]=(m+g)*s.SQRT2*.5,o[c+1][y][v]=(m-g)*s.SQRT2*.5}}n[0]=i[a+0][0],n[0]*=n[0];for(v=f.BLKSIZE/2-1;v>=0;--v){var k=i[a+0][f.BLKSIZE/2-v],_=i[a+0][f.BLKSIZE/2+v];n[f.BLKSIZE/2-v]=.5*(k*k+_*_)}for(y=2;y>=0;--y){r[y][0]=o[c+0][y][0],r[y][0]*=r[y][0];for(v=f.BLKSIZE_s/2-1;v>=0;--v){k=o[c+0][y][f.BLKSIZE_s/2-v],_=o[c+0][y][f.BLKSIZE_s/2+v];r[y][f.BLKSIZE_s/2-v]=.5*(k*k+_*_)}}var w=0;for(v=11;v<f.HBLKSIZE;v++)w+=n[v];if(h.tot_ener[l]=w,e.analysis){for(v=0;v<f.HBLKSIZE;v++)h.pinfo.energy[u][l][v]=h.pinfo.energy_save[l][v],h.pinfo.energy_save[l][v]=n[v];h.pinfo.pe[u][l]=h.pe[l]}2==e.athaa_loudapprox&&l<2&&(h.loudness_sq[u][l]=h.loudness_sq_save[l],h.loudness_sq_save[l]=b(n,h))}var _,w,x,S=[1,.79433,.63096,.63096,.63096,.63096,.63096,.25119,.11749],E=[3.3246*3.3246,3.23837*3.23837,9.9500500969,9.0247369744,8.1854926609,7.0440875649,2.46209*2.46209,2.284*2.284,4.4892710641,1.96552*1.96552,1.82335*1.82335,1.69146*1.69146,2.4621061921,2.1508568964,1.37074*1.37074,1.31036*1.31036,1.5691069696,1.4555939904,1.16203*1.16203,1.2715945225,1.09428*1.09428,1.0659*1.0659,1.0779838276,1.0382591025,1],T=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1],P=[5.5396212496,2.29259*2.29259,4.9868695969,2.12675*2.12675,2.02545*2.02545,1.87894*1.87894,1.74303*1.74303,1.61695*1.61695,2.2499700001,1.39148*1.39148,1.29083*1.29083,1.19746*1.19746,1.2339655056,1.0779838276];function C(e,t,n,r,i,a){var o;if(t>e){if(!(t<e*w))return e+t;o=t/e}else{if(e>=t*w)return e+t;o=e/t}if(p(e>=0),p(t>=0),e+=t,r+3<=6){if(o>=_)return e;var c=0|s.FAST_LOG10_X(o,16);return e*T[c]}var u,l;c=0|s.FAST_LOG10_X(o,16);return t=0!=a?i.ATH.cb_s[n]*i.ATH.adjust:i.ATH.cb_l[n]*i.ATH.adjust,p(t>=0),e<x*t?e>t?(u=1,c<=13&&(u=P[c]),l=s.FAST_LOG10_X(e/t,10/15),e*((E[c]-u)*l+u)):c>13?e:e*P[c]:e*E[c]}var R=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1];function Z(e,t,n){var r;if(e<0&&(e=0),t<0&&(t=0),e<=0)return t;if(t<=0)return e;if(r=t>e?t/e:e/t,-2<=n&&n<=2){if(r>=_)return e+t;var i=0|s.FAST_LOG10_X(r,16);return(e+t)*R[i]}return r<w?e+t:(e<t&&(e=t),e)}function M(e,t,n,r,i){var a,o,s=0,c=0;for(a=o=0;a<f.SBMAX_s;++o,++a){for(var u=e.bo_s[a],l=e.npart_s,d=u<l?u:l;o<d;)p(t[o]>=0),p(n[o]>=0),s+=t[o],c+=n[o],o++;if(e.en[r].s[a][i]=s,e.thm[r].s[a][i]=c,o>=l){++a;break}p(t[o]>=0),p(n[o]>=0);var h=e.PSY.bo_s_weight[a],v=1-h;s=h*t[o],c=h*n[o],e.en[r].s[a][i]+=s,e.thm[r].s[a][i]+=c,s=v*t[o],c=v*n[o]}for(;a<f.SBMAX_s;++a)e.en[r].s[a][i]=0,e.thm[r].s[a][i]=0}function A(e,t,n,r){var i,a,o=0,s=0;for(i=a=0;i<f.SBMAX_l;++a,++i){for(var c=e.bo_l[i],u=e.npart_l,l=c<u?c:u;a<l;)p(t[a]>=0),p(n[a]>=0),o+=t[a],s+=n[a],a++;if(e.en[r].l[i]=o,e.thm[r].l[i]=s,a>=u){++i;break}p(t[a]>=0),p(n[a]>=0);var d=e.PSY.bo_l_weight[i],h=1-d;o=d*t[a],s=d*n[a],e.en[r].l[i]+=o,e.thm[r].l[i]+=s,o=h*t[a],s=h*n[a]}for(;i<f.SBMAX_l;++i)e.en[r].l[i]=0,e.thm[r].l[i]=0}function I(e,t,n,r,i,a){var o,s,c=e.internal_flags;for(s=o=0;s<c.npart_s;++s){for(var u=0,l=0,d=c.numlines_s[s],h=0;h<d;++h,++o){var v=t[a][o];u+=v,l<v&&(l=v)}n[s]=u}for(p(s==c.npart_s),p(129==o),o=s=0;s<c.npart_s;s++){var m=c.s3ind_s[s][0],g=c.s3_ss[o++]*n[m];for(++m;m<=c.s3ind_s[s][1];)g+=c.s3_ss[o]*n[m],++o,++m;var y=2*c.nb_s1[i][s];if(r[s]=Math.min(g,y),c.blocktype_old[1&i]==f.SHORT_TYPE){y=16*c.nb_s2[i][s];var b=r[s];r[s]=Math.min(y,b)}c.nb_s2[i][s]=c.nb_s1[i][s],c.nb_s1[i][s]=g,p(r[s]>=0)}for(;s<=f.CBANDS;++s)n[s]=0,r[s]=0}function O(e,t,n){return n>=1?e:n<=0?t:t>0?Math.pow(e/t,n)*t:0}var L=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function D(e,t){for(var n=309.07,i=0;i<f.SBMAX_s-1;i++)for(var a=0;a<3;a++){var o=e.thm.s[i][a];if(p(i<L.length),o>0){var c=o*t,u=e.en.s[i][a];u>c&&(u>1e10*c?n+=L[i]*(10*r):(p(c>0),n+=L[i]*s.FAST_LOG10(u/c)))}}return n}var N=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function j(e,t){for(var n=281.0575,i=0;i<f.SBMAX_l-1;i++){var a=e.thm.l[i];if(p(i<N.length),a>0){var o=a*t,c=e.en.l[i];c>o&&(c>1e10*o?n+=N[i]*(10*r):(p(o>0),n+=N[i]*s.FAST_LOG10(c/o)))}}return n}function B(e,t,n,r,i){var a,o;for(a=o=0;a<e.npart_l;++a){var s,c=0,u=0;for(s=0;s<e.numlines_l[a];++s,++o){var l=t[o];p(l>=0),c+=l,u<l&&(u=l)}n[a]=c,r[a]=u,i[a]=c*e.rnumlines_l[a],p(e.rnumlines_l[a]>=0),p(c>=0),p(n[a]>=0),p(r[a]>=0),p(i[a]>=0)}}function U(e,t,n,r){var i=S.length-1,a=0,o=n[a]+n[a+1];(p(o>=0),o>0)?((s=t[a])<t[a+1]&&(s=t[a+1]),p(e.numlines_l[a]+e.numlines_l[a+1]-1>0),(c=0|(o=20*(2*s-o)/(o*(e.numlines_l[a]+e.numlines_l[a+1]-1))))>i&&(c=i),r[a]=c):r[a]=0;for(a=1;a<e.npart_l-1;a++){var s,c;if(o=n[a-1]+n[a]+n[a+1],p(o>=0),o>0)(s=t[a-1])<t[a]&&(s=t[a]),s<t[a+1]&&(s=t[a+1]),p(e.numlines_l[a-1]+e.numlines_l[a]+e.numlines_l[a+1]-1>0),(c=0|(o=20*(3*s-o)/(o*(e.numlines_l[a-1]+e.numlines_l[a]+e.numlines_l[a+1]-1))))>i&&(c=i),r[a]=c;else r[a]=0}(p(a>0),p(a==e.npart_l-1),o=n[a-1]+n[a],p(o>=0),o>0)?((s=t[a-1])<t[a]&&(s=t[a]),p(e.numlines_l[a-1]+e.numlines_l[a]-1>0),(c=0|(o=20*(2*s-o)/(o*(e.numlines_l[a-1]+e.numlines_l[a]-1))))>i&&(c=i),r[a]=c):r[a]=0;p(a==e.npart_l-1)}var V=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-2
21,.1863476,-1104424e-22,-.627638];function F(e,n,r,i,a,o,c,u){var l=e.internal_flags;if(i<2)t.fft_long(l,c[u],i,n,r);else if(2==i)for(var d=f.BLKSIZE-1;d>=0;--d){var p=c[u+0][d],h=c[u+1][d];c[u+0][d]=(p+h)*s.SQRT2*.5,c[u+1][d]=(p-h)*s.SQRT2*.5}o[0]=c[u+0][0],o[0]*=o[0];for(d=f.BLKSIZE/2-1;d>=0;--d){var v=c[u+0][f.BLKSIZE/2-d],m=c[u+0][f.BLKSIZE/2+d];o[f.BLKSIZE/2-d]=.5*(v*v+m*m)}var g=0;for(d=11;d<f.HBLKSIZE;d++)g+=o[d];if(l.tot_ener[i]=g,e.analysis){for(d=0;d<f.HBLKSIZE;d++)l.pinfo.energy[a][i][d]=l.pinfo.energy_save[i][d],l.pinfo.energy_save[i][d]=o[d];l.pinfo.pe[a][i]=l.pe[i]}}function z(e,n,r,i,a,o,c,u){var l=e.internal_flags;if(0==a&&i<2&&t.fft_short(l,c[u],i,n,r),2==i)for(var d=f.BLKSIZE_s-1;d>=0;--d){var p=c[u+0][a][d],h=c[u+1][a][d];c[u+0][a][d]=(p+h)*s.SQRT2*.5,c[u+1][a][d]=(p-h)*s.SQRT2*.5}o[a][0]=c[u+0][a][0],o[a][0]*=o[a][0];for(d=f.BLKSIZE_s/2-1;d>=0;--d){var v=c[u+0][a][f.BLKSIZE_s/2-d],m=c[u+0][a][f.BLKSIZE_s/2+d];o[a][f.BLKSIZE_s/2-d]=.5*(v*v+m*m)}}function H(e,t,n,r){var i=e.internal_flags;2==e.athaa_loudapprox&&n<2&&(i.loudness_sq[t][n]=i.loudness_sq_save[n],i.loudness_sq_save[n]=b(r,i))}this.L3psycho_anal_ns=function(t,n,r,a,s,h,v,y,b,_){var w,x,E,T,P,R,Z,L,N,F,z=t.internal_flags,H=l([2,f.BLKSIZE]),q=l([2,3,f.BLKSIZE_s]),G=u(f.CBANDS+1),W=u(f.CBANDS+1),J=u(f.CBANDS+2),$=d(2),K=d(2),Q=l([2,576]),Y=d(f.CBANDS+2),X=d(f.CBANDS+2);for(c.fill(X,0),w=z.channels_out,t.mode==e.JOINT_STEREO&&(w=4),N=t.VBR==i.vbr_off?0==z.ResvMax?0:z.ResvSize/z.ResvMax*.5:t.VBR==i.vbr_rh||t.VBR==i.vbr_mtrh||t.VBR==i.vbr_mt?.6:1,x=0;x<z.channels_out;x++){var ee=n[x],te=r+576-350-g+192;for(p(10==V.length),T=0;T<576;T++){var ne,re;for(ne=ee[te+T+10],re=0,P=0;P<9;P+=2)ne+=V[P]*(ee[te+T+P]+ee[te+T+g-P]),re+=V[P+1]*(ee[te+T+P+1]+ee[te+T+g-P-1]);Q[x][T]=ne+re}s[a][x].en.assign(z.en[x]),s[a][x].thm.assign(z.thm[x]),w>2&&(h[a][x].en.assign(z.en[x+2]),h[a][x].thm.assign(z.thm[x+2]))}for(x=0;x<w;x++){var ie,ae=u(12),oe=[0,0,0,0],se=u(12),ce=1,ue=u(f.CBANDS),le=u(f.CBANDS),de=[0,0,0,0],pe=u(f.HBLKSIZE),he=l([3,f.HBLKSIZE_s]);for(p(z.npart_s<=f.CBANDS),p(z.npart_l<=f.CBANDS),T=0;T<3;T++)ae[T]=z.nsPsy.last_en_subshort[x][T+6],p(z.nsPsy.last_en_subshort[x][T+4]>0),se[T]=ae[T]/z.nsPsy.last_en_subshort[x][T+4],oe[0]+=ae[T];if(2==x)for(T=0;T<576;T++){var fe,ve;fe=Q[0][T],ve=Q[1][T],Q[0][T]=fe+ve,Q[1][T]=fe-ve}var me=Q[1&x],ge=0;for(T=0;T<9;T++){for(var ye=ge+64,be=1;ge<ye;ge++)be<Math.abs(me[ge])&&(be=Math.abs(me[ge]));z.nsPsy.last_en_subshort[x][T]=ae[T+3]=be,oe[1+T/3]+=be,be>ae[T+3-2]?(p(ae[T+3-2]>0),be/=ae[T+3-2]):ae[T+3-2]>10*be?(p(be>0),be=ae[T+3-2]/(10*be)):be=0,se[T+3]=be}if(t.analysis){var ke=se[0];for(T=1;T<12;T++)ke<se[T]&&(ke=se[T]);z.pinfo.ers[a][x]=z.pinfo.ers_save[x],z.pinfo.ers_save[x]=ke}for(ie=3==x?z.nsPsy.attackthre_s:z.nsPsy.attackthre,T=0;T<12;T++)0==de[T/3]&&se[T]>ie&&(de[T/3]=T%3+1);for(T=1;T<4;T++){var _e;oe[T-1]>oe[T]?(p(oe[T]>0),_e=oe[T-1]/oe[T]):(p(oe[T-1]>0),_e=oe[T]/oe[T-1]),_e<1.7&&(de[T]=0,1==T&&(de[0]=0))}for(0!=de[0]&&0!=z.nsPsy.lastAttacks[x]&&(de[0]=0),3!=z.nsPsy.lastAttacks[x]&&de[0]+de[1]+de[2]+de[3]==0||(ce=0,0!=de[1]&&0!=de[0]&&(de[1]=0),0!=de[2]&&0!=de[1]&&(de[2]=0),0!=de[3]&&0!=de[2]&&(de[3]=0)),x<2?K[x]=ce:0==ce&&(K[0]=K[1]=0),b[x]=z.tot_ener[x],k(t,pe,he,H,1&x,q,1&x,a,x,n,r),B(z,pe,G,ue,le),U(z,ue,le,Y),L=0;L<3;L++){var we,xe;for(I(t,he,W,J,x,L),M(z,W,J,x,L),Z=0;Z<f.SBMAX_s;Z++){if(xe=z.thm[x].s[Z][L],xe*=.8,de[L]>=2||1==de[L+1]){var Se=0!=L?L-1:2;be=O(z.thm[x].s[Z][Se],xe,.6*N);xe=Math.min(xe,be)}if(1==de[L]){Se=0!=L?L-1:2,be=O(z.thm[x].s[Z][Se],xe,m*N);xe=Math.min(xe,be)}else if(0!=L&&3==de[L-1]||0==L&&3==z.nsPsy.lastAttacks[x]){Se=2!=L?L+1:0,be=O(z.thm[x].s[Z][Se],xe,m*N);xe=Math.min(xe,be)}we=ae[3*L+3]+ae[3*L+4]+ae[3*L+5],6*ae[3*L+5]<we&&(xe*=.5,6*ae[3*L+4]<we&&(xe*=.5)),z.thm[x].s[Z][L]=xe}}for(z.nsPsy.lastAttacks[x]=de[2],R=0,E=0;E<z.npart_l;E++){for(var Ee=z.s3ind[E][0],Te=G[Ee]*S[Y[Ee]],Pe=z.s3_ll[R++]*Te;++Ee<=z.s3ind[E][1];)Te=G[Ee]*S[Y[Ee]],Pe=C(Pe,z.s3_ll[R++]*Te,Ee,Ee-E,z,0);Pe*=.158489319246111,z.blocktype_old[1&x]==f.SHORT_TYPE?J[E]=Pe:J[E]=O(Math.min(Pe,Math.min(2*z.nb_1[x][E],16*z.nb_2[x][E])),Pe,N),z.nb_2[x][E]=z.nb_1[x][E],z.nb_1[x][E]=Pe}for(;E<=f.CBANDS;++E)G[E]=0,J[E]=0;A(z,G,J,x)}(t.mode!=e.STEREO&&t.mode!=e.JOINT_STEREO||t.interChRatio>0&&function(e,t){var n=e.internal_flags;if(n.channels_out>1){for(var r=0;r<f.SBMAX_l;r++){var i=n.thm[0].l[r],a=n.thm[1].l[r];n.thm[0].l[r]+=a*t,n.thm[1].l[r]+=i*t}for(r=0;r<f.SBMAX_s;r++)for(var o=0;o<3;o++)i=n.thm[0].s[r][o],a=n.thm[1].s[r][o],n.thm[0].s[r][o]+=a*t,n.thm[1].s[r][o]+=i*t}}(t,t.interChRatio),t.mode==e.JOINT_STEREO)&&(!function(e){for(var t=0;t<f.SBMAX_l;t++)if(!(e.thm[0].l[t]>1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var n=e.mld_l[t]*e.en[3].l[t],r=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],n));n=e.mld_l[t]*e.en[2].l[t];var i=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],n));e.thm[2].l[t]=r,e.thm[3].l[t]=i}for(t=0;t<f.SBMAX_s;t++)for(var a=0;a<3;a++)e.thm[0].s[t][a]>1.58*e.thm[1].s[t][a]||e.thm[1].s[t][a]>1.58*e.thm[0].s[t][a]||(n=e.mld_s[t]*e.en[3].s[t][a],r=Math.max(e.thm[2].s[t][a],Math.min(e.thm[3].s[t][a],n)),n=e.mld_s[t]*e.en[2].s[t][a],i=Math.max(e.thm[3].s[t][a],Math.min(e.thm[2].s[t][a],n)),e.thm[2].s[t][a]=r,e.thm[3].s[t][a]=i)}(z),F=t.msfix,Math.abs(F)>0&&function(e,t,n){var r=t,i=Math.pow(10,n);t*=2,r*=2;for(var a=0;a<f.SBMAX_l;a++)l=e.ATH.cb_l[e.bm_l[a]]*i,(s=Math.min(Math.max(e.thm[0].l[a],l),Math.max(e.thm[1].l[a],l)))*t<(c=Math.max(e.thm[2].l[a],l))+(u=Math.max(e.thm[3].l[a],l))&&p((c*=d=s*r/(c+u))+(u*=d)>0),e.thm[2].l[a]=Math.min(c,e.thm[2].l[a]),e.thm[3].l[a]=Math.min(u,e.thm[3].l[a]);for(i*=f.BLKSIZE_s/f.BLKSIZE,a=0;a<f.SBMAX_s;a++)for(var o=0;o<3;o++){var s,c,u,l,d;l=e.ATH.cb_s[e.bm_s[a]]*i,(s=Math.min(Math.max(e.thm[0].s[a][o],l),Math.max(e.thm[1].s[a][o],l)))*t<(c=Math.max(e.thm[2].s[a][o],l))+(u=Math.max(e.thm[3].s[a][o],l))&&p((c*=d=s*t/(c+u))+(u*=d)>0),e.thm[2].s[a][o]=Math.min(e.thm[2].s[a][o],c),e.thm[3].s[a][o]=Math.min(e.thm[3].s[a][o],u)}}(z,F,t.ATHlower*z.ATH.adjust));for(function(e,t,n,r){var i=e.internal_flags;e.short_blocks!=o.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var a=0;a<i.channels_out;a++)r[a]=f.NORM_TYPE,e.short_blocks==o.short_block_dispensed&&(t[a]=1),e.short_blocks==o.short_block_forced&&(t[a]=0),0!=t[a]?(p(i.blocktype_old[a]!=f.START_TYPE),i.blocktype_old[a]==f.SHORT_TYPE&&(r[a]=f.STOP_TYPE)):(r[a]=f.SHORT_TYPE,i.blocktype_old[a]==f.NORM_TYPE&&(i.blocktype_old[a]=f.START_TYPE),i.blocktype_old[a]==f.STOP_TYPE&&(i.blocktype_old[a]=f.SHORT_TYPE)),n[a]=i.blocktype_old[a],i.blocktype_old[a]=r[a]}(t,K,_,$),x=0;x<w;x++){var Ce,Re,Ze,Me=0;x>1?(Ce=y,Me=-2,Re=f.NORM_TYPE,_[0]!=f.SHORT_TYPE&&_[1]!=f.SHORT_TYPE||(Re=f.SHORT_TYPE),Ze=h[a][x-2]):(Ce=v,Me=0,Re=_[x],Ze=s[a][x]),Re==f.SHORT_TYPE?Ce[Me+x]=D(Ze,z.masking_lower):Ce[Me+x]=j(Ze,z.masking_lower),t.anal
2ysis&&(z.pinfo.pe[a][x]=Ce[Me+x])}return 0};var q=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-21,.1863476,-1104424e-22,-.627638];function G(e,t,n){if(0==n)for(var r=0;r<e.npart_s;r++)e.nb_s2[t][r]=e.nb_s1[t][r],e.nb_s1[t][r]=0}function W(e,t){for(var n=0;n<e.npart_l;n++)e.nb_2[t][n]=e.nb_1[t][n],e.nb_1[t][n]=0}function J(e,t,n,r,i,a){var o,s,c,l=e.internal_flags,d=new float[f.CBANDS],h=u(f.CBANDS),v=new int[f.CBANDS];for(c=s=0;c<l.npart_s;++c){var m=0,g=0,y=l.numlines_s[c];for(o=0;o<y;++o,++s){var b=t[a][s];m+=b,g<b&&(g=b)}n[c]=m,p(m>=0),d[c]=g,p(y>0),h[c]=m/y,p(h[c]>=0)}for(p(c==l.npart_s),p(129==s);c<f.CBANDS;++c)d[c]=0,h[c]=0;for(function(e,t,n,r){var i=S.length-1,a=0,o=n[a]+n[a+1];for(p(o>=0),o>0?((s=t[a])<t[a+1]&&(s=t[a+1]),p(e.numlines_s[a]+e.numlines_s[a+1]-1>0),(c=0|(o=20*(2*s-o)/(o*(e.numlines_s[a]+e.numlines_s[a+1]-1))))>i&&(c=i),r[a]=c):r[a]=0,a=1;a<e.npart_s-1;a++){var s,c;o=n[a-1]+n[a]+n[a+1],p(a+1<e.npart_s),p(o>=0),o>0?((s=t[a-1])<t[a]&&(s=t[a]),s<t[a+1]&&(s=t[a+1]),p(e.numlines_s[a-1]+e.numlines_s[a]+e.numlines_s[a+1]-1>0),(c=0|(o=20*(3*s-o)/(o*(e.numlines_s[a-1]+e.numlines_s[a]+e.numlines_s[a+1]-1))))>i&&(c=i),r[a]=c):r[a]=0}p(a>0),p(a==e.npart_s-1),o=n[a-1]+n[a],p(o>=0),o>0?((s=t[a-1])<t[a]&&(s=t[a]),p(e.numlines_s[a-1]+e.numlines_s[a]-1>0),(c=0|(o=20*(2*s-o)/(o*(e.numlines_s[a-1]+e.numlines_s[a]-1))))>i&&(c=i),r[a]=c):r[a]=0,p(a==e.npart_s-1)}(l,d,h,v),s=c=0;c<l.npart_s;c++){var k,_,w,x,E,T=l.s3ind_s[c][0],P=l.s3ind_s[c][1];
vendor: 5,207 bytes, line 2
2for(k=v[T],_=1,x=l.s3_ss[s]*n[T]*S[v[T]],++s,++T;T<=P;)k+=v[T],_+=1,x=Z(x,w=l.s3_ss[s]*n[T]*S[v[T]],T-c),++s,++T;x*=E=.5*S[k=(1+2*k)/(2*_)],r[c]=x,l.nb_s2[i][c]=l.nb_s1[i][c],l.nb_s1[i][c]=x,w=d[c],w*=l.minval_s[c],w*=E,r[c]>w&&(r[c]=w),l.masking_lower>1&&(r[c]*=l.masking_lower),r[c]>n[c]&&(r[c]=n[c]),l.masking_lower<1&&(r[c]*=l.masking_lower),p(r[c]>=0)}for(;c<f.CBANDS;++c)n[c]=0,r[c]=0}function $(e,t,n,r,i){var a,o=u(f.CBANDS),s=u(f.CBANDS),c=d(f.CBANDS+2);B(e,t,n,o,s),U(e,o,s,c);var l=0;for(a=0;a<e.npart_l;a++){var h,v,g,y=e.s3ind[a][0],b=e.s3ind[a][1],k=0,_=0;for(k=c[y],_+=1,v=e.s3_ll[l]*n[y]*S[c[y]],++l,++y;y<=b;)k+=c[y],_+=1,v=Z(v,h=e.s3_ll[l]*n[y]*S[c[y]],y-a),++l,++y;if(v*=g=.5*S[k=(1+2*k)/(2*_)],e.blocktype_old[1&i]==f.SHORT_TYPE){var w=2*e.nb_1[i][a];r[a]=w>0?Math.min(v,w):Math.min(v,n[a]*m)}else{var x=16*e.nb_2[i][a],E=2*e.nb_1[i][a];x<=0&&(x=v),E<=0&&(E=v),w=e.blocktype_old[1&i]==f.NORM_TYPE?Math.min(E,x):E,r[a]=Math.min(v,w)}e.nb_2[i][a]=e.nb_1[i][a],e.nb_1[i][a]=v,h=o[a],h*=e.minval_l[a],h*=g,r[a]>h&&(r[a]=h),e.masking_lower>1&&(r[a]*=e.masking_lower),r[a]>n[a]&&(r[a]=n[a]),e.masking_lower<1&&(r[a]*=e.masking_lower),p(r[a]>=0)}for(;a<f.CBANDS;++a)n[a]=0,r[a]=0}function K(e,t,n,r,i,a,o){for(var s,c,u=2*a,l=a>0?Math.pow(10,i):1,d=0;d<o;++d){var h=e[2][d],f=e[3][d],v=t[0][d],m=t[1][d],g=t[2][d],y=t[3][d];if(v<=1.58*m&&m<=1.58*v){var b=n[d]*f,k=n[d]*h;c=Math.max(g,Math.min(y,b)),s=Math.max(y,Math.min(g,k))}else c=g,s=y;if(a>0){var _,w,x=r[d]*l;if(_=Math.min(Math.max(v,x),Math.max(m,x)),(w=(g=Math.max(c,x))+(y=Math.max(s,x)))>0&&_*u<w){var S=_*u/w;g*=S,y*=S,p(w>0)}c=Math.min(g,c),s=Math.min(y,s)}c>h&&(c=h),s>f&&(s=f),t[2][d]=c,t[3][d]=s}}function Q(e,t){var n;return(n=e>=0?27*-e:e*t)<=-72?0:Math.exp(n*y)}function Y(e){var t,n,r=0;for(r=0;Q(r,e)>1e-20;r-=1);for(i=r,a=0;Math.abs(a-i)>1e-12;)Q(r=(a+i)/2,e)>0?a=r:i=r;t=i;var i,a;r=0;for(r=0;Q(r,e)>1e-20;r+=1);for(i=0,a=r;Math.abs(a-i)>1e-12;)Q(r=(a+i)/2,e)>0?i=r:a=r;n=a;var o,s=0,c=1e3;for(o=0;o<=c;++o){s+=Q(r=t+o*(n-t)/c,e)}return(c+1)/(s*(n-t))}function X(e){var t,n,r,i;return t=e,n=(t*=t>=0?3:1.5)>=.5&&t<=2.5?8*((i=t-.5)*i-2*i):0,(r=15.811389+7.5*(t+=.474)-17.5*Math.sqrt(1+t*t))<=-60?0:(t=Math.exp((n+r)*y),t/=.6609193)}function ee(e){return e<0&&(e=0),e*=.001,13*Math.atan(.76*e)+3.5*Math.atan(e*e/56.25)}function te(e,t,n,r,i,a,o,s,c,l,h,v){var m,g=u(f.CBANDS+1),y=s/(v>15?1152:384),b=d(f.HBLKSIZE);s/=c;var k=0,_=0;for(m=0;m<f.CBANDS;m++){var w;for(M=ee(s*k),g[m]=s*k,w=k;ee(s*w)-M<.34&&w<=c/2;w++);for(e[m]=w-k,_=m+1;k<w;)p(k<f.HBLKSIZE),b[k++]=m;if(k>c/2){k=c/2,++m;break}}p(m<f.CBANDS),g[m]=s*k;for(var x=0;x<v;x++){var S,E,T,P,C;T=l[x],P=l[x+1],(S=0|Math.floor(.5+h*(T-.5)))<0&&(S=0),(E=0|Math.floor(.5+h*(P-.5)))>c/2&&(E=c/2),n[x]=(b[S]+b[E])/2,t[x]=b[E];var R=y*P;o[x]=(R-g[t[x]])/(g[t[x]+1]-g[t[x]]),o[x]<0?o[x]=0:o[x]>1&&(o[x]=1),C=ee(s*l[x]*h),C=Math.min(C,15.5)/15.5,a[x]=Math.pow(10,1.25*(1-Math.cos(Math.PI*C))-2.5)}k=0;for(var Z=0;Z<_;Z++){var M,A,I=e[Z];M=ee(s*k),A=ee(s*(k+I-1)),r[Z]=.5*(M+A),M=ee(s*(k-.5)),A=ee(s*(k+I-.5)),i[Z]=A-M,k+=I}return _}function ne(e,t,n,r,i,a){var o,s=l([f.CBANDS,f.CBANDS]),c=0;if(a)for(var d=0;d<t;d++)for(o=0;o<t;o++){var p=X(n[d]-n[o])*r[o];s[d][o]=p*i[d]}else for(o=0;o<t;o++){var h=15+Math.min(21/n[o],12),v=Y(h);for(d=0;d<t;d++){p=v*Q(n[d]-n[o],h)*r[o];s[d][o]=p*i[d]}}for(d=0;d<t;d++){for(o=0;o<t&&!(s[d][o]>0);o++);for(e[d][0]=o,o=t-1;o>0&&!(s[d][o]>0);o--);e[d][1]=o,c+=e[d][1]-e[d][0]+1}var m=u(c),g=0;for(d=0;d<t;d++)for(o=e[d][0];o<=e[d][1];o++)m[g++]=s[d][o];return m}function re(e){var t=ee(e);return t=Math.min(t,15.5)/15.5,Math.pow(10,1.25*(1-Math.cos(Math.PI*t))-2.5)}function ie(e,t){return e<-.3&&(e=3410),e/=1e3,e=Math.max(.1,e),3.64*Math.pow(e,-.8)-6.8*Math.exp(-.6*Math.pow(e-3.4,2))+6*Math.exp(-.15*Math.pow(e-8.7,2))+.001*(.6+.04*t)*Math.pow(e,4)}this.L3psycho_anal_vbr=function(t,n,r,i,a,s,c,h,v,m){var y=t.internal_flags,b=u(f.HBLKSIZE),k=l([3,f.HBLKSIZE_s]),_=l([2,f.BLKSIZE]),w=l([2,3,f.BLKSIZE_s]),x=l([4,f.CBANDS]),S=l([4,f.CBANDS]),E=l([4,3]),T=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],P=d(2),C=t.mode==e.JOINT_STEREO?4:y.channels_out;!function(t,n,r,i,a,o,s,c,d,h){for(var f=l([2,576]),v=t.internal_flags,m=v.channels_out,y=t.mode==e.JOINT_STEREO?4:m,b=0;b<m;b++){firbuf=n[b];var k=r+576-350-g+192;p(10==q.length);for(var _=0;_<576;_++){var w,x;w=firbuf[k+_+10],x=0;for(var S=0;S<9;S+=2)w+=q[S]*(firbuf[k+_+S]+firbuf[k+_+g-S]),x+=q[S+1]*(firbuf[k+_+S+1]+firbuf[k+_+g-S-1]);f[b][_]=w+x}a[i][b].en.assign(v.en[b]),a[i][b].thm.assign(v.thm[b]),y>2&&(o[i][b].en.assign(v.en[b+2]),o[i][b].thm.assign(v.thm[b+2]))}for(b=0;b<y;b++){var E=u(12),T=u(12),P=[0,0,0,0],C=f[1&b],R=0,Z=3==b?v.nsPsy.attackthre_s:v.nsPsy.attackthre,M=1;if(2==b)for(_=0,S=576;S>0;++_,--S){var A=f[0][_],I=f[1][_];f[0][_]=A+I,f[1][_]=A-I}for(_=0;_<3;_++)T[_]=v.nsPsy.last_en_subshort[b][_+6],p(v.nsPsy.last_en_subshort[b][_+4]>0),E[_]=T[_]/v.nsPsy.last_en_subshort[b][_+4],P[0]+=T[_];for(_=0;_<9;_++){for(var O=R+64,L=1;R<O;R++)L<Math.abs(C[R])&&(L=Math.abs(C[R]));v.nsPsy.last_en_subshort[b][_]=T[_+3]=L,P[1+_/3]+=L,L>T[_+3-2]?(p(T[_+3-2]>0),L/=T[_+3-2]):T[_+3-2]>10*L?(p(L>0),L=T[_+3-2]/(10*L)):L=0,E[_+3]=L}for(_=0;_<3;++_){var D=T[3*_+3]+T[3*_+4]+T[3*_+5],N=1;
26*T[3*_+5]<D&&(N*=.5,6*T[3*_+4]<D&&(N*=.5)),c[b][_]=N}if(t.analysis){var j=E[0];for(_=1;_<12;_++)j<E[_]&&(j=E[_]);v.pinfo.ers[i][b]=v.pinfo.ers_save[b],v.pinfo.ers_save[b]=j}for(_=0;_<12;_++)0==d[b][_/3]&&E[_]>Z&&(d[b][_/3]=_%3+1);for(_=1;_<4;_++){var B=P[_-1],U=P[_];Math.max(B,U)<4e4&&B<1.7*U&&U<1.7*B&&(1==_&&d[b][0]<=d[b][_]&&(d[b][0]=0),d[b][_]=0)}d[b][0]<=v.nsPsy.lastAttacks[b]&&(d[b][0]=0),3!=v.nsPsy.lastAttacks[b]&&d[b][0]+d[b][1]+d[b][2]+d[b][3]==0||(M=0,0!=d[b][1]&&0!=d[b][0]&&(d[b][1]=0),0!=d[b][2]&&0!=d[b][1]&&(d[b][2]=0),0!=d[b][3]&&0!=d[b][2]&&(d[b][3]=0)),b<2?h[b]=M:0==M&&(h[0]=h[1]=0),s[b]=v.tot_ener[b]}}(t,n,r,i,a,s,v,E,T,P),function(e,t){var n=e.internal_flags;e.short_blocks!=o.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var r=0;r<n.channels_out;r++)e.short_blocks==o.short_block_dispensed&&(t[r]=1),e.short_blocks==o.short_block_forced&&(t[r]=0)}(t,P);for(var R=0;R<C;R++){F(t,n,r,R,i,b,_,I=1&R),H(t,i,R,b),0!=P[I]?$(y,b,x[R],S[R],R):W(y,R)}P[0]+P[1]==2&&t.mode==e.JOINT_STEREO&&K(x,S,y.mld_cb_l,y.ATH.cb_l,t.ATHlower*y.ATH.adjust,t.msfix,y.npart_l);for(R=0;R<C;R++){0!=P[I=1&R]&&A(y,x[R],S[R],R)}for(var Z=0;Z<3;Z++){for(R=0;R<C;++R){0!=P[I=1&R]?G(y,R,Z):(z(t,n,r,R,Z,k,w,I),J(t,k,x[R],S[R],R,Z))}P[0]+P[1]==0&&t.mode==e.JOINT_STEREO&&K(x,S,y.mld_cb_s,y.ATH.cb_s,t.ATHlower*y.ATH.adjust,t.msfix,y.npart_s);for(R=0;R<C;++R){0==P[I=1&R]&&M(y,x[R],S[R],R,Z)}}for(R=0;R<C;R++){var I;if(0==P[I=1&R])for(var L=0;L<f.SBMAX_s;L++){var N=u(3);for(Z=0;Z<3;Z++){var B=y.thm[R].s[L][Z];if(B*=.8,T[R][Z]>=2||1==T[R][Z+1]){var U=0!=Z?Z-1:2,V=O(y.thm[R].s[L][U],B,.36);B=Math.min(B,V)}else if(1==T[R][Z]){U=0!=Z?Z-1:2,V=O(y.thm[R].s[L][U],B,.18);B=Math.min(B,V)}else if(0!=Z&&3==T[R][Z-1]||0==Z&&3==y.nsPsy.lastAttacks[R]){U=2!=Z?Z+1:0,V=O(y.thm[R].s[L][U],B,.18);B=Math.min(B,V)}B*=E[R][Z],N[Z]=B}for(Z=0;Z<3;Z++)y.thm[R].s[L][Z]=N[Z]}}for(R=0;R<C;R++)y.nsPsy.lastAttacks[R]=T[R][2];!function(e,t,n){for(var r=e.internal_flags,i=0;i<r.channels_out;i++){var a=f.NORM_TYPE;0!=t[i]?(p(r.blocktype_old[i]!=f.START_TYPE),r.blocktype_old[i]==f.SHORT_TYPE&&(a=f.STOP_TYPE)):(a=f.SHORT_TYPE,r.blocktype_old[i]==f.NORM_TYPE&&(r.blocktype_old[i]=f.START_TYPE),r.blocktype_old[i]==f.STOP_TYPE&&(r.blocktype_old[i]=f.SHORT_TYPE)),n[i]=r.blocktype_old[i],r.blocktype_old[i]=a}}(t,P,m);for(R=0;R<C;R++){var Q,Y,X,ee;R>1?(Q=h,Y=-2,X=f.NORM_TYPE,m[0]!=f.SHORT_TYPE&&m[1]!=f.SHORT_TYPE||(X=f.SHORT_TYPE),ee=s[i][R-2]):(Q=c,Y=0,X=m[R],ee=a[i][R]),X==f.SHORT_TYPE?Q[Y+R]=D(ee,y.masking_lower):Q[Y+R]=j(ee,y.masking_lower),t.anal
2ysis&&(y.pinfo.pe[i][R]=Q[Y+R])}return 0},this.psymodel_init=function(e){var n,o=e.internal_flags,s=!0,c=13,l=24,d=0,h=0,v=-8.25,m=-4.5,g=u(f.CBANDS),y=u(f.CBANDS),b=u(f.CBANDS),k=e.out_samplerate;switch(e.experimentalZ){default:case 0:s=!0;break;case 1:s=e.VBR!=i.vbr_mtrh&&e.VBR!=i.vbr_mt;break;case 2:s=!1;break;case 3:c=8,d=-1.75,h=-.0125,v=-8.25,m=-2.25}for(o.ms_ener_ratio_old=.25,o.blocktype_old[0]=o.blocktype_old[1]=f.NORM_TYPE,n=0;n<4;++n){for(var S=0;S<f.CBANDS;++S)o.nb_1[n][S]=1e20,o.nb_2[n][S]=1e20,o.nb_s1[n][S]=o.nb_s2[n][S]=1;for(var E=0;E<f.SBMAX_l;E++)o.en[n].l[E]=1e20,o.thm[n].l[E]=1e20;for(S=0;S<3;++S){for(E=0;E<f.SBMAX_s;E++)o.en[n].s[E][S]=1e20,o.thm[n].s[E][S]=1e20;o.nsPsy.lastAttacks[n]=0}for(S=0;S<9;S++)o.nsPsy.last_en_subshort[n][S]=10}for(o.loudness_sq_save[0]=o.loudness_sq_save[1]=0,o.npart_l=te(o.numlines_l,o.bo_l,o.bm_l,g,y,o.mld_l,o.PSY.bo_l_weight,k,f.BLKSIZE,o.scalefac_band.l,f.BLKSIZE/1152,f.SBMAX_l),p(o.npart_l<f.CBANDS),n=0;n<o.npart_l;n++){var T=d;g[n]>=c&&(T=h*(g[n]-c)/(l-c)+d*(l-g[n])/(l-c)),b[n]=Math.pow(10,T/10),o.numlines_l[n]>0?o.rnumlines_l[n]=1/o.numlines_l[n]:o.rnumlines_l[n]=0}o.s3_ll=ne(o.s3ind,o.npart_l,g,y,b,s);var P;S=0;for(n=0;n<o.npart_l;n++){Z=a.MAX_VALUE;for(var C=0;C<o.numlines_l[n];C++,S++){var R=k*S/(1e3*f.BLKSIZE);M=this.ATHformula(1e3*R,e)-20,M=Math.pow(10,.1*M),Z>(M*=o.numlines_l[n])&&(Z=M)}o.ATH.cb_l[n]=Z,(Z=20*g[n]/10-20)>6&&(Z=100),Z<-15&&(Z=-15),Z-=8,o.minval_l[n]=Math.pow(10,Z/10)*o.numlines_l[n]}for(o.npart_s=te(o.numlines_s,o.bo_s,o.bm_s,g,y,o.mld_s,o.PSY.bo_s_weight,k,f.BLKSIZE_s,o.scalefac_band.s,f.BLKSIZE_s/384,f.SBMAX_s),p(o.npart_s<f.CBANDS),S=0,n=0;n<o.npart_s;n++){var Z;T=v;g[n]>=c&&(T=m*(g[n]-c)/(l-c)+v*(l-g[n])/(l-c)),b[n]=Math.pow(10,T/10),Z=a.MAX_VALUE;for(C=0;C<o.numlines_s[n];C++,S++){var M;R=k*S/(1e3*f.BLKSIZE_s);M=this.ATHformula(1e3*R,e)-20,M=Math.pow(10,.1*M),Z>(M*=o.numlines_s[n])&&(Z=M)}o.ATH.cb_s[n]=Z,Z=7*g[n]/12-7,g[n]>12&&(Z*=1+3.1*Math.log(1+Z)),g[n]<12&&(Z*=1+2.3*Math.log(1-Z)),Z<-15&&(Z=-15),Z-=8,o.minval_s[n]=Math.pow(10,Z/10)*o.numlines_s[n]}o.s3_ss=ne(o.s3ind_s,o.npart_s,g,y,b,s),_=Math.pow(10,9/16),w=Math.pow(10,1.5),x=Math.pow(10,1.5),t.init_fft(o),o.decay=Math.exp(-1*r/(.01*k/192)),P=3.5,0!=(2&e.exp_nspsytune)&&(P=1),Math.abs(e.msfix)>0&&(P=e.msfix),e.msfix=P;for(var A=0;A<o.npart_l;A++)o.s3ind[A][1]>o.npart_l-1&&(o.s3ind[A][1]=o.npart_l-1);var I=576*o.mode_gr/k;if(o.ATH.decay=Math.pow(10,-1.2*I),o.ATH.adjust=.01,o.ATH.adjustLimit=1,p(o.bo_l[f.SBMAX_l-1]<=o.npart_l),p(o.bo_s[f.SBMAX_s-1]<=o.npart_s),-1!=e.ATHtype){var O=e.out_samplerate/f.BLKSIZE,L=0;for(R=0,n=0;n<f.BLKSIZE/2;++n)R+=O,o.ATH.eql_w[n]=1/Math.pow(10,this.ATHformula(R,e)/10),L+=o.ATH.eql_w[n];for(L=1/L,n=f.BLKSIZE/2;--n>=0;)o.ATH.eql_w[n]*=L}for(A=S=0;A<o.npart_s;++A)for(n=0;n<o.numlines_s[A];++n)++S;p(129==S);for(A=S=0;A<o.npart_l;++A)for(n=0;n<o.numlines_l[A];++n)++S;for(p(513==S),S=0,n=0;n<o.npart_l;n++){R=k*(S+o.numlines_l[n]/2)/(1*f.BLKSIZE);o.mld_cb_l[n]=re(R),S+=o.numlines_l[n]}for(;n<f.CBANDS;++n)o.mld_cb_l[n]=1;for(S=0,n=0;n<o.npart_s;n++){R=k*(S+o.numlines_s[n]/2)/(1*f.BLKSIZE_s);o.mld_cb_s[n]=re(R),S+=o.numlines_s[n]}for(;n<f.CBANDS;++n)o.mld_cb_s[n]=1;return 0},this.ATHformula=function(e,t){var n;switch(t.ATHtype){case 0:n=ie(e,9);break;case 1:n=ie(e,-1);break;case 2:default:n=ie(e,0);break;case 3:n=ie(e,1)+6;break;case 4:n=ie(e,t.ATHcurve)}return n}}},2349:function(e,t,n){var r=n(8768),i=r.System,a=r.VbrMode,o=(r.Float,r.ShortBlock,r.Util),s=r.Arrays,c=(r.new_array_n,r.new_byte,r.new_double,r.new_float),u=(r.new_float_n,r.new_int,r.new_int_n,r.assert),l=n(1828),d=n(1918),p=n(4869),h=n(610),f=n(637),v=n(2963);e.exports=function(){var e,t,n;this.rv=null,this.qupvt=null;var r,m=new l;function g(e){this.ordinal=e}function y(e){for(var t=0;t<e.sfbmax;t++)if(e.scalefac[t]+e.subblock_gain[e.window[t]]==0)return!1;return!0}function b(e,t,n,r,i){var a;switch(e){default:case 9:t.over_count>0?(a=n.over_SSD<=t.over_SSD,n.over_SSD==t.over_SSD&&(a=n.bits<t.bits)):a=n.max_noise<0&&10*n.max_noise+n.bits<=10*t.max_noise+t.bits;break;case 0:a=n.over_count<t.over_count||n.over_count==t.over_count&&n.over_noise<t.over_noise||n.over_count==t.over_count&&BitStream.EQ(n.over_noise,t.over_noise)&&n.tot_noise<t.tot_noise;break;
2case 8:n.max_noise=function(e,t){for(var n,r=1e-37,i=0;i<t.psymax;i++)r+=(n=e[i],o.FAST_LOG10(.368+.632*n*n*n));return Math.max(1e-20,r)}(i,r);case 1:a=n.max_noise<t.max_noise;break;case 2:a=n.tot_noise<t.tot_noise;break;case 3:a=n.tot_noise<t.tot_noise&&n.max_noise<t.max_noise;break;case 4:a=n.max_noise<=0&&t.max_noise>.2||n.max_noise<=0&&t.max_noise<0&&t.max_noise>n.max_noise-.2&&n.tot_noise<t.tot_noise||n.max_noise<=0&&t.max_noise>0&&t.max_noise>n.max_noise-.2&&n.tot_noise<t.tot_noise+t.over_noise||n.max_noise>0&&t.max_noise>-.05&&t.max_noise>n.max_noise-.1&&n.tot_noise+n.over_noise<t.tot_noise+t.over_noise||n.max_noise>0&&t.max_noise>-.1&&t.max_noise>n.max_noise-.15&&n.tot_noise+n.over_noise+n.over_noise<t.tot_noise+t.over_noise+t.over_noise;break;case 5:a=n.over_noise<t.over_noise||BitStream.EQ(n.over_noise,t.over_noise)&&n.tot_noise<t.tot_noise;break;case 6:a=n.over_noise<t.over_noise||BitStream.EQ(n.over_noise,t.over_noise)&&(n.max_noise<t.max_noise||BitStream.EQ(n.max_noise,t.max_noise)&&n.tot_noise<=t.tot_noise);break;case 7:a=n.over_count<t.over_count||n.over_noise<t.over_noise}return 0==t.over_count&&(a=a&&n.bits<t.bits),a}function k(e,t,i,a,o){var c=e.internal_flags;!function(e,t,n,r,i){var a,o=e.internal_flags;a=0==t.scalefac_scale?1.2968395546510096:1.6817928305074292;for(var s=0,c=0;c<t.sfbmax;c++)s<n[c]&&(s=n[c]);var u=o.noise_shaping_amp;switch(3==u&&(u=i?2:1),u){case 2:break;case 1:s>1?s=Math.pow(s,.5):s*=.95;break;default:s>1?s=1:s*=.95}var l=0;for(c=0;c<t.sfbmax;c++){var d,p=t.width[c];if(l+=p,!(n[c]<s)){if(0!=(2&o.substep_shaping)&&(o.pseudohalf[c]=0==o.pseudohalf[c]?1:0,0==o.pseudohalf[c]&&2==o.noise_shaping_amp))return;for(t.scalefac[c]++,d=-p;d<0;d++)r[l+d]*=a,r[l+d]>t.xrpow_max&&(t.xrpow_max=r[l+d]);if(2==o.noise_shaping_amp)return}}}(e,t,i,a,o);var l=y(t);return!l&&(!(l=2==c.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(c,t))||(c.noise_shaping>1&&(s.fill(c.pseudohalf,0),0==t.scalefac_scale?(!function(e,t){for(var r=0,i=0;i<e.sfbmax;i++){var a=e.width[i],o=e.scalefac[i];if(0!=e.preflag&&(o+=n.pretab[i]),r+=a,0!=(1&o)){o++;for(var s=-a;s<0;s++)t[r+s]*=1.2968395546510096,t[r+s]>e.xrpow_max&&(e.xrpow_max=t[r+s])}e.scalefac[i]=o>>1}e.preflag=0,e.scalefac_scale=1}(t,a),l=!1):t.block_type==h.SHORT_TYPE&&c.subblock_gain>0&&(l=function(e,t,r){var i,a=t.scalefac;for(i=0;i<t.sfb_lmax;i++)if(a[i]>=16)return!0;for(var o=0;o<3;o++){var s=0,c=0;for(i=t.sfb_lmax+o;i<t.sfbdivide;i+=3)s<a[i]&&(s=a[i]);for(;i<t.sfbmax;i+=3)c<a[i]&&(c=a[i]);if(!(s<16&&c<8)){if(t.subblock_gain[o]>=7)return!0;t.subblock_gain[o]++;var l=e.scalefac_band.l[t.sfb_lmax];for(i=t.sfb_lmax+o;i<t.sfbmax;i+=3){var d=t.width[i],p=a[i];if(u(p>=0),(p-=4>>t.scalefac_scale)>=0)a[i]=p,l+=3*d;else{a[i]=0;var h=210+(p<<t.scalefac_scale+1);v=n.IPOW20(h),l+=d*(o+1);for(var f=-d;f<0;f++)r[l+f]*=v,r[l+f]>t.xrpow_max&&(t.xrpow_max=r[l+f]);l+=d*(3-o-1)}}var v=n.IPOW20(202);for(l+=t.width[i]*(o+1),f=-t.width[i];f<0;f++)r[l+f]*=v,r[l+f]>t.xrpow_max&&(t.xrpow_max=r[l+f])}}return!1}(c,t,a)||y(t))),l||(l=2==c.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(c,t)),!l))}this.setModules=function(i,a,o,s){e=i,t=a,this.rv=a,n=o,this.qupvt=o,r=s,m.setModules(n,r)},this.ms_convert=function(e,t){for(var n=0;n<576;++n){var r=e.tt[t][0].xr[n],i=e.tt[t][1].xr[n];e.tt[t][0].xr[n]=(r+i)*(.5*o.SQRT2),e.tt[t][1].xr[n]=(r-i)*(.5*o.SQRT2)}},this.init_xrpow=function(e,t,n){var r=0,i=0|t.max_nonzero_coeff;if(u(null!=n),t.xrpow_max=0,u(0<=i&&i<=575),s.fill(n,i,576,0),r=function(e,t,n,r){r=0;for(var i=0;i<=n;++i){var a=Math.abs(e.xr[i]);r+=a,t[i]=Math.sqrt(a*Math.sqrt(a)),t[i]>e.xrpow_max&&(e.xrpow_max=t[i])}return r}(t,n,i,r),r>1e-20){var a=0;0!=(2&e.substep_shaping)&&(a=1);for(var o=0;o<t.psymax;o++)e.pseudohalf[o]=a;return!0}return s.fill(t.l3_enc,0,576,0),!1},this.init_outer_loop=function(e,t){t.part2_3_length=0,t.big_values=0,t.count1=0,t.global_gain=210,t.scalefac_compress=0,t.table_select[0]=0,t.table_select[1]=0,t.table_select[2]=0,t.subblock_gain[0]=0,t.subblock_gain[1]=0,t.subblock_gain[2]=0,t.subblock_gain[3]=0,t.region0_count=0,t.region1_count=0,t.preflag=0,t.scalefac_scale=0,t.count1table_select=0,t.part2_length=0,t.sfb_lmax=h.SBPSY_l,t.sfb_smin=h.SBPSY_s,t.psy_lmax=e.sfb21_extra?h.SBMAX_l:h.SBPSY_l,t.psymax=t.psy_lmax,t.sfbmax=t.sfb_lmax,t.sfbdivide=11;for(var r=0;r<h.SBMAX_l;r++)t.width[r]=e.scalefac_band.l[r+1]-e.scalefac_band.l[r],t.window[r]=3;if(t.block_type==h.SHORT_TYPE){var a=c(576);t.sfb_smin=0,t.sfb_lmax=0,0!=t.mixed_block_flag&&(t.sfb_smin=3,t.sfb_lmax=2*e.mode_gr+4),t.psymax=t.sfb_lmax+3*((e.sfb21_extra?h.SBMAX_s:h.SBPSY_s)-t.sfb_smin),t.sfbmax=t.sfb_lmax+3*(h.SBPSY_s-t.sfb_smin),t.sfbdivide=t.sfbmax-18,t.psy_lmax=t.sfb_lmax;var o=e.scalefac_band.l[t.sfb_lmax];i.arraycopy(t.xr,0,a,0,576);for(r=t.sfb_smin;r<h.SBMAX_s;r++)for(var u=e.scalefac_band.s[r],l=e.scalefac_band.s[r+1],d=0;d<3;d++)for(var p=u;p<l;p++)t.xr[o++]=a[3*p+d];var f=t.sfb_lmax;for(r=t.sfb_smin;r<h.SBMAX_s;r++)t.width[f]=t.width[f+1]=t.width[f+2]=e.scalefac_band.s[r+1]-e.scalefac_band.s[r],t.window[f]=0,t.window[f+1]=1,t.window[f+2]=2,f+=3}t.count1bits=0,t.sfb_partition_table=n.nr_of_sfb_block[0][0],t.slen[0]=0,t.slen[1]=0,t.slen[2]=0,t.slen[3]=0,t.max_nonzero_coeff=575,s.fill(t.scalefac,0),function(e,t){var r=e.ATH,i=t.xr;if(t.block_type!=h.SHORT_TYPE)for(var a=!1,o=h.PSFB21-1;o>=0&&!a;o--){var s=e.scalefac_band.psfb21[o],c=e.scalefac_band.psfb21[o+1],u=n.athAdjust(r.adjust,r.psfb21[o],r.floor);e.nsPsy.longfact[21]>1e-12&&(u*=e.nsPsy.longfact[21]);for(var l=c-1;l>=s;l--){if(!(Math.abs(i[l])<u)){a=!0;break}i[l]=0}}else for(var d=0;d<3;d++)for(a=!1,o=h.PSFB12-1;o>=0&&!a;o--){c=(s=3*e.scalefac_band.s[12]+(e.scalefac_band.s[13]-e.scalefac_band.s[12])*d+(e.scalefac_band.psfb12[o]-e.scalefac_band.psfb12[0]))+(e.scalefac_band.psfb12[o+1]-e.scalefac_band.psfb12[o]);var p=n.athAdjust(r.adjust,r.psfb12[o],r.floor);for(e.nsPsy.shortfact[12]>1e-12&&(p*=e.nsPsy.shortfact[12]),l=c-1;l>=s;l--){if(!(Math.abs(i[l])<p)){a=!0;break}i[l]=0}}}(e,t)},g.BINSEARCH_NONE=new g(0),g.BINSEARCH_UP=new g(1),g.BINSEARCH_DOWN=new g(2),this.trancate_smallspectrums=function(e,t,i,a){var o=c(v.SFBMAX);if((0!=(4&e.substep_shaping)||t.block_type!=h.SHORT_TYPE)&&0==(128&e.substep_shaping)){n.c
vendor: 12,554 bytes, line 2
2alc_noise(t,i,o,new d,null);for(var u=0;u<576;u++){var l=0;0!=t.l3_enc[u]&&(l=Math.abs(t.xr[u])),a[u]=l}u=0;var p=8;t.block_type==h.SHORT_TYPE&&(p=6);do{var f,m,g,y,b=t.width[p];if(u+=b,!(o[p]>=1)&&(s.sort(a,u-b,b),!BitStream.EQ(a[u-1],0))){f=(1-o[p])*i[p],m=0,y=0;do{var k;for(g=1;y+g<b&&!BitStream.NEQ(a[y+u-b],a[y+u+g-b]);g++);if(f<(k=a[y+u-b]*a[y+u-b]*g)){0!=y&&(m=a[y+u-b-1]);break}f-=k,y+=g}while(y<b);if(!BitStream.EQ(m,0))do{Math.abs(t.xr[u-b])<=m&&(t.l3_enc[u-b]=0)}while(--b>0)}}while(++p<t.psymax);t.part2_3_length=r.noquant_count_bits(e,t,null)}},this.outer_loop=function(e,t,o,s,l,m){var y=e.internal_flags,_=new f,w=c(576),x=c(v.SFBMAX),S=new d,E=new p,T=9999999,P=!1,C=!1,R=0;if(function(e,t,n,i,a){var o,s=e.CurrentStep[i],c=!1,l=e.OldValue[i],d=g.BINSEARCH_NONE;for(t.global_gain=l,n-=t.part2_length,u(0!=s);;){var p;if(o=r.count_bits(e,a,t,null),1==s||o==n)break;o>n?(d==g.BINSEARCH_DOWN&&(c=!0),c&&(s/=2),d=g.BINSEARCH_UP,p=s):(d==g.BINSEARCH_UP&&(c=!0),c&&(s/=2),d=g.BINSEARCH_DOWN,p=-s),t.global_gain+=p,t.global_gain<0&&(t.global_gain=0,c=!0),t.global_gain>255&&(t.global_gain=255,c=!0)}for(u(t.global_gain>=0),u(t.global_gain<256);o>n&&t.global_gain<255;)t.global_gain++,o=r.count_bits(e,a,t,null);e.CurrentStep[i]=l-t.global_gain>=4?4:2,e.OldValue[i]=t.global_gain,t.part2_3_length=o}(y,t,m,l,s),0==y.noise_shaping)return 100;n.calc_noise(t,o,x,S,E),S.bits=t.part2_3_length,_.assign(t);var Z=0;for(i.arraycopy(s,0,w,0,576);!P;){do{var M,A=new d,I=255;if(M=0!=(2&y.substep_shaping)?20:3,y.sfb21_extra){if(x[_.sfbmax]>1)break;if(_.block_type==h.SHORT_TYPE&&(x[_.sfbmax+1]>1||x[_.sfbmax+2]>1))break}if(!k(e,_,x,s,C))break;0!=_.scalefac_scale&&(I=254);var O=m-_.part2_length;if(O<=0)break;for(;(_.part2_3_length=r.count_bits(y,s,_,E))>O&&_.global_gain<=I;)_.global_gain++;if(_.global_gain>I)break;if(0==S.over_count){for(;(_.part2_3_length=r.count_bits(y,s,_,E))>T&&_.global_gain<=I;)_.global_gain++;if(_.global_gain>I)break}if(n.calc_noise(_,o,x,A,E),A.bits=_.part2_3_length,0!=(b(t.block_type!=h.SHORT_TYPE?e.quant_comp:e.quant_comp_short,S,A,_,x)?1:0))T=t.part2_3_length,S=A,t.assign(_),Z=0,i.arraycopy(s,0,w,0,576);else if(0==y.full_outer_loop){if(++Z>M&&0==S.over_count)break;if(3==y.noise_shaping_amp&&C&&Z>30)break;if(3==y.noise_shaping_amp&&C&&_.global_gain-R>15)break}}while(_.global_gain+_.scalefac_scale<255);3==y.noise_shaping_amp?C?P=!0:(_.assign(t),i.arraycopy(w,0,s,0,576),Z=0,R=_.global_gain,C=!0):P=!0}return u(t.global_gain+t.scalefac_scale<=255),e.VBR==a.vbr_rh||e.VBR==a.vbr_mtrh?i.arraycopy(w,0,s,0,576):0!=(1&y.substep_shaping)&&trancate_smallspectrums(y,t,o,s),S.over_count},this.iteration_finish_one=function(e,n,i){var a=e.l3_side,o=a.tt[n][i];r.best_scalefac_store(e,n,i,a),1==e.use_best_huffman&&r.best_huffman_divide(e,o),t.ResvAdjust(e,o)},this.VBR_encode_granule=function(e,t,n,r,a,o,l){var d,p=e.internal_flags,h=new f,v=c(576),m=l,g=l+1,y=(l+o)/2,b=0,k=p.sfb21_extra;u(m<=LameInternalFlags.MAX_BITS_PER_CHANNEL),s.fill(h.l3_enc,0);do{u(y>=o),u(y<=l),u(o<=l),p.sfb21_extra=!(y>m-42)&&k,outer_loop(e,t,n,r,a,y)<=0?(b=1,g=t.part2_3_length,h.assign(t),i.arraycopy(r,0,v,0,576),d=(l=g-32)-o,y=(l+o)/2):(d=l-(o=y+32),y=(l+o)/2,0!=b&&(b=2,t.assign(h),i.arraycopy(v,0,r,0,576)))}while(d>12);p.sfb21_extra=k,2==b&&i.arraycopy(h.l3_enc,0,t.l3_enc,0,576),u(t.part2_3_length<=m)},this.get_framebits=function(n,r){var i=n.internal_flags;i.bitrate_index=i.VBR_min_bitrate;var a=e.getframebits(n);i.bitrate_index=1,a=e.getframebits(n);for(var o=1;o<=i.VBR_max_bitrate;o++){i.bitrate_index=o;var s=new MeanBits(a);r[o]=t.ResvFrameBegin(n,s),a=s.bits}},this.VBR_old_prepare=function(e,r,i,a,o,s,c,u,l){var d,p=e.internal_flags,f=0,v=1,m=0;p.bitrate_index=p.VBR_max_bitrate;var g=t.ResvFrameBegin(e,new MeanBits(0))/p.mode_gr;get_framebits(e,s);for(var y=0;y<p.mode_gr;y++){var b=n.on_pe(e,r,u[y],g,y,0);p.mode_ext==h.MPG_MD_MS_LR&&(ms_convert(p.l3_side,y),n.reduce_side(u[y],i[y],g,b));for(var k=0;k<p.channels_out;++k){var _=p.l3_side.tt[y][k];_.block_type!=h.SHORT_TYPE?(f=1.28/(1+Math.exp(3.5-r[y][k]/300))-.05,d=p.PSY.mask_adjust-f):(f=2.56/(1+Math.exp(3.5-r[y][k]/300))-.14,d=p.PSY.mask_adjust_short-f),p.masking_lower=Math.pow(10,.1*d),init_outer_loop(p,_),l[y][k]=n.calc_xmin(e,a[y][k],_,o[y][k]),0!=l[y][k]&&(v=0),c[y][k]=126,m+=u[y][k]}}for(y=0;y<p.mode_gr;y++)for(k=0;k<p.channels_out;k++)m>s[p.VBR_max_bitrate]&&(u[y][k]*=s[p.VBR_max_bitrate],u[y][k]/=m),c[y][k]>u[y][k]&&(c[y][k]=u[y][k]);return v},this.bitpressure_strategy=function(e,t,n,r){for(var i=0;i<e.mode_gr;i++)for(var a=0;a<e.channels_out;a++){for(var o=e.l3_side.tt[i][a],s=t[i][a],c=0,u=0;u<o.psy_lmax;u++)s[c++]*=1+.029*u*u/h.SBMAX_l/h.SBMAX_l;if(o.block_type==h.SHORT_TYPE)for(u=o.sfb_smin;u<h.SBMAX_s;u++)s[c++]*=1+.029*u*u/h.SBMAX_s/h.SBMAX_s,s[c++]*=1+.029*u*u/h.SBMAX_s/h.SBMAX_s,s[c++]*=1+.029*u*u/h.SBMAX_s/h.SBMAX_s;r[i][a]=0|Math.max(n[i][a],.9*r[i][a])}},this.VBR_new_prepare=function(e,r,i,a,o,s){var c,u=e.internal_flags,l=1,d=0,p=0;if(e.free_format){u.bitrate_index=0;f=new MeanBits(d);c=t.ResvFrameBegin(e,f),d=f.bits,o[0]=c}else{u.bitrate_index=u.VBR_max_bitrate;var f=new MeanBits(d);t.ResvFrameBegin(e,f),d=f.bits,get_framebits(e,o),c=o[u.VBR_max_bitrate]}for(var v=0;v<u.mode_gr;v++){n.on_pe(e,r,s[v],d,v,0),u.mode_ext==h.MPG_MD_MS_LR&&ms_convert(u.l3_side,v);for(var m=0;m<u.channels_out;++m){var g=u.l3_side.tt[v][m];u.masking_lower=Math.pow(10,.1*u.PSY.mask_adjust),init_outer_loop(u,g),0!=n.calc_xmin(e,i[v][m],g,a[v][m])&&(l=0),p+=s[v][m]}}for(v=0;v<u.mode_gr;v++)for(m=0;m<u.channels_out;m++)p>c&&(s[v][m]*=c,s[v][m]/=p);return l},this.calc_target_bits=function(r,i,a,o,s,c){var u,l,d,p,f=r.internal_flags,v=f.l3_side,m=0;f.bitrate_index=f.VBR_max_bitrate;var g=new MeanBits(m);for(c[0]=t.ResvFrameBegin(r,g),m=g.bits,f.bitrate_index=1,m=e.getframebits(r)-8*f.sideinfo_len,s[0]=m/(f.mode_gr*f.channels_out),m=r.VBR_mean_bitrate_kbps*r.framesize*1e3,0!=(1&f.substep_shaping)&&(m*=1.09),m/=r.out_samplerate,m-=8*f.sideinfo_len,m/=f.mode_gr*f.channels_out,(u=.93+.07*(11-r.compression_ratio)/5.5)<.9&&(u=.9),u>1&&(u=1),l=0;l<f.mode_gr;l++){var y=0;for(d=0;d<f.channels_out;d++){if(o[l][d]=int(u*m),i[l][d]>700){var b=int((i[l][d]-700)/1.4),k=v.tt[l][d];o[l][d]=int(u*m),k.block_type==h.SHORT_TYPE&&b<m/2&&(b=m/2),b>3*m/2?b=3*m/2:b<0&&(b=0),o[l][d]+=b}o[l][d]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(o[l][d]=LameInternalFlags.MAX_BITS_PER_CHANNEL),y+=o[l][d]}if(y>LameInternalFlags.MAX_BITS_PER_GRANULE)for(d=0;d<f.channels_out;++d)o[l][d]*=LameInternalFlags.MAX_BITS_PER_GRANULE,o[l][d]/=y}if(f.mode_ext==h.MPG_MD_MS_LR)for(l=0;l<f.mode_gr;l++)n.reduce_side(o[l],a[l],m*f.channels_out,LameInternalFlags.MAX_BITS_PER_GRANULE);for(p=0,l=0;l<f.mode_gr;l++)for(d=0;d<f.channels_out;d++)o[l][d]>LameInternalFlags.MAX_BITS_PER_CHANNEL&&(o[l][d]=LameInternalFlags.MAX_BITS_PER_CHANNEL),p+=o[l][d];if(p>c[0])for(l=0;l<f.mode_gr;l++)for(d=0;d<f.channels_out;d++)o[l][d]*=c[0],o[l][d]/=p}}},9091:function(e,t,n){var r=n(7407),i=n(8768),a=(i.System,i.VbrMode),o=i.Float,s=(i.ShortBlock,i.Util),c=(i.Arrays,i.new_array_n,i.new_byte,i.new_double,i.new_float),u=(i.new_float_n,i.new_int),l=(i.new_int_n,i.assert),d=n(610),p=n(8767),h=n(4330);function f(){var e=n(6435),t=null,i=null,v=null;this.setModules=function(e,n,r){t=e,i=n,v=r},this.IPOW20=function(e){return l(0<=e&&e<f.Q_MAX),x[e]};var m=2220446049250313e-31,g=f.IXMAX_VAL+2,y=f.Q_MAX,b=f.Q_MAX2,k=(f.LARGE_BITS,100);this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var _=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=_,this.sfBandIndex=[new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0,8,16,24,36,52,72,96,124,160,162,164,166,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var w=c(y+b+1),x=c(y),S=c(g),E=c(g);function T(e,t){var n=v.ATHformula(t,e);return n-=k,n=Math.pow(10,n/10+e.ATHlower)}function P(e){this.s=e}this.adj43=E,this.iteration_init=function(e){var n,r=e.internal_flags,i=r.l3_side;if(0==r.iteration_init_init){for(r.iteration_init_init=1,i.main_data_begin=0,function(e){for(var t=e.internal_flags.ATH.l,n=e.internal_flags.ATH.psfb21,r=e.internal_flags.ATH.s,i=e.internal_flags.ATH.psfb12,a=e.internal_flags,s=e.out_samplerate,c=0;c<d.SBMAX_l;c++){var u=a.scalefac_band.l[c],l=a.scalefac_band.l[c+1];t[c]=o.MAX_VALUE;for(var p=u;p<l;p++){var h=T(e,p*s/1152);t[c]=Math.min(t[c],h)}}for(c=0;c<d.PSFB21;c++)for(u=a.scalefac_band.psfb21[c],l=a.scalefac_band.psfb21[c+1],n[c]=o.MAX_VALUE,p=u;p<l;p++)h=T(e,p*s/1152),n[c]=Math.min(n[c],h);for(c=0;c<d.SBMAX_s;c++){for(u=a.scalefac_band.s[c],l=a.scalefac_band.s[c+1],r[c]=o.MAX_VALUE,p=u;p<l;p++)h=T(e,p*s/384),r[c]=Math.min(r[c],h);r[c]*=a.scalefac_band.s[c+1]-a.scalefac_band.s[c]}for(c=0;c<d.PSFB12;c++){for(u=a.scalefac_band.psfb12[c],l=a.scalefac_band.psfb12[c+1],i[c]=o.MAX_VALUE,p=u;p<l;p++)h=T(e,p*s/384),i[c]=Math.min(i[c],h);i[c]*=a.scalefac_band.s[13]-a.scalefac_band.s[12]}if(e.noATH){for(c=0;c<d.SBMAX_l;c++)t[c]=1e-20;for(c=0;c<d.PSFB21;c++)n[c]=1e-20;for(c=0;c<d.SBMAX_s;c++)r[c]=1e-20;for(c=0;c<d.PSFB12;c++)i[c]=1e-20}a.ATH.floor=10*Math.log10(T(e,-1))}(e),S[0]=0,n=1;n<g;n++)S[n]=Math.pow(n,4/3);for(n=0;n<g-1;n++)E[n]=n+1-Math.pow(.5*(S[n]+S[n+1]),.75);for(E[n]=.5,n=0;n<y;n++)x[n]=Math.pow(2,-.1875*(n-210));for(n=0;n<=y+b;n++)w[n]=Math.pow(2,.25*(n-210-b));var a,s,c,u;for(t.huffman_init(r),(n=e.exp_nspsytune>>2&63)>=32&&(n-=64),a=Math.pow(10,n/4/10),(n=e.exp_nspsytune>>8&63)>=32&&(n-=64),s=Math.pow(10,n/4/10),(n=e.exp_nspsytune>>14&63)>=32&&(n-=64),c=Math.pow(10,n/4/10),(n=e.exp_nspsytune>>20&63)>=32&&(n-=64),u=c*Math.pow(10,n/4/10),n=0;n<d.SBMAX_l;n++){l=n<=6?a:n<=13?s:n<=20?c:u,r.nsPsy.longfact[n]=l}for(n=0;n<d.SBMAX_s;n++){var l;l=n<=5?a:n<=10?s:n<=11?c:u,r.nsPsy.shortfact[n]=l}}},this.on_pe=function(e,t,n,r,a,o){var s,c,d=e.internal_flags,f=0,v=u(2),m=new p(f),g=i.ResvMaxBits(e,r,m,o),y=(f=m.bits)+g;for(y>h.MAX_BITS_PER_GRANULE&&(y=h.MAX_BITS_PER_GRANULE),s=0,c=0;c<d.channels_out;++c)n[c]=Math.min(h.MAX_BITS_PER_CHANNEL,f/d.channels_out),v[c]=0|n[c]*t[a][c]/700-n[c],v[c]>3*r/4&&(v[c]=3*r/4),v[c]<0&&(v[c]=0),v[c]+n[c]>h.MAX_BITS_PER_CHANNEL&&(v[c]=Math.max(0,h.MAX_BITS_PER_CHANNEL-n[c])),s+=v[c];if(s>g)for(c=0;c<d.channels_out;++c)v[c]=g*v[c]/s;for(c=0;c<d.channels_out;++c)n[c]+=v[c],g-=v[c];for(s=0,c=0;c<d.channels_out;++c)s+=n[c];if(s>h.MAX_BITS_PER_GRANULE){var b=0;for(c=0;c<d.channels_out;++c)n[c]*=h.MAX_BITS_PER_GRANULE,n[c]/=s,b+=n[c];l(b<=h.MAX_BITS_PER_GRANULE)}return y},this.reduce_side=function(e,t,n,r){l(r<=h.MAX_BITS_PER_GRANULE),l(e[0]+e[1]<=h.MAX_BITS_PER_GRANULE);var i=.33*(.5-t)/.5;i<0&&(i=0),i>.5&&(i=.5);var a=0|.5*i*(e[0]+e[1]);a>h.MAX_BITS_PER_CHANNEL-e[0]&&(a=h.MAX_BITS_PER_CHANNEL-e[0]),a<0&&(a=0),e[1]>=125&&(e[1]-a>125?(e[0]<n&&(e[0]+=a),e[1]-=a):(e[0]+=e[1]-125,e[1]=125)),(a=e[0]+e[1])>r&&(e[0]=r*e[0]/a,e[1]=r*e[1]/a),l(e[0]<=h.MAX_BITS_PER_CHANNEL),l(e[1]<=h.MAX_BITS_PER_CHANNEL),l(e[0]+e[1]<=h.MAX_BITS_PER_GRANULE)},this.athAdjust=function(e,t,n){var r=90.30873362,i=s.FAST_LOG10_X(t,10),a=e*e,o=0;return i-=n,a>1e-20&&(o=1+s.FAST_LOG10_X(a,10/r)),o<0&&(o=0),i*=o,i+=n+r-94.82444863,Math.pow(10,.1*i)}
2,this.calc_xmin=function(t,n,r,i){var o,s=0,c=t.internal_flags,u=0,l=0,p=c.ATH,h=r.xr,f=t.VBR==a.vbr_mtrh?1:0,v=c.masking_lower;for(t.VBR!=a.vbr_mtrh&&t.VBR!=a.vbr_mt||(v=1),o=0;o<r.psy_lmax;o++){S=(x=t.VBR==a.vbr_rh||t.VBR==a.vbr_mtrh?athAdjust(p.adjust,p.l[o],p.floor):p.adjust*p.l[o])/(k=r.width[o]),E=m,R=k>>1,C=0;do{C+=Z=h[u]*h[u],E+=Z<S?Z:S,C+=M=h[++u]*h[u],E+=M<S?M:S,u++}while(--R>0);if(C>x&&l++,o==d.SBPSY_l)E<(P=x*c.nsPsy.longfact[o])&&(E=P);if(0!=f&&(x=E),!t.ATHonly)if((T=n.en.l[o])>0)P=C*n.thm.l[o]*v/T,0!=f&&(P*=c.nsPsy.longfact[o]),x<P&&(x=P);i[s++]=0!=f?x:x*c.nsPsy.longfact[o]}var g=575;if(r.block_type!=d.SHORT_TYPE)for(var y=576;0!=y--&&e.EQ(h[y],0);)g=y;r.max_nonzero_coeff=g;for(var b=r.sfb_smin;o<r.psymax;b++,o+=3){var k,_,w;for(w=t.VBR==a.vbr_rh||t.VBR==a.vbr_mtrh?athAdjust(p.adjust,p.s[b],p.floor):p.adjust*p.s[b],k=r.width[o],_=0;_<3;_++){var x,S,E,T,P,C=0,R=k>>1;S=w/k,E=m;do{var Z,M;C+=Z=h[u]*h[u],E+=Z<S?Z:S,C+=M=h[++u]*h[u],E+=M<S?M:S,u++}while(--R>0);if(C>w&&l++,b==d.SBPSY_s)E<(P=w*c.nsPsy.shortfact[b])&&(E=P);if(x=0!=f?E:w,!t.ATHonly&&!t.ATHshort)if((T=n.en.s[b][_])>0)P=C*n.thm.s[b][_]*v/T,0!=f&&(P*=c.nsPsy.shortfact[b]),x<P&&(x=P);i[s++]=0!=f?x:x*c.nsPsy.shortfact[b]}t.useTemporal&&(i[s-3]>i[s-3+1]&&(i[s-3+1]+=(i[s-3]-i[s-3+1])*c.decay),i[s-3+1]>i[s-3+2]&&(i[s-3+2]+=(i[s-3+1]-i[s-3+2])*c.decay))}return l},this.calc_noise_core=function(e,t,n,r){var i=0,a=t.s,o=e.l3_enc;if(a>e.count1)for(;0!=n--;){u=e.xr[a],a++,i+=u*u,u=e.xr[a],a++,i+=u*u}else if(a>e.big_values){var s=c(2);for(s[0]=0,s[1]=r;0!=n--;){u=Math.abs(e.xr[a])-s[o[a]],a++,i+=u*u,u=Math.abs(e.xr[a])-s[o[a]],a++,i+=u*u}}else for(;0!=n--;){var u;u=Math.abs(e.xr[a])-S[o[a]]*r,a++,i+=u*u,u=Math.abs(e.xr[a])-S[o[a]]*r,a++,i+=u*u}return t.s=a,i},this.calc_noise=function(e,t,n,r,i){var a,o,c,u=0,d=0,p=0,h=0,v=0,m=-20,g=0,y=e.scalefac,b=0;for(r.over_SSD=0,a=0;a<e.psymax;a++){var k,x=e.global_gain-(y[b++]+(0!=e.preflag?_[a]:0)<<e.scalefac_scale+1)-8*e.subblock_gain[e.window[a]],S=0;if(null!=i&&i.step[a]==x)S=i.noise[a],g+=e.width[a],n[u++]=S/t[d++],S=i.noise_log[a];else{var E,T=(l(0<=(c=x)+f.Q_MAX2&&c<f.Q_MAX),w[c+f.Q_MAX2]);if(o=e.width[a]>>1,g+e.width[a]>e.max_nonzero_coeff)o=(E=e.max_nonzero_coeff-g+1)>0?E>>1:0;var C=new P(g);S=this.calc_noise_core(e,C,o,T),g=C.s,null!=i&&(i.step[a]=x,i.noise[a]=S),S=n[u++]=S/t[d++],S=s.FAST_LOG10(Math.max(S,1e-20)),null!=i&&(i.noise_log[a]=S)}if(null!=i&&(i.global_gain=e.global_gain),v+=S,S>0)k=Math.max(0|10*S+.5,1),r.over_SSD+=k*k,p++,h+=S;m=Math.max(m,S)}return r.over_count=p,r.tot_noise=v,r.over_noise=h,r.max_noise=m,p},this.set_pinfo=function(e,t,n,r,i){var a,o,s,u,p,h=e.internal_flags,f=0==t.scalefac_scale?.5:1,v=t.scalefac,m=c(L3Side.SFBMAX),g=c(L3Side.SFBMAX),y=new CalcNoiseResult;calc_xmin(e,n,t,m),calc_noise(t,m,g,y,null);var b=0;for(o=t.sfb_lmax,t.block_type!=d.SHORT_TYPE&&0==t.mixed_block_flag&&(o=22),a=0;a<o;a++){var k=h.scalefac_band.l[a],w=(x=h.scalefac_band.l[a+1])-k;for(u=0;b<x;b++)u+=t.xr[b]*t.xr[b];u/=w,p=1e15,h.pinfo.en[r][i][a]=p*u,h.pinfo.xfsf[r][i][a]=p*m[a]*g[a]/w,n.en.l[a]>0&&!e.ATHonly?u/=n.en.l[a]:u=0,h.pinfo.thr[r][i][a]=p*Math.max(u*n.thm.l[a],h.ATH.l[a]),h.pinfo.LAMEsfb[r][i][a]=0,0!=t.preflag&&a>=11&&(h.pinfo.LAMEsfb[r][i][a]=-f*_[a]),a<d.SBPSY_l&&(l(v[a]>=0),h.pinfo.LAMEsfb[r][i][a]-=f*v[a])}if(t.block_type==d.SHORT_TYPE)for(o=a,a=t.sfb_smin;a<d.SBMAX_s;a++){k=h.scalefac_band.s[a],w=(x=h.scalefac_band.s[a+1])-k;for(var x,S=0;S<3;S++){for(u=0,s=k;s<x;s++)u+=t.xr[b]*t.xr[b],b++;u=Math.max(u/w,1e-20),p=1e15,h.pinfo.en_s[r][i][3*a+S]=p*u,h.pinfo.xfsf_s[r][i][3*a+S]=p*m[o]*g[o]/w,n.en.s[a][S]>0?u/=n.en.s[a][S]:u=0,(e.ATHonly||e.ATHshort)&&(u=0),h.pinfo.thr_s[r][i][3*a+S]=p*Math.max(u*n.thm.s[a][S],h.ATH.s[a]),h.pinfo.LAMEsfb_s[r][i][3*a+S]=-2*t.subblock_gain[S],a<d.SBPSY_s&&(h.pinfo.LAMEsfb_s[r][i][3*a+S]-=f*v[o]),o++}}h.pinfo.LAMEqss[r][i]=t.global_gain,h.pinfo.LAMEmainbits[r][i]=t.part2_3_length+t.part2_length,h.pinfo.LAMEsfbits[r][i]=t.part2_length,h.pinfo.over[r][i]=y.over_count,h.pinfo.max_noise[r][i]=10*y.max_noise,h.pinfo.over_noise[r][i]=10*y.over_noise,h.pinfo.tot_noise[r][i]=10*y.tot_noise,h.pinfo.over_SSD[r][i]=y.over_SSD}}f.Q_MAX=257,f.Q_MAX2=116,f.LARGE_BITS=1e5,f.IXMAX_VAL=8206,e.exports=f},4397:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float),a=(r.new_float_n,r.new_int),o=(r.new_int_n,r.assert,n(7932));e.exports=function(){this.linprebuf=i(2*o.MAX_ORDER),this.linpre=0,this.lstepbuf=i(o.MAX_SAMPLES_PER_WINDOW+o.MAX_ORDER),this.lstep=0,this.loutbuf=i(o.MAX_SAMPLES_PER_WINDOW+o.MAX_ORDER),this.lout=0,this.rinprebuf=i(2*o.MAX_ORDER),this.rinpre=0,this.rstepbuf=i(o.MAX_SAMPLES_PER_WINDOW+o.MAX_ORDER),this.rstep=0,this.routbuf=i(o.MAX_SAMPLES_PER_WINDOW+o.MAX_ORDER),this.rout=0,this.sampleWindow=0,this.totsamp=0,this.lsum=0,this.rsum=0,this.freqindex=0,this.first=0,this.A=a(0|o.STEPS_per_dB*o.MAX_dB),this.B=a(0|o.STEPS_per_dB*o.MAX_dB)}},5991:function(e,t,n){var r=n(8768).assert;e.exports=function(){var e;this.setModules=function(t){e=t},this.ResvFrameBegin=function(t,n){var i,a=t.internal_flags,o=a.l3_side,s=e.getframebits(t);n.bits=(s-8*a.sideinfo_len)/a.mode_gr;var c=2048*a.mode_gr-8;t.brate>320?i=8*int(1e3*t.brate/(t.out_samplerate/1152)/8+.5):(i=11520,t.strict_ISO&&(i=8*int(32e4/(t.out_samplerate/1152)/8+.5))),a.ResvMax=i-s,a.ResvMax>c&&(a.ResvMax=c),(a.ResvMax<0||t.disable_reservoir)&&(a.ResvMax=0);var u=n.bits*a.mode_gr+Math.min(a.ResvSize,a.ResvMax);return u>i&&(u=i),r(0==a.ResvMax%8),r(a.ResvMax>=0),o.resvDrain_pre=0,null!=a.pinfo&&(a.pinfo.mean_bits=n.bits/2,a.pinfo.resvsize=a.ResvSize),u},this.ResvMaxBits=function(e,t,n,r){var i,a=e.internal_flags,o=a.ResvSize,s=a.ResvMax;0!=r&&(o+=t),0!=(1&a.substep_shaping)&&(s*=.9),n.bits=t,10*o>9*s?(i=o-9*s/10,n.bits+=i,a.substep_shaping|=128):(i=0,a.substep_shaping&=127,e.disable_reservoir||0!=(1&a.substep_shaping)||(n.bits-=.1*t));var c=o<6*a.ResvMax/10?o:6*a.ResvMax/10;return(c-=i)<0&&(c=0),c}
2,this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var n,i=e.l3_side;e.ResvSize+=t*e.mode_gr;var a=0;i.resvDrain_post=0,i.resvDrain_pre=0,0!=(n=e.ResvSize%8)&&(a+=n),(n=e.ResvSize-a-e.ResvMax)>0&&(r(0==n%8),r(n>=0),a+=n);var o=Math.min(8*i.main_data_begin,a)/8;i.resvDrain_pre+=8*o,a-=8*o,e.ResvSize-=8*o,i.main_data_begin-=o,i.resvDrain_post+=a,e.ResvSize-=a}}},7407:function(e,t,n){var r=n(8768),i=r.System,a=(r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte,r.new_double,r.new_float,r.new_float_n,r.new_int),o=(r.new_int_n,r.assert,n(610));e.exports=function(e,t,n,r){this.l=a(1+o.SBMAX_l),this.s=a(1+o.SBMAX_s),this.psfb21=a(1+o.PSFB21),this.psfb12=a(1+o.PSFB12);var s=this.l,c=this.s;4==arguments.length&&(this.arrL=arguments[0],this.arrS=arguments[1],this.arr21=arguments[2],this.arr12=arguments[3],i.arraycopy(this.arrL,0,s,0,Math.min(this.arrL.length,this.l.length)),i.arraycopy(this.arrS,0,c,0,Math.min(this.arrS.length,this.s.length)),i.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),i.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}},2804:function(e){function t(e,t,n,r){this.xlen=e,this.linmax=t,this.table=n,this.hlen=r}var n={t1HB:[1,1,1,0],t2HB:[1,2,1,3,1,1,3,2,0],t3HB:[3,2,1,1,1,1,3,2,0],t5HB:[1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0],t6HB:[7,3,5,1,6,2,3,2,5,4,4,1,3,3,2,0],t7HB:[1,2,10,19,16,10,3,3,7,10,5,3,11,4,13,17,8,4,12,11,18,15,11,2,7,6,9,14,3,1,6,4,5,3,2,0],t8HB:[3,4,6,18,12,5,5,1,2,16,9,3,7,3,5,14,7,3,19,17,15,13,10,4,13,5,8,11,5,1,12,4,4,1,1,0],t9HB:[7,5,9,14,15,7,6,4,5,5,6,7,7,6,8,8,8,5,15,6,9,10,5,1,11,7,9,6,4,1,14,4,6,2,6,0],t10HB:[1,2,10,23,35,30,12,17,3,3,8,12,18,21,12,7,11,9,15,21,32,40,19,6,14,13,22,34,46,23,18,7,20,19,33,47,27,22,9,3,31,22,41,26,21,20,5,3,14,13,10,11,16,6,5,1,9,8,7,8,4,4,2,0],t11HB:[3,4,10,24,34,33,21,15,5,3,4,10,32,17,11,10,11,7,13,18,30,31,20,5,25,11,19,59,27,18,12,5,35,33,31,58,30,16,7,5,28,26,32,19,17,15,8,14,14,12,9,13,14,9,4,1,11,4,6,6,6,3,2,0],t12HB:[9,6,16,33,41,39,38,26,7,5,6,9,23,16,26,11,17,7,11,14,21,30,10,7,17,10,15,12,18,28,14,5,32,13,22,19,18,16,9,5,40,17,31,29,17,13,4,2,27,12,11,15,10,7,4,1,27,12,8,12,6,3,1,0],t13HB:[1,5,14,21,34,51,46,71,42,52,68,52,67,44,43,19,3,4,12,19,31,26,44,33,31,24,32,24,31,35,22,14,15,13,23,36,59,49,77,65,29,40,30,40,27,33,42,16,22,20,37,61,56,79,73,64,43,76,56,37,26,31,25,14,35,16,60,57,97,75,114,91,54,73,55,41,48,53,23,24,58,27,50,96,76,70,93,84,77,58,79,29,74,49,41,17,47,45,78,74,115,94,90,79,69,83,71,50,59,38,36,15,72,34,56,95,92,85,91,90,86,73,77,65,51,44,43,42,43,20,30,44,55,78,72,87,78,61,46,54,37,30,20,16,53,25,41,37,44,59,54,81,66,76,57,54,37,18,39,11,35,33,31,57,42,82,72,80,47,58,55,21,22,26,38,22,53,25,23,38,70,60,51,36,55,26,34,23,27,14,9,7,34,32,28,39,49,75,30,52,48,40,52,28,18,17,9,5,45,21,34,64,56,50,49,45,31,19,12,15,10,7,6,3,48,23,20,39,36,35,53,21,16,23,13,10,6,1,4,2,16,15,17,27,25,20,29,11,17,12,16,8,1,1,0,1],t15HB:[7,12,18,53,47,76,124,108,89,123,108,119,107,81,122,63,13,5,16,27,46,36,61,51,42,70,52,83,65,41,59,36,19,17,15,24,41,34,59,48,40,64,50,78,62,80,56,33,29,28,25,43,39,63,55,93,76,59,93,72,54,75,50,29,52,22,42,40,67,57,95,79,72,57,89,69,49,66,46,27,77,37,35,66,58,52,91,74,62,48,79,63,90,62,40,38,125,32,60,56,50,92,78,65,55,87,71,51,73,51,70,30,109,53,49,94,88,75,66,122,91,73,56,42,64,44,21,25,90,43,41,77,73,63,56,92,77,66,47,67,48,53,36,20,71,34,67,60,58,49,88,76,67,106,71,54,38,39,23,15,109,53,51,47,90,82,58,57,48,72,57,41,23,27,62,9,86,42,40,37,70,64,52,43,70,55,42,25,29,18,11,11,118,68,30,55,50,46,74,65,49,39,24,16,22,13,14,7,91,44,39,38,34,63,52,45,31,52,28,19,14,8,9,3,123,60,58,53,47,43,32,22,37,24,17,12,15,10,2,1,71,37,34,30,28,20,17,26,21,16,10,6,8,6,2,0],t16HB:[1,5,14,44,74,63,110,93,172,149,138,242,225,195,376,17,3,4,12,20,35,62,53,47,83,75,68,119,201,107,207,9,15,13,23,38,67,58,103,90,161,72,127,117,110,209,206,16,45,21,39,69,64,114,99,87,158,140,252,212,199,387,365,26,75,36,68,65,115,101,179,164,155,264,246,226,395,382,362,9,66,30,59,56,102,185,173,265,142,253,232,400,388,378,445,16,111,54,52,100,184,178,160,133,257,244,228,217,385,366,715,10,98,48,91,88,165,157,148,261,248,407,397,372,380,889,884,8,85,84,81,159,156,143,260,249,427,401,392,383,727,713,708,7,154,76,73,141,131,256,245,426,406,394,384,735,359,710,352,11,139,129,67,125,247,233,229,219,393,743,737,720,885,882,439,4,243,120,118,115,227,223,396,746,742,736,721,712,706,223,436,6,202,224,222,218,216,389,386,381,364,888,443,707,440,437,1728,4,747,211,210,208,370,379,734,723,714,1735,883,877,876,3459,8
vendor: 14,859 bytes, line 2
265,2,377,369,102,187,726,722,358,711,709,866,1734,871,3458,870,434,0,12,10,7,11,10,17,11,9,13,12,10,7,5,3,1,3],t24HB:[15,13,46,80,146,262,248,434,426,669,653,649,621,517,1032,88,14,12,21,38,71,130,122,216,209,198,327,345,319,297,279,42,47,22,41,74,68,128,120,221,207,194,182,340,315,295,541,18,81,39,75,70,134,125,116,220,204,190,178,325,311,293,271,16,147,72,69,135,127,118,112,210,200,188,352,323,306,285,540,14,263,66,129,126,119,114,214,202,192,180,341,317,301,281,262,12,249,123,121,117,113,215,206,195,185,347,330,308,291,272,520,10,435,115,111,109,211,203,196,187,353,332,313,298,283,531,381,17,427,212,208,205,201,193,186,177,169,320,303,286,268,514,377,16,335,199,197,191,189,181,174,333,321,305,289,275,521,379,371,11,668,184,183,179,175,344,331,314,304,290,277,530,383,373,366,10,652,346,171,168,164,318,309,299,287,276,263,513,375,368,362,6,648,322,316,312,307,302,292,284,269,261,512,376,370,364,359,4,620,300,296,294,288,282,273,266,515,380,374,369,365,361,357,2,1033,280,278,274,267,264,259,382,378,372,367,363,360,358,356,0,43,20,19,17,15,13,11,9,7,6,4,7,5,3,1,3],t32HB:[1,10,8,20,12,20,16,32,14,12,24,0,28,16,24,16],t33HB:[15,28,26,48,22,40,36,64,14,24,20,32,12,16,8,0],t1l:[1,4,3,5],t2l:[1,4,7,4,5,7,6,7,8],t3l:[2,3,7,4,4,7,6,7,8],t5l:[1,4,7,8,4,5,8,9,7,8,9,10,8,8,9,10],t6l:[3,4,6,8,4,4,6,7,5,6,7,8,7,7,8,9],t7l:[1,4,7,9,9,10,4,6,8,9,9,10,7,7,9,10,10,11,8,9,10,11,11,11,8,9,10,11,11,12,9,10,11,12,12,12],t8l:[2,4,7,9,9,10,4,4,6,10,10,10,7,6,8,10,10,11,9,10,10,11,11,12,9,9,10,11,12,12,10,10,11,11,13,13],t9l:[3,4,6,7,9,10,4,5,6,7,8,10,5,6,7,8,9,10,7,7,8,9,9,10,8,8,9,9,10,11,9,9,10,10,11,11],t10l:[1,4,7,9,10,10,10,11,4,6,8,9,10,11,10,10,7,8,9,10,11,12,11,11,8,9,10,11,12,12,11,12,9,10,11,12,12,12,12,12,10,11,12,12,13,13,12,13,9,10,11,12,12,12,13,13,10,10,11,12,12,13,13,13],t11l:[2,4,6,8,9,10,9,10,4,5,6,8,10,10,9,10,6,7,8,9,10,11,10,10,8,8,9,11,10,12,10,11,9,10,10,11,11,12,11,12,9,10,11,12,12,13,12,13,9,9,9,10,11,12,12,12,9,9,10,11,12,12,12,12],t12l:[4,4,6,8,9,10,10,10,4,5,6,7,9,9,10,10,6,6,7,8,9,10,9,10,7,7,8,8,9,10,10,10,8,8,9,9,10,10,10,11,9,9,10,10,10,11,10,11,9,9,9,10,10,11,11,12,10,10,10,11,11,11,11,12],t13l:[1,5,7,8,9,10,10,11,10,11,12,12,13,13,14,14,4,6,8,9,10,10,11,11,11,11,12,12,13,14,14,14,7,8,9,10,11,11,12,12,11,12,12,13,13,14,15,15,8,9,10,11,11,12,12,12,12,13,13,13,13,14,15,15,9,9,11,11,12,12,13,13,12,13,13,14,14,15,15,16,10,10,11,12,12,12,13,13,13,13,14,13,15,15,16,16,10,11,12,12,13,13,13,13,13,14,14,14,15,15,16,16,11,11,12,13,13,13,14,14,14,14,15,15,15,16,18,18,10,10,11,12,12,13,13,14,14,14,14,15,15,16,17,17,11,11,12,12,13,13,13,15,14,15,15,16,16,16,18,17,11,12,12,13,13,14,14,15,14,15,16,15,16,17,18,19,12,12,12,13,14,14,14,14,15,15,15,16,17,17,17,18,12,13,13,14,14,15,14,15,16,16,17,17,17,18,18,18,13,13,14,15,15,15,16,16,16,16,16,17,18,17,18,18,14,14,14,15,15,15,17,16,16,19,17,17,17,19,18,18,13,14,15,16,16,16,17,16,17,17,18,18,21,20,21,18],t15l:[3,5,6,8,8,9,10,10,10,11,11,12,12,12,13,14,5,5,7,8,9,9,10,10,10,11,11,12,12,12,13,13,6,7,7,8,9,9,10,10,10,11,11,12,12,13,13,13,7,8,8,9,9,10,10,11,11,11,12,12,12,13,13,13,8,8,9,9,10,10,11,11,11,11,12,12,12,13,13,13,9,9,9,10,10,10,11,11,11,11,12,12,13,13,13,14,10,9,10,10,10,11,11,11,11,12,12,12,13,13,14,14,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,14,10,10,10,11,11,11,11,12,12,12,12,13,13,14,14,14,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,11,11,11,11,12,12,12,12,12,13,13,13,13,14,15,14,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,15,12,12,11,12,12,12,13,13,13,13,13,13,14,14,15,15,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,13,13,13,13,13,13,13,13,14,14,14,14,15,15,14,15,13,13,13,13,13,13,13,14,14,14,14,14,15,15,15,15],t16_5l:[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,11,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,11,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,12,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,13,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,12,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,13,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,13,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,13,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,13,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,14,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,13,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,14,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,14,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,14,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,14,11,11,11,12,12,13,13,13,14,14,14,14,14,14,14,12],t16l:[1,5,7,9,10,10,11,11,12,12,12,13,13,13,14,10,4,6,8,9,10,11,11,11,12,12,12,13,14,13,14,10,7,8,9,10,11,11,12,12,13,12,13,13,13,14,14,11,9,9,10,11,11,12,12,12,13,13,14,14,14,15,15,12,10,10,11,11,12,12,13,13,13,14,14,14,15,15,15,11,10,10,11,11,12,13,13,14,13,14,14,15,15,15,16,12,11,11,11,12,13,13,13,13,14,14,14,14,15,15,16,12,11,11,12,12,13,13,13,14,14,15,15,15,15,17,17,12,11,12,12,13,13,13,14,14,15,15,15,15,16,16,16,12,12,12,12,13,13,14,14,15,15,15,15,16,15,16,15,13,12,13,12,13,14,14,14,14,15,16,16,16,17,17,16,12,13,13,13,13,14,14,15,16,16,16,16,16,16,15,16,13,13,14,14,14,14,15,15,15,15,17,16,16,16,16,18,13,15,14,14,14,15,15,16,16,16,18,17,17,17,19,17,13,14,15,13,14,16,16,15,16,16,17,18,17,19,17,16,13,10,10,10,11,11,12,12,12,13,13,13,13,13,13,13,10],t24l:[4,5,7,8,9,10,10,11,11,12,12,12,12,12,13,10,5,6,7,8,9,10,10,11,11,11,12,12,12,12,12,10,7,7,8,9,9,10,10,11,11,11,11,12,12,12,13,9,8,8,9,9,10,10,10,11,11,11,11,12,12,12,12,9,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,9,10,9,10,10,10,10,11,11,11,11,12,12,12,12,12,9,10,10,10,10,10,11,11,11,11,12,12,12,12,12,13,9,11,10,10,10,11,11,11,11,12,12,12,12,12,13,13,10,11,11,11,11,11,11,11,11,11,12,12,12,12,13,13,10,11,11,11,11,11,11,11,12,12,12,12,12,13,13,13,10,12,11,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,11,11,11,12,12,12,12,12,12,13,13,13,13,10,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,10,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,10,13,12,12,12,12,12,12,13,13,13,13,13,13,13,13,10,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,6],t32l:[1,5,5,7,5,8,7,9,5,7,7,9,7,9,9,10],t33l:[4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]};n.ht=[new t(0,0,null,null),new t(2,0,n.t1HB,n.t1l),new t(3,0,n.t2HB,n.t2l),new t(3,0,n.t3HB,n.t3l),new t(0,0,null,null),new t(4,0,n.t5HB,n.t5l),new t(4,0,n.t6HB,n.t6l),new t(6,0,n.t7HB,n.t7l),new t(6,0,n.t8HB,n.t8l),new t(6,0,n.t9HB,n.t9l),new t(8,0,n.t10HB,n.t10l),new t(8,0,n.t11HB,n.t11l),new t(8,0,n.t12HB,n.t12l),new t(16,0,n.t13HB,n.t13l),new t(0,0,null,n.t16_5l),new t(16,0,n.t15HB,n.t15l),new t(1,1,n.t16HB,n.t16l),new t(2,3,n.t16HB,n.t16l),new t(3,7,n.t16HB,n.t16l),new t(4,15,n.t16HB,n.t16l),new t(6,63,n.t16HB,n.t16l),new t(8,255,n.t16HB,n.t16l),new t(10,1023,n.t16HB,n.t16l),new t(13,8191,n.t16HB,n.t16l),new t(4,15,n.t24HB,n.t24l),new t(5,31,n.t24HB,n.t24l),new t(6,63,n.t24HB,n.t24l),new t(7,127,n.t24HB,n.t24l),new t(8,255,n.t24HB,n.t24l),new t(9,511,n.t24HB,n.t24l),new t(11,2047,n.t24HB,n.t24l),new t(13,8191,n.t24HB,n.t24l),new t(0,0,n.t32HB,n.t32l),new t(0,0,n.t33HB,n.t33l)],n.largetbl=[65540,327685,458759,589832,655369,655370,720906,720907,786443,786444,786444,851980,851980,851980,917517,655370,262149,393222,524295,589832,655369,720906,720906,720907,786443,786443,786444,851980,917516,851980,917516,655370,458759,524295,589832,655369,720905,720906,786442,786443,851979,786443,851979,851980,851980,917516,917517,720905,589832,589832,655369,720905,720906,786442,786442,786443,851979,851979,917515,917516,917516,983052,983052,786441,655369,655369,720905,720906,786442,786442,851978,851979,851979,917515,917516,917516,983052,983052,983053,720905,655370,655369,720906,720906,786442,851978,851979,917515,851979,917515,917516,983052,983052,983052,1048588,786441,720906,720906,720906,786442,851978,851979,851979,851979,917515,917516,917516,917516,983052,983052,1048589,786441,720907,720906,786442,786442,851979,851979,851979,917515,917516,983052,983052,983052,983052,1114125,1114125,786442,720907,786443,786443,851979,851979,851979,917515,917515,983051,983052,983052,983052,1048588,1048589,1048589,786442,786443,786443,786443,851979,851979,917515,917515,983052,983052,983052,983052,1048588,983053,1048589,983053,851978,786444,851979,786443,851979,917515,917516,917516,917516,983052,1048588,1048588,1048589,1114125,1114125,1048589,786442,851980,851980,851979,851979,917515,917516,983052,1048588,1048588,1048588,1048588,1048589,1048589,983053,1048589,851978,851980,917516,917516,917516,917516,983052,983052,983052,983052,1114124,1048589,1048589,1048589,1048589,1179661,851978,983052,917516,917516,917516,983052,983052,1048588,1048588,1048589,1179661,1114125,1114125,1114125,1245197,1114125,851978,917517,983052,851980,917516,1048588,1048588,983052,1048589,1048589,1114125,1179661,1114125,1245197,1114125,1048589,851978,655369,655369,655369,720905,720905,786441,786441,786441,851977,851977,851977,851978,851978,851978,851978,655366],n.table23=[65538,262147,458759,262148,327684,458759,393222,458759,524296],n.table56=[65539,262148,458758,524296,262148,327684,524294,589831,458757,524294,589831,655368,524295,524295,589832,655369],n.bitrate_table=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,-1],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],[0,8,16,24,32,40,48,56,64,-1,-1,-1,-1,-1,-1,-1]],n.samplerate_table=[[22050,24e3,16e3,-1],[44100,48e3,32e3,-1],[11025,12e3,8e3,-1]],n.scfsi_band=[0,6,11,16,21],e.exports=n},2191:function(e,t,n){var r=n(8768),i=r.System,a=(r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays),o=(r.new_array_n,r.new_byte,r.new_double,r.new_float,r.new_float_n,r.new_int),s=(r.new_int_n,r.assert),c=n(610),u=n(2804),l=n(637),d=n(9091);e.exports=function e(){var t=null;function n(e){this.bits=0|e}this.qupvt=null,this.setModules=function(e){this.qupvt=e,t=e};var r=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,1],[1,1],[1,1],[1,2],[2,2],[2,3],[2,3],[3,4],[3,4],[3,4],[4,5],[4,5],[4,6],[5,6],[5,6],[5,7],[6,7],[6,7]];function p(e,t,n,r,i,a){var o=.5946/t;for(s(e>0),e>>=1;0!=e--;)i[a++]=o>n[r++]?0:1,i[a++]=o>n[r++]?0:1}function h(e,n,r,i,a,o){s(e>0);var c=(e>>=1)%2;for(e>>=1;0!=e--;){var u,l,d,p,h,f,v,m;u=r[i++]*n,l=r[i++]*n,h=0|u,d=r[i++]*n,f=0|l,p=r[i++]*n,v=0|d,u+=t.adj43[h],m=0|p,l+=t.adj43[f],a[o++]=0|u,d+=t.adj43[v],a[o++]=0|l,p+=t.adj43[m],a[o++]=0|d,a[o++]=0|p}0!=c&&(h=0|(u=r[i++]*n),f=0|(l=r[i++]*n),u+=t.adj43[h],l+=t.adj43[f],a[o++]=0|u,a[o++]=0|l)}var f=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function v(e,t,n,r){var i=function(e,t,n){var r=0,i=0;do{var a=e[t++],o=e[t++];r<a&&(r=a),i<o&&(i=o)}while(t<n);return r<i&&(r=i),r}(e,t,n);switch(i){case 0:return i;case 1:return function(e,t,n,r){var i=0,a=u.ht[1].hlen;do{var o=2*e[t+0]+e[t+1];t+=2,i+=a[o]}while(t<n);return r.bits+=i,1}(e,t,n,r);case 2:case 3:return function(e,t,n,r,i){var a,o,s=0,c=u.ht[r].xlen;o=2==r?u.table23:u.table56;do{var l=e[t+0]*c+e[t+1];t+=2,s+=o[l]}while(t<n);return a=65535&s,(s>>=16)>a&&(s=a,r++),i.bits+=s,r}(e,t,n,f[i-1],r);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,n,r,i){var a=0,o=0,s=0,c=u.ht[r].xlen,l=u.ht[r].hlen,d=u.ht[r+1].hlen,p=u.ht[r+2].hlen;do{var h=e[t+0]*c+e[t+1];t+=2,a+=l[h],o+=d[h],s+=p[h]}while(t<n);var f=r;return a>o&&(a=o,f++),a>s&&(a=s,f=r+2),i.bits+=a,f}(e,t,n,f[i-1],r);default:if(i>d.IXMAX_VAL)return r.bits=d.LARGE_BITS,-1;var a,o;for(i-=15,a=24;a<32&&!(u.ht[a].linmax>=i);a++);for(o=a-8;o<24&&!(u.ht[o].linmax>=i);o++);return function(e,t,n,r,i,a){var o,s=65536*u.ht[r].xlen+u.ht[i].xlen,c=0;do{var l=e[t++],d=e[t++];0!=l&&(l>14&&(l=15,c+=s),l*=16),0!=d&&(d>14&&(d=15,c+=s),l+=d),c+=u.largetbl[l]}while(t<n);return o=65535&c,(c>>=16)>o&&(c=o,r=i),a.bits+=c,r}(e,t,n,o,a,r)}}function m(e,t,r,i,a,o,s,u){for(var l=t.big_values,d=2;d<c.SBMAX_l+1;d++){var p=e.scalefac_band.l[d];if(p>=l)break;var h=a[d-2]+t.count1bits;if(r.part2_3_length<=h)break;var f=new n(h),m=v(i,p,l,f);h=f.bits,r.part2_3_length<=h||(r.assign(t),r.part2_3_length=h,r.region0_count=o[d-2],r.region1_count=d-2-o[d-2],r.table_select[0]=s[d-2],r.table_select[1]=u[d-2],r.table_select[2]=m)}}this.noquant_count_bits=function(e,t,r){var i=t.l3_enc,a=Math.min(576,t.max_nonzero_coeff+2>>1<<1);for(null!=r&&(r.sfb_count1=0);a>1&&0==(i[a-1]|i[a-2]);a-=2);t.count1=a;for(var o=0,l=0;a>3;a-=4){var d;if((2147483647&(i[a-1]|i[a-2]|i[a-3]|i[a-4]))>1)break;d=2*(2*(2*i[a-4]+i[a-3])+i[a-2])+i[a-1],o+=u.t32l[d],l+=u.t33l[d]}var p=o;if(t.count1table_select=0,o>l&&(p=l,t.count1table_select=1),t.count1bits=p,t.big_values=a,0==a)return p;if(t.block_type==c.SHORT_TYPE)(o=3*e.scalefac_band.s[3])>t.big_values&&(o=t.big_values),l=t.big_values;else if(t.block_type==c.NORM_TYPE){if(s(a<=576),o=t.region0_count=e.bv_scf[a-2],l=t.region1_count=e.bv_scf[a-1],s(o+l+2<c.SBPSY_l),l=e.scalefac_band.l[o+l+2],o=e.scalefac_band.l[o+1],l<a){var h=new n(p);t.table_select[2]=v(i,l,a,h),p=h.bits}}else t.region0_count=7,t.region1_count=c.SBMAX_l-1-7-1,(o=e.scalefac_band.l[8])>(l=a)&&(o=l);if(o=Math.min(o,a),l=Math.min(l,a),s(o>=0),s(l>=0),0<o){h=new n(p);t.table_select[0]=v(i,0,o,h),p=h.bits}if(o<l){h=new n(p);t.table_select[1]=v(i,o,l,h),p=h.bits}if(2==e.use_best_huffman&&(t.part2_3_length=p,best_huffman_divide(e,t),p=t.part2_3_length),null!=r&&t.block_type==c.NORM_TYPE){for(var f=0;e.scalefac_band.l[f]<t.big_values;)f++;r.sfb_count1=f}return p},this.count_bits=function(e,n,r,i){var o=r.l3_enc,u=d.IXMAX_VAL/t.IPOW20(r.global_gain);if(r.xrpow_max>u)return d.LARGE_BITS;if(function(e,n,r,i,o){var u,l,d,f=0,v=0,m=0,g=0,y=n,b=0,k=y,_=0,w=e,x=0;for(d=null!=o&&i.global_gain==o.global_gain,l=i.block_type==c.SHORT_TYPE?38:21,u=0;u<=l;u++){var S=-1;if((d||i.block_type==c.NORM_TYPE)&&(S=i.global_gain-(i.scalefac[u]+(0!=i.preflag?t.pretab[u]:0)<<i.scalefac_scale+1)-8*i.subblock_gain[i.window[u]]),s(i.width[u]>=0),d&&o.step[u]==S)0!=v&&(h(v,r,w,x,k,_),v=0),0!=m&&(p(m,r,w,x,k,_),m=0);else{var E,T=i.width[u];if(f+i.width[u]>i.max_nonzero_coeff&&(E=i.max_nonzero_coeff-f+1,a.fill(n,i.max_nonzero_coeff,576,0),(T=E)<0&&(T=0),u=l+1),0==v&&0==m&&(k=y,_=b,w=e,x=g),null!=o&&o.sfb_count1>0&&u>=o.sfb_count1&&o.step[u]>0&&S>=o.step[u]?(0!=v&&(h(v,r,w,x,k,_),v=0,k=y,_=b,w=e,x=g),m+=T):(0!=m&&(p(m,r,w,x,k,_),m=0,k=y,_=b,w=e,x=g),v+=T),T<=0){0!=m&&(p(m,r,w,x,k,_),m=0),0!=v&&(h(v,r,w,x,k,_),v=0);break}}u<=l&&(b+=i.width[u],g+=i.width[u],f+=i.width[u])}0!=v&&(h(v,r,w,x,k,_),v=0),0!=m&&(p(m,r,w,x,k,_),m=0)}(n,o,t.IPOW20(r.global_gain),r,i),0!=(2&e.substep_shaping))for(var l=0,f=r.global_gain+r.scalefac_scale,v=.634521682242439/t.IPOW20(f),m=0;m<r.sfbmax;m++){var g,y=r.width[m];if(s(y>=0),0==e.pseudohalf[m])l+=y;else for(g=l,l+=y;g<l;++g)o[g]=n[g]>=v?o[g]:0}return this.noquant_count_bits(e,r,i)},this.best_huffman_divide=function(e,t){var r=new l,i=t.l3_enc,a=o(23),p=o(23),h=o(23),f=o(23);if(t.block_type!=c.SHORT_TYPE||1!=e.mode_gr){r.assign(t),t.block_type==c.NORM_TYPE&&(!function(e,t,r,i,a,o,s){for(var c=t.big_values,u=0;u<=22;u++)i[u]=d.LARGE_BITS;for(u=0;u<16;u++){var l=e.scalefac_band.l[u+1];if(l>=c)break;var p=0,h=new n(p),f=v(r,0,l,h);p=h.bits;for(var m=0;m<8;m++){var g=e.scalefac_band.l[u+m+2];
2if(g>=c)break;var y=p,b=v(r,l,g,h=new n(y));y=h.bits,i[u+m]>y&&(i[u+m]=y,a[u+m]=u,o[u+m]=f,s[u+m]=b)}}}(e,t,i,a,p,h,f),m(e,r,t,i,a,p,h,f));var g=r.big_values;if(!(0==g||(i[g-2]|i[g-1])>1)&&!((g=t.count1+2)>576)){r.assign(t),r.count1=g;var y=0,b=0;for(s(g<=576);g>r.big_values;g-=4){var k=2*(2*(2*i[g-4]+i[g-3])+i[g-2])+i[g-1];y+=u.t32l[k],b+=u.t33l[k]}if(r.big_values=g,r.count1table_select=0,y>b&&(y=b,r.count1table_select=1),r.count1bits=y,r.block_type==c.NORM_TYPE)m(e,r,t,i,a,p,h,f);else{if(r.part2_3_length=y,(y=e.scalefac_band.l[8])>g&&(y=g),y>0){var _=new n(r.part2_3_length);r.table_select[0]=v(i,0,y,_),r.part2_3_length=_.bits}if(g>y){_=new n(r.part2_3_length);r.table_select[1]=v(i,y,g,_),r.part2_3_length=_.bits}t.part2_3_length>r.part2_3_length&&t.assign(r)}}}};var g=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],y=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],b=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],k=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];e.slen1_tab=b,e.slen2_tab=k,this.best_scalefac_store=function(e,n,r,i){var a,o,l,d,p=i.tt[n][r],h=0;for(l=0,a=0;a<p.sfbmax;a++){var f=p.width[a];for(s(f>=0),l+=f,d=-f;d<0&&0==p.l3_enc[d+l];d++);0==d&&(p.scalefac[a]=h=-2)}if(0==p.scalefac_scale&&0==p.preflag){var v=0;for(a=0;a<p.sfbmax;a++)p.scalefac[a]>0&&(v|=p.scalefac[a]);if(0==(1&v)&&0!=v){for(a=0;a<p.sfbmax;a++)p.scalefac[a]>0&&(p.scalefac[a]>>=1);p.scalefac_scale=h=1}}if(0==p.preflag&&p.block_type!=c.SHORT_TYPE&&2==e.mode_gr){for(a=11;a<c.SBPSY_l&&!(p.scalefac[a]<t.pretab[a]&&-2!=p.scalefac[a]);a++);if(a==c.SBPSY_l){for(a=11;a<c.SBPSY_l;a++)p.scalefac[a]>0&&(p.scalefac[a]-=t.pretab[a]);p.preflag=h=1}}for(o=0;o<4;o++)i.scfsi[r][o]=0;for(2==e.mode_gr&&1==n&&i.tt[0][r].block_type!=c.SHORT_TYPE&&i.tt[1][r].block_type!=c.SHORT_TYPE&&(!function(e,t){for(var n,r=t.tt[1][e],i=t.tt[0][e],a=0;a<u.scfsi_band.length-1;a++){for(n=u.scfsi_band[a];n<u.scfsi_band[a+1]&&!(i.scalefac[n]!=r.scalefac[n]&&r.scalefac[n]>=0);n++);if(n==u.scfsi_band[a+1]){for(n=u.scfsi_band[a];n<u.scfsi_band[a+1];n++)r.scalefac[n]=-1;t.scfsi[e][a]=1}}var o=0,s=0;for(n=0;n<11;n++)-1!=r.scalefac[n]&&(s++,o<r.scalefac[n]&&(o=r.scalefac[n]));for(var l=0,d=0;n<c.SBPSY_l;n++)-1!=r.scalefac[n]&&(d++,l<r.scalefac[n]&&(l=r.scalefac[n]));for(a=0;a<16;a++)if(o<g[a]&&l<y[a]){var p=b[a]*s+k[a]*d;r.part2_length>p&&(r.part2_length=p,r.scalefac_compress=a)}}(r,i),h=0),a=0;a<p.sfbmax;a++)-2==p.scalefac[a]&&(p.scalefac[a]=0);0!=h&&(2==e.mode_gr?this.scale_bitcount(p):this.scale_bitcount_lsf(e,p))};var _=[0,18,36,54,54,36,54,72,54,72,90,72,90,108,108,126],w=[0,18,36,54,51,35,53,71,52,70,88,69,87,105,104,122],x=[0,10,20,30,33,21,31,41,32,42,52,43,53,63,64,74];this.scale_bitcount=function(e){var n,r,i,a=0,o=0,u=e.scalefac;if(s(function(e,t){for(var n=0;n<t;++n)if(e[n]<0)return!1;return!0}(u,e.sfbmax)),e.block_type==c.SHORT_TYPE)i=_,0!=e.mixed_block_flag&&(i=w);else if(i=x,0==e.preflag){for(r=11;r<c.SBPSY_l&&!(u[r]<t.pretab[r]);r++);if(r==c.SBPSY_l)for(e.preflag=1,r=11;r<c.SBPSY_l;r++)u[r]-=t.pretab[r]}for(r=0;r<e.sfbdivide;r++)a<u[r]&&(a=u[r]);for(;r<e.sfbmax;r++)o<u[r]&&(o=u[r]);for(e.part2_length=d.LARGE_BITS,n=0;n<16;n++)a<g[n]&&o<y[n]&&e.part2_length>i[n]&&(e.part2_length=i[n],e.scalefac_compress=n);return e.part2_length==d.LARGE_BITS};var S=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(e,n){var r,a,u,l,d,p,h,f,v=o(4),m=n.scalefac;for(r=0!=n.preflag?2:0,h=0;h<4;h++)v[h]=0;if(n.block_type==c.SHORT_TYPE){a=1;var g=t.nr_of_sfb_block[r][a];for(f=0,u=0;u<4;u++)for(l=g[u]/3,h=0;h<l;h++,f++)for(d=0;d<3;d++)m[3*f+d]>v[u]&&(v[u]=m[3*f+d])}else{a=0;g=t.nr_of_sfb_block[r][a];for(f=0,u=0;u<4;u++)for(l=g[u],h=0;h<l;h++,f++)m[f]>v[u]&&(v[u]=m[f])}for(p=!1,u=0;u<4;u++)v[u]>S[r][u]&&(p=!0);if(!p){var y,b,k,_;for(n.sfb_partition_table=t.nr_of_sfb_block[r][a],u=0;u<4;u++)n.slen[u]=E[v[u]];switch(y=n.slen[0],b=n.slen[1],k=n.slen[2],_=n.slen[3],r){case 0:n.scalefac_compress=(5*y+b<<4)+(k<<2)+_;break;case 1:n.scalefac_compress=400+(5*y+b<<2)+k;break;case 2:n.scalefac_compress=500+3*y+b;break;default:i.err.printf("intensity stereo not implemented yet\n")}}if(!p)for(s(null!=n.sfb_partition_table),n.part2_length=0,u=0;u<4;u++)n.part2_length+=n.slen[u]*n.sfb_partition_table[u];return p};var E=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var n,i=0;e.scalefac_band.l[++i]<t;);for(n=r[i][0];e.scalefac_band.l[n+1]>t;)n--;for(n<0&&(n=r[i][0]),e.bv_scf[t-2]=n,n=r[i][1];e.scalefac_band.l[n+e.bv_scf[t-2]+2]>t;)n--;n<0&&(n=r[i][1]),e.bv_scf[t-1]=n}}}},1828:function(e){e.exports=function(){this.setModules=function(e,t){e,t}}},994:function(e){e.exports=function(){this.sum=0,this.seen=0,this.want=0,this.pos=0,this.size=0,this.bag=null,this.nVbrNumFrames=0,this.nBytesWritten=0,this.TotalFrameSize=0}},812:function(e,t,n){var r=n(8768),i=r.System,a=r.VbrMode,o=(r.Float,r.ShortBlock),s=(r.Util,r.Arrays),c=(r.new_array_n,r.new_byte),u=(r.new_double,r.new_float,r.new_float_n,r.new_int,r.new_int_n,r.assert);function l(){var e,t,n;this.setModules=function(r,i,a){e=r,t=i,n=a};var r=l.NUMTOCENTRIES,d=l.MAXFRAMESIZE,p=r+4+4+4+4+4+9+1+1+8+1+1+3+1+1+2+4+2+2,h="Xing",f="Info",v=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,729
26,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function m(e,t){var n=255&e[t+0];return n<<=8,n|=255&e[t+1],n<<=8,n|=255&e[t+2],n<<=8,n|=255&e[t+3]}function g(e,t,n){e[t+0]=255&n>>24,e[t+1]=255&n>>16,e[t+2]=255&n>>8,e[t+3]=255&n}function y(e,t,n){e[t+0]=255&n>>8,e[t+1]=255&n}function b(e,t,n){return 255&(e<<t|n&~(-1<<t))}function k(t,n){var r=t.internal_flags;n[0]=b(n[0],8,255),n[1]=b(n[1],3,7),n[1]=b(n[1],1,t.out_samplerate<16e3?0:1),n[1]=b(n[1],1,t.version),n[1]=b(n[1],2,1),n[1]=b(n[1],1,t.error_protection?0:1),n[2]=b(n[2],4,r.bitrate_index),n[2]=b(n[2],2,r.samplerate_index),n[2]=b(n[2],1,0),n[2]=b(n[2],1,t.extension),n[3]=b(n[3],2,t.mode.ordinal()),n[3]=b(n[3],2,r.mode_ext),n[3]=b(n[3],1,t.copyright),n[3]=b(n[3],1,t.original),n[3]=b(n[3],2,t.emphasis),n[0]=255;var i,o,s=241&n[1];i=1==t.version?128:t.out_samplerate<16e3?32:64,t.VBR==a.vbr_off&&(i=t.brate),o=t.free_format?0:255&16*e.BitrateIndex(i,t.version,t.out_samplerate),1==t.version?(n[1]=255&(10|s),s=13&n[2],n[2]=255&(o|s)):(n[1]=255&(2|s),s=13&n[2],n[2]=255&(o|s))}function _(e,t){return t=t>>8^v[255&(t^e)]}this.addVbrFrame=function(e){var t=e.internal_flags,n=Tables.bitrate_table[e.version][t.bitrate_index];u(null!=t.VBR_seek_table.bag),function(e,t){if(e.nVbrNumFrames++,e.sum+=t,e.seen++,!(e.seen<e.want)&&(e.pos<e.size&&(e.bag[e.pos]=e.sum,e.pos++,e.seen=0),e.pos==e.size)){for(var n=1;n<e.size;n+=2)e.bag[n/2]=e.bag[n];e.want*=2,e.pos/=2}}(t.VBR_seek_table,n)},this.getVbrTag=function(e){var t=new VBRTagData,n=0;t.flags=0;var i=e[n+1]>>3&1,a=e[n+2]>>2&3,o=e[n+3]>>6&3,s=e[n+2]>>4&15;if(s=Tables.bitrate_table[i][s],e[n+1]>>4==14?t.samprate=Tables.samplerate_table[2][a]:t.samprate=Tables.samplerate_table[i][a],!function(e,t){return new String(e,t,4(),null).equals(h)||new String(e,t,4(),null).equals(f)}(e,n+=0!=i?3!=o?36:21:3!=o?21:13))return null;n+=4,t.hId=i;var c=t.flags=m(e,n);if(n+=4,0!=(1&c)&&(t.frames=m(e,n),n+=4),0!=(2&c)&&(t.bytes=m(e,n),n+=4),0!=(4&c)){if(null!=t.toc)for(var u=0;u<r;u++)t.toc[u]=e[n+u];n+=r}t.vbrScale=-1,0!=(8&c)&&(t.vbrScale=m(e,n),n+=4),t.headersize=72e3*(i+1)*s/t.samprate;var l=e[(n+=21)+0]<<4;l+=e[n+1]>>4;var d=(15&e[n+1])<<8;return(l<0||l>3e3)&&(l=-1),((d+=255&e[n+2])<0||d>3e3)&&(d=-1),t.encDelay=l,t.encPadding=d,t},this.InitVbrTag=function(e){var n,r=e.internal_flags;n=1==e.version?128:e.out_samplerate<16e3?32:64,e.VBR==a.vbr_off&&(n=e.brate);var i=72e3*(e.version+1)*n/e.out_samplerate,o=r.sideinfo_len+p;if(r.VBR_seek_table.TotalFrameSize=i,i<o||i>d)e.bWriteVbrTag=!1;else{r.VBR_seek_table.nVbrNumFrames=0,r.VBR_seek_table.nBytesWritten=0,r.VBR_seek_table.sum=0,r.VBR_seek_table.seen=0,r.VBR_seek_table.want=1,r.VBR_seek_table.pos=0,null==r.VBR_seek_table.bag&&(r.VBR_seek_table.bag=new int[400],r.VBR_seek_table.size=400);var s=c(d);k(e,s);for(var u=r.VBR_seek_table.TotalFrameSize,l=0;l<u;++l)t.add_dummy_byte(e,255&s[l],1)}},this.updateMusicCRC=function(e,t,n,r){for(var i=0;i<r;++i)e[0]=_(t[n+i],e[0])},this.getLameTagFrame=function(e,u){var l=e.internal_flags;if(!e.bWriteVbrTag)return 0;if(l.Class_ID!=Lame.LAME_ID)return 0;if(l.VBR_seek_table.pos<=0)return 0;if(u.length<l.VBR_seek_table.TotalFrameSize)return l.VBR_seek_table.TotalFrameSize;
2s.fill(u,0,l.VBR_seek_table.TotalFrameSize,0),k(e,u);var d=c(r);if(e.free_format)for(var p=1;p<r;++p)d[p]=255&255*p/100;else!function(e,t){if(!(e.pos<=0))for(var n=1;n<r;++n){var i=n/r,a=0|Math.floor(i*e.pos);a>e.pos-1&&(a=e.pos-1);var o=0|256*e.bag[a]/e.sum;o>255&&(o=255),t[n]=255&o}}(l.VBR_seek_table,d);var v=l.sideinfo_len;e.error_protection&&(v-=2),e.VBR==a.vbr_off?(u[v++]=255&f.charAt(0),u[v++]=255&f.charAt(1),u[v++]=255&f.charAt(2),u[v++]=255&f.charAt(3)):(u[v++]=255&h.charAt(0),u[v++]=255&h.charAt(1),u[v++]=255&h.charAt(2),u[v++]=255&h.charAt(3)),g(u,v,15),g(u,v+=4,l.VBR_seek_table.nVbrNumFrames),v+=4;var m=l.VBR_seek_table.nBytesWritten+l.VBR_seek_table.TotalFrameSize;g(u,v,0|m),v+=4,i.arraycopy(d,0,u,v,d.length),v+=d.length,e.error_protection&&t.CRC_writeheader(l,u);var b=0;for(p=0;p<v;p++)b=_(u[p],b);return v+=function(e,t,r,i,a){var s,c,u,l,d,p=e.internal_flags,h=0,f=e.encoder_delay,v=e.encoder_padding,m=100-10*e.VBR_q-e.quality,b=n.getLameVeryShortVersion(),k=[1,5,3,2,4,0,3],w=0|(e.lowpassfreq/100+.5>255?255:e.lowpassfreq/100+.5),x=0,S=0,E=e.internal_flags.noise_shaping,T=0,P=0,C=0,R=0!=(1&e.exp_nspsytune),Z=0!=(2&e.exp_nspsytune),M=!1,A=!1,I=e.internal_flags.nogap_total,O=e.internal_flags.nogap_current,L=e.ATHtype;switch(e.VBR){case vbr_abr:d=e.VBR_mean_bitrate_kbps;break;case vbr_off:d=e.brate;break;default:d=e.VBR_min_bitrate_kbps}switch(s=0+(e.VBR.ordinal()<k.length?k[e.VBR.ordinal()]:0),p.findReplayGain&&(p.RadioGain>510&&(p.RadioGain=510),p.RadioGain<-510&&(p.RadioGain=-510),S=8192,S|=3072,p.RadioGain>=0?S|=p.RadioGain:(S|=512,S|=-p.RadioGain)),p.findPeakSample&&(x=Math.abs(0|p.PeakSample/32767*Math.pow(2,23)+.5)),-1!=I&&(O>0&&(A=!0),O<I-1&&(M=!0)),l=L+((R?1:0)<<4)+((Z?1:0)<<5)+((M?1:0)<<6)+((A?1:0)<<7),m<0&&(m=0),e.mode){case MONO:T=0;break;case STEREO:T=1;break;case DUAL_CHANNEL:T=2;break;case JOINT_STEREO:T=e.force_ms?4:3;break;case NOT_SET:default:T=7}C=e.in_samplerate<=32e3?0:48e3==e.in_samplerate?2:e.in_samplerate>48e3?3:1,(e.short_blocks==o.short_block_forced||e.short_blocks==o.short_block_dispensed||-1==e.lowpassfreq&&-1==e.highpassfreq||e.scale_left<e.scale_right||e.scale_left>e.scale_right||e.disable_reservoir&&e.brate<320||e.noATH||e.ATHonly||0==L||e.in_samplerate<=32e3)&&(P=1),c=E+(T<<2)+(P<<5)+(C<<6),u=p.nMusicCRC,g(r,i+h,m),h+=4;for(var D=0;D<9;D++)r[i+h+D]=255&b.charAt(D);r[i+(h+=9)]=255&s,r[i+ ++h]=255&w,g(r,i+ ++h,x),y(r,i+(h+=4),S),y(r,i+(h+=2),0),r[i+(h+=2)]=255&l,r[i+ ++h]=d>=255?255:255&d,r[i+ ++h]=255&f>>4,r[i+h+1]=255&(f<<4)+(v>>8),r[i+h+2]=255&v,r[i+(h+=3)]=255&c,h++,r[i+h++]=0,y(r,i+h,e.preset),g(r,i+(h+=2),t),y(r,i+(h+=4),u),h+=2;for(var N=0;N<h;N++)a=_(r[i+N],a);return y(r,i+h,a),h+2}(e,m,u,v,b),l.VBR_seek_table.TotalFrameSize},this.putVbrTag=function(e,t){if(e.internal_flags.VBR_seek_table.pos<=0)return-1;if(t.seek(t.length()),0==t.length())return-1;var n=function(e){e.seek(0);var t=c(10);return e.readFully(t),new String(t,"ISO-8859-1").startsWith("ID3")?0:((127&t[6])<<21|(127&t[7])<<14|(127&t[8])<<7|127&t[9])+t.length}(t);t.seek(n);var r=c(d),i=getLameTagFrame(e,r);return i>r.length?-1:(i<1||t.write(r,0,i),0)}}l.NUMTOCENTRIES=100,l.MAXFRAMESIZE=2880,e.exports=l},2650:function(e){e.exports=function(){this.getLameVersion=function(){return"3.98.4"},this.getLameShortVersion=function(){return"3.98.4"},this.getLameVeryShortVersion=function(){return"LAME3.98r"},this.getPsyVersion=function(){return"0.93"},this.getLameUrl=function(){return"http://www.mp3dev.org/"},this.getLameOsBitness=function(){return"32bits"}}},8768:function(e){function t(e){return new Int16Array(e)}function n(e){return new Int32Array(e)}function r(e){return new Float32Array(e)}var i={fill:function(e,t,n,r){if(2==arguments.length)for(var i=0;i<e.length;i++)e[i]=arguments[1];else for(i=t;i<n;i++)e[i]=r}},a={arraycopy:function(e,t,n,r,i){for(var a=t+i;t<a;)n[r++]=e[t++]},out:{}};a.out.println=function(e){console.log(e)},a.out.printf=function(){console.log.apply(console,arguments)};var o={};function s(e){this.ordinal=e}o.SQRT2=1.4142135623730951,o.FAST_LOG10=function(e){return Math.log10(e)},o.FAST_LOG10_X=function(e,t){return Math.log10(e)*t},s.short_block_allowed=new s(0),s.short_block_coupled=new s(1),s.short_block_dispensed=new s(2),s.short_block_forced=new s(3);var c={};function u(e){this.ordinal=e}c.MAX_VALUE=34028235e31,u.vbr_off=new u(0),u.vbr_mt=new u(1),u.vbr_rh=new u(2),u.vbr_abr=new u(3),u.vbr_mtrh=new u(4),u.vbr_default=u.vbr_mtrh;e.exports={System:a,VbrMode:u,Float:c,ShortBlock:s,Util:o,Arrays:i,new_array_n:function e(t){if(1==t.length)return new Array(t[0]);var n=t[0];t=t.slice(1);for(var r=[],i=0;i<n;i++)r.push(e(t));return r},new_byte:function(e){return new Int8Array(e)},new_double:function(e){return new Float64Array(e)},new_float:r,new_float_n:function e(t){if(1==t.length)return r(t[0]);var n=t[0];t=t.slice(1);for(var i=[],a=0;a<n;a++)i.push(e(t));return i},new_int:n,new_int_n:function e(t){if(1==t.length)return n(t[0]);var r=t[0];t=t.slice(1);for(var i=[],a=0;a<r;a++)i.push(e(t));return i},new_short:t,new_short_n:function e(n){if(1==n.length)return t(n[0]);var r=n[0];n=n.slice(1);for(var i=[],a=0;a<r;a++)i.push(e(n));return i},assert:function(e){}}},8350:function(e,t,n){var r=n(8768),i=(r.System,r.VbrMode,r.Float,r.ShortBlock,r.Util,r.Arrays,r.new_array_n,r.new_byte),a=(r.new_double,r.new_float,r.new_float_n,r.new_int,r.new_int_n,r.assert),o=n(7589),s=n(1084),c=n(7932),u=n(9091),l=n(2349),d=n(2191),p=n(5991),h=n(8299),f=n(6435),v=(n(610),n(2650)),m=n(812);function g(){this.setModules=function(e,t){e,t}}function y(){this.setModules=function(e,t,n){e,t,n}}function b(){}function k(){this.setModules=function(e,t){e,t}}function _(){this.dataOffset=0,this.dataLen=0,this.channels=0,this.sampleRate=0}function w(e){return e.charCodeAt(0)<<24|e.charCodeAt(1)<<16|e.charCodeAt(2)<<8|e.charCodeAt(3)}_.RIFF=w("RIFF"),_.WAVE=w("WAVE"),_.fmt_=w("fmt "),_.data=w("data"),_.readHeader=function(e){var t=new _,n=e.getUint32(0,!1);if(_.RIFF==n){e.getUint32(4,!0);if(_.WAVE==e.getUint32(8,!1)&&_.fmt_==e.getUint32(12,!1)){var r=e.getUint32(16,!0),i=20;switch(r){case 16:case 18:t.channels=e.getUint16(i+2,!0),t.sampleRate=e.getUint32(i+4,!0);break;default:throw"extended fmt chunk not implemented"}i+=r;for(var a=_.data,o=0;a!=n&&(n=e.getUint32(i,!1),o=e.getUint32(i+4,!0),a!=n);)i+=o+8;return t.dataLen=o,t.dataOffset=i+8,t}}},e.exports.d=function(e,t,n){3!=arguments.length&&(console.error("WARN: Mp3Encoder(channels, samplerate, kbps) not specified"),e=1,t=44100,n=128);var r=new o,_=new g,w=new c,x=new f,S=new s,E=new u,T=new l,P=new m,C=new v,R=new k,Z=new p,M=new d,A=new y,I=new b;r.setModules(w,x,S,E,T,P,C,R,I),x.setModules(w,I,C,P),R.setModules(x,C),S.setModules(r),T.setModules(x,Z,E,M),E.setModules(M,Z,r.enc.psy),Z.setModules(x),M.setModules(E),P.setModules(r,x,C),_.setModules(A,I),A.setModules(C,R,S);var O=r.lame_init();O.num_channels=e,O.in_samplerate=t,O.brate=n,O.mode=h.STEREO,O.quality=3,O.bWriteVbrTag=!1,O.disable_reservoir=!0,O.write_id3tag_automatic=!1;var L=r.lame_init_params(O);a(0==L);var D=1152,N=0|1.25*D+7200,j=i(N);this.encodeBuffer=function(t,n){1==e&&(n=t),a(t.length==n.length),t.length>D&&(D=t.length,j=i(N=0|1.25*D+7200));var o=r.lame_encode_buffer(O,t,n,t.length,j,0,N);return new Int8Array(j.subarray(0,o))},this.flush=function(){var e=r.lame_encode_flush(O,j,0,N);return new Int8Array(j.subarray(0,e))}}},4463:function(e,t,n){"use strict";var r=n(2791),i=n(5296);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,s={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(s[e]=t,e=0;e<t.length;e++)o.add(t[e])}var l=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},f={};function v(e,t,n,r,i,a,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){m[e]=new v(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEac
vendor: 34,480 bytes, line 2
2h((function(e){var t=e[0];m[t]=new v(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){m[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){m[e]=new v(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){m[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){m[e]=new v(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){m[e]=new v(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){m[e]=new v(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){m[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)}));var g=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function b(e,t,n,r){var i=m.hasOwnProperty(t)?m[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(f,e)||!d.call(h,e)&&(p.test(e)?f[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(g,y);m[t]=new v(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(g,y);m[t]=new v(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(g,y);m[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){m[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)})),m.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){m[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)}));var k=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),w=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),P=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var I=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var O=Symbol.iterator;function L(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=O&&e[O]||e["@@iterator"])?e:null}var D,N=Object.assign;function j(e){if(void 0===D)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);D=t&&t[1]||""}return"\n"+D+e}var B=!1;function U(e,t){if(!e||B)return"";B=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&"string"===typeof u.stack){for(var i=u.stack.split("\n"),a=r.stack.split("\n"),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(1!==o||1!==s)do{if(o--,0>--s||i[o]!==a[s]){var c="\n"+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}}while(1<=o&&0<=s);break}}}finally{B=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?j(e):""}function V(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=U(e.type,!1);case 11:return e=U(e.type.render,!1);case 1:return e=U(e.type,!0);default:return""}}function F(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case x:return"Fragment";case w:return"Portal";case E:return"Profiler";case S:return"StrictMode";case R:return"Suspense";case Z:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case P:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case C:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case M:return null!==(t=e.displayName||null)?t:F(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return F(e(t))}catch(n){}}return null}function z(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return F(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function q(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function G(e){e._valueTracker||(e._valueTracker=function(e){var t=q(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function W(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=q(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function J(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function $(e,t){var n=t.checked;return N({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function K(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=H(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Q(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function Y(e,t){Q(e,t);var n=H(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,H(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function X(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+H(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return N({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(te(n)){if(1<n.length)throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:H(n)}}function ae(e,t){var n=H(t.value),r=H(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ce(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ue,le,de=(le=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ue=ue||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return le(e,t)}))}:le);function pe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fe=["Webkit","ms","Moz","O"];function ve(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=ve(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(he).forEach((function(e){fe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]}))}));var ge=N({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ge[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ke=null;function _e(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var we=null,xe=null,Se=null;function Ee(e){if(e=bi(e)){if("function"!==typeof we)throw Error(a(280));var t=e.stateNode;t&&(t=_i(t),we(e.stateNode,e.type,t))}}function Te(e){xe?Se?Se.push(e):Se=[e]:xe=e}function Pe(){if(xe){var e=xe,t=Se;if(Se=xe=null,Ee(e),t)for(e=0;e<t.length;e++)Ee(t[e])}}function Ce(e,t){return e(t)}function Re(){}var Ze=!1;function Me(e,t,n){if(Ze)return e(t,n);Ze=!0;try{return Ce(e,t,n)}finally{Ze=!1,(null!==xe||null!==Se)&&(Re(),Pe())}}function Ae(e,t){var n=e.stateNode;if(null===n)return null;var r=_i(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var Ie=!1;if(l)try{var Oe={};Object.defineProperty(Oe,"passive",{get:function(){Ie=!0}}),window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch(le){Ie=!1}function Le(e,t,n,r,i,a,o,s,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(l){this.onError(l)}}var De=!1,Ne=null,je=!1,Be=null,Ue={onError:function(e){De=!0,Ne=e}};function Ve(e,t,n,r,i,a,o,s,c){De=!1,Ne=null,Le.apply(Ue,arguments)}function Fe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function ze(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if(Fe(e)!==e)throw Error(a(188))}function qe(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Fe(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return He(i),e;if(o===r)return He(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e))?Ge(e):null}function Ge(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ge(e);if(null!==t)return t;e=e.sibling}return null}var We=i.unstable_scheduleCallback,Je=i.unstable_cancelCallback,$e=i.unstable_shouldYield,Ke=i.unstable_requestPaint,Qe=i.unstable_now,Ye=i.unstable_getCurrentPriorityLevel,Xe=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,nt=i.unstable_LowPriority,rt=i.unstable_IdlePriority,it=null,at=null;var ot=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(st(e)/ct|0)|0},st=Math.log,ct=Math.LN2;var ut=64,lt=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=268435455&n;if(0!==o){var s=o&~i;0!==s?r=dt(s):0!==(a&=o)&&(r=dt(a))}else 0!==(o=n&~i)?r=dt(o):0!==a&&(r=dt(a));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(a=t&-t)||16===i&&0!==(4194240&a)))return t;if(0!==(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-ot(t)),r|=e[n],t&=~i;return r}function ht(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ft(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function vt(){var e=ut;return 0===(4194240&(ut<<=1))&&(ut=64),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ot(t)]=n}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var bt=0;function kt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var _t,wt,xt,St,Et,Tt=!1,Pt=[],Ct=null,Rt=null,Zt=null,Mt=new Map,At=new Map,It=[],Ot="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Lt(e,t){switch(e){case"focusin":case"focusout":Ct=null;break;case"dragenter":case"dragleave":Rt=null;break;case"mouseover":case"mouseout":Zt=null;break;case"pointerover":case"pointerout":Mt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(t.pointerId)}}function Dt(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=bi(t))&&wt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Nt(e){var t=yi(e.target);if(null!==t){var n=Fe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=ze(n)))return e.blockedOn=t,void Et(e.priority,(function(){xt(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function jt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=$t(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=bi(n))&&wt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ke=r,n.target.dispatchEvent(r),ke=null,t.shift()}return!0}function Bt(e,t,n){jt(e)&&n.delete(t)}function Ut(){Tt=!1,null!==Ct&&jt(Ct)&&(Ct=null),null!==Rt&&jt(Rt)&&(Rt=null),null!==Zt&&jt(Zt)&&(Zt=null),Mt.forEach(Bt),At.forEach(Bt)}function Vt(e,t){e.blockedOn===t&&(e.blockedOn=null,Tt||(Tt=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Ut)))}function Ft(e){function t(t){return Vt(t,e)}if(0<Pt.length){Vt(Pt[0],e);for(var n=1;n<Pt.length;n++){var r=Pt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Ct&&Vt(Ct,e),null!==Rt&&Vt(Rt,e),null!==Zt&&Vt(Zt,e),Mt.forEach(t),At.forEach(t),n=0;n<It.length;n++)(r=It[n]).blockedOn===e&&(r.blockedOn=null);for(;0<It.length&&null===(n=It[0]).blockedOn;)Nt(n),null===n.blockedOn&&It.shift()}var zt=k.ReactCurrentBatchConfig,Ht=!0;function qt(e,t,n,r){var i=bt,a=zt.transition;zt.transition=null;try{bt=1,Wt(e,t,n,r)}finally{bt=i,zt.transition=a}}function Gt(e,t,n,r){var i=bt,a=zt.transition;zt.transition=null;try{bt=4,Wt(e,t,n,r)}finally{bt=i,zt.transition=a}}function Wt(e,t,n,r){if(Ht){var i=$t(e,t,n,r);if(null===i)Hr(e,t,r,Jt,n),Lt(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Ct=Dt(Ct,e,t,n,r,i),!0;case"dragenter":return Rt=Dt(Rt,e,t,n,r,i),!0;case"mouseover":return Zt=Dt(Zt,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Mt.set(a,Dt(Mt.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,At.set(a,Dt(At.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Lt(e,r),4&t&&-1<Ot.indexOf(e)){for(;null!==i;){var a=bi(i);if(null!==a&&_t(a),null===(a=$t(e,t,n,r))&&Hr(e,t,r,Jt,n),a===i)break;i=a}null!==i&&r.stopPropagation()}else Hr(e,t,r,null,n)}}var Jt=null;function $t(e,t,n,r){if(Jt=null,null!==(e=yi(e=_e(r))))if(null===(t=Fe(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=ze(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Jt=e,null}function Kt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ye()){case Xe:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Qt=null,Yt=null,Xt=null;function en(){if(Xt)return Xt;var e,t,n=Yt,r=n.length,i="value"in Qt?Qt.value:Qt.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Xt=i.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function an(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var on,sn,cn,un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ln=an(un),dn=N({},un,{view:0,detail:0}),pn=an(dn),hn=N({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cn&&(cn&&"mousemove"===e.type?(on=e.screenX-cn.screenX,sn=e.screenY-cn.screenY):sn=on=0,cn=e),on)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),fn=an(hn),vn=an(N({},hn,{dataTransfer:0})),mn=an(N({},dn,{relatedTarget:0})),gn=an(N({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),yn=N({},un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=an(yn),kn=an(N({},un,{data:0})),_n={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=xn[e])&&!!t[e]}function En(){return Sn}var Tn=N({},dn,{key:function(e){if(e.key){var t=_n[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Pn=an(Tn),Cn=an(N({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=an(N({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),Zn=an(N({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mn=N({},hn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),An=an(Mn),In=[9,13,27,32],On=l&&"CompositionEvent"in window,Ln=null;l&&"documentMode"in document&&(Ln=document.documentMode);var Dn=l&&"TextEvent"in window&&!Ln,Nn=l&&(!On||Ln&&8<Ln&&11>=Ln),jn=String.fromCharCode(32),Bn=!1;function Un(e,t){switch(e){case"keyup":return-1!==In.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vn(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Fn=!1;var zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!zn[e.type]:"textarea"===t}function qn(e,t,n,r){Te(r),0<(t=Gr(t,"onChange")).length&&(n=new ln("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Gn=null,Wn=null;function Jn(e){jr(e,0)}function $n(e){if(W(ki(e)))return e}function Kn(e,t){if("change"===e)return t}var Qn=!1;if(l){var Yn;if(l){var Xn="oninput"in document;if(!Xn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Xn="function"===typeof er.oninput}Yn=Xn}else Yn=!1;Qn=Yn&&(!document.documentMode||9<document.documentMode)}function tr(){Gn&&(Gn.detachEvent("onpropertychange",nr),Wn=Gn=null)}function nr(e){if("value"===e.propertyName&&$n(Wn)){var t=[];qn(t,Wn,e,_e(e)),Me(Jn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Wn=n,(Gn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ir(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return $n(Wn)}function ar(e,t){if("click"===e)return $n(t)}function or(e,t){if("input"===e||"change"===e)return $n(t)}var sr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function cr(e,t){if(sr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!d.call(t,i)||!sr(e[i],t[i]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lr(e,t){var n,r=ur(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ur(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pr(){for(var e=window,t=J();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=J((e=t.contentWindow).document)}return t}function hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function fr(e){var t=pr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&hr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=void 0===r.end?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=lr(n,a);var o=lr(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vr=l&&"documentMode"in document&&11>=document.documentMode,mr=null,gr=null,yr=null,br=!1;function kr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;br||null==mr||mr!==J(r)||("selectionStart"in(r=mr)&&hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},yr&&cr(yr,r)||(yr=r,0<(r=Gr(gr,"onSelect")).length&&(t=new ln("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=mr)))}function _r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var wr={animationend:_r("Animation","AnimationEnd"),animationiteration:_r("Animation","AnimationIteration"),animationstart:_r("Animation","AnimationStart"),transitionend:_r("Transition","TransitionEnd")},xr={},Sr={};function Er(e){if(xr[e])return xr[e];if(!wr[e])return e;var t,n=wr[e];for(t in n)if(n.hasOwnProperty(t)&&t in Sr)return xr[e]=n[t];return e}l&&(Sr=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);var Tr=Er("animationend"),Pr=Er("animationiteration"),Cr=Er("animationstart"),Rr=Er("transitionend"),Zr=new Map,Mr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ar(e,t){Zr.set(e,t),c(t,[e])}for(var Ir=0;Ir<Mr.length;Ir++){var Or=Mr[Ir];Ar(Or.toLowerCase(),"on"+(Or[0].toUpperCase()+Or.slice(1)))}Ar(Tr,"onAnimationEnd"),Ar(Pr,"onAnimationIteration"),Ar(Cr,"onAnimationStart"),Ar("dblclick","onDoubleClick"),Ar("focusin","onFocus"),Ar("focusout","onBlur"),Ar(Rr,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focu
2sin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lr));function Nr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,s,c,u){if(Ve.apply(this,arguments),De){if(!De)throw Error(a(198));var l=Ne;De=!1,Ne=null,je||(je=!0,Be=l)}}(r,t,void 0,e),e.currentTarget=null}function jr(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,u=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break e;Nr(i,s,u),a=c}else for(o=0;o<r.length;o++){if(c=(s=r[o]).instance,u=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break e;Nr(i,s,u),a=c}}}if(je)throw e=Be,je=!1,Be=null,e}function Br(e,t){var n=t[vi];void 0===n&&(n=t[vi]=new Set);var r=e+"__bubble";n.has(r)||(zr(t,e,2,!1),n.add(r))}function Ur(e,t,n){var r=0;t&&(r|=4),zr(n,e,r,t)}var Vr="_reactListening"+Math.random().toString(36).slice(2);function Fr(e){if(!e[Vr]){e[Vr]=!0,o.forEach((function(t){"selectionchange"!==t&&(Dr.has(t)||Ur(t,!1,e),Ur(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Vr]||(t[Vr]=!0,Ur("selectionchange",!1,t))}}function zr(e,t,n,r){switch(Kt(t)){case 1:var i=qt;break;case 4:i=Gt;break;default:i=Wt}n=i.bind(null,t,n,e),i=void 0,!Ie||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Hr(e,t,n,r,i){var a=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var c=o.tag;if((3===c||4===c)&&((c=o.stateNode.containerInfo)===i||8===c.nodeType&&c.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=yi(s)))return;if(5===(c=o.tag)||6===c){r=a=o;continue e}s=s.parentNode}}r=r.return}Me((function(){var r=a,i=_e(n),o=[];e:{var s=Zr.get(e);if(void 0!==s){var c=ln,u=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":c=Pn;break;case"focusin":u="focus",c=mn;break;case"focusout":u="blur",c=mn;break;case"beforeblur":case"afterblur":c=mn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=fn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=vn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=Rn;break;case Tr:case Pr:case Cr:c=gn;break;case Rr:c=Zn;break;case"scroll":c=pn;break;case"wheel":c=An;break;case"copy":case"cut":case"paste":c=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=Cn}var l=0!==(4&t),d=!l&&"scroll"===e,p=l?null!==s?s+"Capture":null:s;l=[];for(var h,f=r;null!==f;){var v=(h=f).stateNode;if(5===h.tag&&null!==v&&(h=v,null!==p&&(null!=(v=Ae(f,p))&&l.push(qr(f,v,h)))),d)break;f=f.return}0<l.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:l}))}}if(0===(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ke||!(u=n.relatedTarget||n.fromElement)||!yi(u)&&!u[fi])&&(c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?yi(u):null)&&(u!==(d=Fe(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(c=null,u=r),c!==u)){
vendor: 2,540 bytes, line 2
2if(l=fn,v="onMouseLeave",p="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(l=Cn,v="onPointerLeave",p="onPointerEnter",f="pointer"),d=null==c?s:ki(c),h=null==u?s:ki(u),(s=new l(v,f+"leave",c,n,i)).target=d,s.relatedTarget=h,v=null,yi(i)===r&&((l=new l(p,f+"enter",u,n,i)).target=h,l.relatedTarget=d,v=l),d=v,c&&u)e:{for(p=u,f=0,h=l=c;h;h=Wr(h))f++;for(h=0,v=p;v;v=Wr(v))h++;for(;0<f-h;)l=Wr(l),f--;for(;0<h-f;)p=Wr(p),h--;for(;f--;){if(l===p||null!==p&&l===p.alternate)break e;l=Wr(l),p=Wr(p)}l=null}else l=null;null!==c&&Jr(o,s,c,l,!1),null!==u&&null!==d&&Jr(o,d,u,l,!0)}if("select"===(c=(s=r?ki(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===c&&"file"===s.type)var m=Kn;else if(Hn(s))if(Qn)m=or;else{m=ir;var g=rr}else(c=s.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=ar);switch(m&&(m=m(e,r))?qn(o,m,n,i):(g&&g(e,s,r),"focusout"===e&&(g=s._wrapperState)&&g.controlled&&"number"===s.type&&ee(s,"number",s.value)),g=r?ki(r):window,e){case"focusin":(Hn(g)||"true"===g.contentEditable)&&(mr=g,gr=r,yr=null);break;case"focusout":yr=gr=mr=null;break;case"mousedown":br=!0;break;case"contextmenu":case"mouseup":case"dragend":br=!1,kr(o,n,i);break;case"selectionchange":if(vr)break;case"keydown":case"keyup":kr(o,n,i)}var y;if(On)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Fn?Un(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Nn&&"ko"!==n.locale&&(Fn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Fn&&(y=en()):(Yt="value"in(Qt=i)?Qt.value:Qt.textContent,Fn=!0)),0<(g=Gr(r,b)).length&&(b=new kn(b,e,null,n,i),o.push({event:b,listeners:g}),y?b.data=y:null!==(y=Vn(n))&&(b.data=y))),(y=Dn?function(e,t){switch(e){case"compositionend":return Vn(t);case"keypress":return 32!==t.which?null:(Bn=!0,jn);case"textInput":return(e=t.data)===jn&&Bn?null:e;default:return null}}(e,n):function(e,t){if(Fn)return"compositionend"===e||!On&&Un(e,t)?(e=en(),Xt=Yt=Qt=null,Fn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Nn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Gr(r,"onBeforeInput")).length&&(i=new kn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=y))}jr(o,t)}
vendor: 98,200 bytes, line 2
2))}function qr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,a=i.stateNode;5===i.tag&&null!==a&&(i=a,null!=(a=Ae(e,n))&&r.unshift(qr(e,a,i)),null!=(a=Ae(e,t))&&r.push(qr(e,a,i))),e=e.return}return r}function Wr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Jr(e,t,n,r,i){for(var a=t._reactName,o=[];null!==n&&n!==r;){var s=n,c=s.alternate,u=s.stateNode;if(null!==c&&c===r)break;5===s.tag&&null!==u&&(s=u,i?null!=(c=Ae(n,a))&&o.unshift(qr(n,c,s)):i||null!=(c=Ae(n,a))&&o.push(qr(n,c,s))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var $r=/\r\n?/g,Kr=/\u0000|\uFFFD/g;function Qr(e){return("string"===typeof e?e:""+e).replace($r,"\n").replace(Kr,"")}function Yr(e,t,n){if(t=Qr(t),Qr(e)!==t&&n)throw Error(a(425))}function Xr(){}var ei=null,ti=null;function ni(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ri="function"===typeof setTimeout?setTimeout:void 0,ii="function"===typeof clearTimeout?clearTimeout:void 0,ai="function"===typeof Promise?Promise:void 0,oi="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof ai?function(e){return ai.resolve(null).then(e).catch(si)}:ri;function si(e){setTimeout((function(){throw e}))}function ci(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void Ft(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);Ft(t)}function ui(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function li(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var di=Math.random().toString(36).slice(2),pi="__reactFiber$"+di,hi="__reactProps$"+di,fi="__reactContainer$"+di,vi="__reactEvents$"+di,mi="__reactListeners$"+di,gi="__reactHandles$"+di;function yi(e){var t=e[pi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fi]||n[pi]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=li(e);null!==e;){if(n=e[pi])return n;e=li(e)}return t}n=(e=n).parentNode}return null}function bi(e){return!(e=e[pi]||e[fi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ki(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function _i(e){return e[hi]||null}var wi=[],xi=-1;function Si(e){return{current:e}}function Ei(e){0>xi||(e.current=wi[xi],wi[xi]=null,xi--)}function Ti(e,t){xi++,wi[xi]=e.current,e.current=t}var Pi={},Ci=Si(Pi),Ri=Si(!1),Zi=Pi;function Mi(e,t){var n=e.type.contextTypes;if(!n)return Pi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ai(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Ii(){Ei(Ri),Ei(Ci)}function Oi(e,t,n){if(Ci.current!==Pi)throw Error(a(168));Ti(Ci,t),Ti(Ri,n)}function Li(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(a(108,z(e)||"Unknown",i));return N({},n,r)}function Di(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pi,Zi=Ci.current,Ti(Ci,e),Ti(Ri,Ri.current),!0}function Ni(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Li(e,t,Zi),r.__reactInternalMemoizedMergedChildContext=e,Ei(Ri),Ei(Ci),Ti(Ci,e)):Ei(Ri),Ti(Ri,n)}var ji=null,Bi=!1,Ui=!1;function Vi(e){null===ji?ji=[e]:ji.push(e)}function Fi(){if(!Ui&&null!==ji){Ui=!0;var e=0,t=bt;try{var n=ji;for(bt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}ji=null,Bi=!1}catch(i){throw null!==ji&&(ji=ji.slice(e+1)),We(Xe,Fi),i}finally{bt=t,Ui=!1}}return null}var zi=[],Hi=0,qi=null,Gi=0,Wi=[],Ji=0,$i=null,Ki=1,Qi="";function Yi(e,t){zi[Hi++]=Gi,zi[Hi++]=qi,qi=e,Gi=t}function Xi(e,t,n){Wi[Ji++]=Ki,Wi[Ji++]=Qi,Wi[Ji++]=$i,$i=e;var r=Ki;e=Qi;var i=32-ot(r)-1;r&=~(1<<i),n+=1;var a=32-ot(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-ot(t)+i|n<<i|r,Qi=a+e}else Ki=1<<a|n<<i|r,Qi=e}function ea(e){null!==e.return&&(Yi(e,1),Xi(e,1,0))}function ta(e){for(;e===qi;)qi=zi[--Hi],zi[Hi]=null,Gi=zi[--Hi],zi[Hi]=null;for(;e===$i;)$i=Wi[--Ji],Wi[Ji]=null,Qi=Wi[--Ji],Wi[Ji]=null,Ki=Wi[--Ji],Wi[Ji]=null}var na=null,ra=null,ia=!1,aa=null;function oa(e,t){var n=Au(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function sa(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,na=e,ra=ui(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,na=e,ra=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==$i?{id:Ki,overflow:Qi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Au(18,null,null,0)).stateNode=t,n.return=e,e.child=n,na=e,ra=null,!0);default:return!1}}function ca(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function ua(e){if(ia){var t=ra;if(t){var n=t;if(!sa(e,t)){if(ca(e))throw Error(a(418));t=ui(n.nextSibling);var r=na;t&&sa(e,t)?oa(r,n):(e.flags=-4097&e.flags|2,ia=!1,na=e)}}else{if(ca(e))throw Error(a(418));e.flags=-4097&e.flags|2,ia=!1,na=e}}}function la(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;na=e}function da(e){if(e!==na)return!1;if(!ia)return la(e),ia=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ni(e.type,e.memoizedProps)),t&&(t=ra)){if(ca(e))throw pa(),Error(a(418));for(;t;)oa(e,t),t=ui(t.nextSibling)}if(la(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ra=ui(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ra=null}}else ra=na?ui(e.stateNode.nextSibling):null;return!0}function pa(){for(var e=ra;e;)e=ui(e.nextSibling)}function ha(){ra=na=null,ia=!1}function fa(e){null===aa?aa=[e]:aa.push(e)}var va=k.ReactCurrentBatchConfig;function ma(e,t){if(e&&e.defaultProps){for(var n in t=N({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var ga=Si(null),ya=null,ba=null,ka=null;function _a(){ka=ba=ya=null}function wa(e){var t=ga.current;Ei(ga),e._currentValue=t}function xa(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Sa(e,t){ya=e,ka=ba=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ks=!0),e.firstContext=null)}function Ea(e){var t=e._currentValue;if(ka!==e)if(e={context:e,memoizedValue:t,next:null},null===ba){if(null===ya)throw Error(a(308));ba=e,ya.dependencies={lanes:0,firstContext:e}}else ba=ba.next=e;return t}var Ta=null;function Pa(e){null===Ta?Ta=[e]:Ta.push(e)}function Ca(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,Pa(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ra(e,r)}function Ra(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Za=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Aa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ia(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Oa(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&Rc)){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ra(e,n)}return null===(i=r.interleaved)?(t.next=t,Pa(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ra(e,n)}function La(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}function Da(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=o:a=a.next=o,n=n.next}while(null!==n);null===a?i=a=t:a=a.next=t}else i=a=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Na(e,t,n,r){var i=e.updateQueue;Za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var c=s,u=c.next;c.next=null,null===o?a=u:o.next=u,o=c;var l=e.alternate;null!==l&&((s=(l=l.updateQueue).lastBaseUpdate)!==o&&(null===s?l.firstBaseUpdate=u:s.next=u,l.lastBaseUpdate=c))}if(null!==a){var d=i.baseState;for(o=0,l=u=c=null,s=a;;){var p=s.lane,h=s.eventTime;if((r&p)===p){null!==l&&(l=l.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var f=e,v=s;switch(p=t,h=n,v.tag){case 1:if("function"===typeof(f=v.payload)){d=f.call(h,d,p);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(p="function"===typeof(f=v.payload)?f.call(h,d,p):f)||void 0===p)break e;d=N({},d,p);break e;case 2:Za=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(p=i.effects)?i.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===l?(u=l=h,c=d):l=l.next=h,o|=p;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(p=s).next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}if(null===l&&(c=d),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=l,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===a&&(i.shared.lanes=0);Nc|=o,e.lanes=o,e.memoizedState=d}}function ja(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!==typeof i)throw Error(a(191,i));i.call(r)}}}var Ba=(new r.Component).refs;function Ua(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:N({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Va={isMounted:function(e){return!!(e=e._reactInternals)&&Fe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tu(),i=nu(e),a=Ia(r,i);a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=Oa(e,a,i))&&(ru(t,e,i,r),La(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tu(),i=nu(e),a=Ia(r,i);a.tag=1,a.payload=t,void 0!==n&&null!==n&&(a.callback=n),null!==(t=Oa(e,a,i))&&(ru(t,e,i,r),La(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tu(),r=nu(e),i=Ia(n,r);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),null!==(t=Oa(e,i,r))&&(ru(t,e,r,n),La(t,e,r))}};function Fa(e,t,n,r,i,a,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!cr(n,r)||!cr(i,a))}function za(e,t,n){var r=!1,i=Pi,a=t.contextType;return"object"===typeof a&&null!==a?a=Ea(a):(i=Ai(t)?Zi:Ci.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?Mi(e,i):Pi),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Va,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ha(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Va.enqueueReplaceState(t,t.state,null)}function qa(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Ba,Ma(e);var a=t.contextType;"object"===typeof a&&null!==a?i.context=Ea(a):(a=Ai(t)?Zi:Ci.current,i.context=Mi(e,a)),i.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(Ua(e,t,a,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Va.enqueueReplaceState(i,i.state,null),Na(e,n,i,r),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4194308)}function Ga(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=r,o=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;t===Ba&&(t=i.refs={}),null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!==typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Wa(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ja(e){return(0,e._init)(e._payload)}function $a(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Ou(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function c(e,t,n,r){return null===t||6!==t.tag?((t=ju(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){var a=n.type;return a===x?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===A&&Ja(a)===t.type)?((r=i(t,n.props)).ref=Ga(e,t,n),r.return=e,r):((r=Lu(n.type,n.key,n.props,null,e.mode,r)).ref=Ga(e,t,n),r.return=e,r)}function l(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Bu(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,a){return null===t||7!==t.tag?((t=Du(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function p(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=ju(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case _:return(n=Lu(t.type,t.key,t.props,null,e.mode,n)).ref=Ga(e,null,t),n.return=e,n;case w:return(t=Bu(t,e.mode,n)).return=e,t;case A:return p(e,(0,t._init)(t._payload),n)}if(te(t)||L(t))return(t=Du(t,e.mode,n,null)).return=e,t;Wa(e,t)}return null}function h(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n)return null!==i?null:c(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case _:return n.key===i?u(e,t,n,r):null;case w:return n.key===i?l(e,t,n,r):null;case A:return h(e,t,(i=n._init)(n._payload),r)}if(te(n)||L(n))return null!==i?null:d(e,t,n,r,null);Wa(e,n)}return null}function f(e,t,n,r,i){if("string"===typeof r&&""!==r||"number"===typeof r)return c(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case _:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case w:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case A:return f(e,t,n,(0,r._init)(r._payload),i)}if(te(r)||L(r))return d(t,e=e.get(n)||null,r,i,null);Wa(t,r)}return null}function v(i,a,s,c){for(var u=null,l=null,d=a,v=a=0,m=null;null!==d&&v<s.length;v++){d.index>v?(m=d,d=null):m=d.sibling;var g=h(i,d,s[v],c);if(null===g){null===d&&(d=m);break}e&&d&&null===g.alternate&&t(i,d),a=o(g,a,v),null===l?u=g:l.sibling=g,l=g,d=m}if(v===s.length)return n(i,d),ia&&Yi(i,v),u;if(null===d){for(;v<s.length;v++)null!==(d=p(i,s[v],c))&&(a=o(d,a,v),null===l?u=d:l.sibling=d,l=d);return ia&&Yi(i,v),u}for(d=r(i,d);v<s.length;v++)null!==(m=f(d,i,v,s[v],c))&&(e&&null!==m.alternate&&d.delete(null===m.key?v:m.key),a=o(m,a,v),null===l?u=m:l.sibling=m,l=m);return e&&d.forEach((function(e){return t(i,e)})),ia&&Yi(i,v),u}function m(i,s,c,u){var l=L(c);if("function"!==typeof l)throw Error(a(150));if(null==(c=l.call(c)))throw Error(a(151));for(var d=l=null,v=s,m=s=0,g=null,y=c.next();null!==v&&!y.done;m++,y=c.next()){v.index>m?(g=v,v=null):g=v.sibling;var b=h(i,v,y.value,u);if(null===b){null===v&&(v=g);break}e&&v&&null===b.alternate&&t(i,v),s=o(b,s,m),null===d?l=b:d.sibling=b,d=b,v=g}if(y.done)return n(i,v),ia&&Yi(i,m),l;if(null===v){for(;!y.done;m++,y=c.next())null!==(y=p(i,y.value,u))&&(s=o(y,s,m),null===d?l=y:d.sibling=y,d=y);return ia&&Yi(i,m),l}for(v=r(i,v);!y.done;m++,y=c.next())null!==(y=f(v,i,m,y.value,u))&&(e&&null!==y.alternate&&v.delete(null===y.key?m:y.key),s=o(y,s,m),null===d?l=y:d.sibling=y,d=y);return e&&v.forEach((function(e){return t(i,e)})),ia&&Yi(i,m),l}return function e(r,a,o,c){if("object"===typeof o&&null!==o&&o.type===x&&null===o.key&&(o=o.props.children),"object"===typeof o&&null!==o){switch(o.$$typeof){case _:e:{for(var u=o.key,l=a;null!==l;){if(l.key===u){if((u=o.type)===x){if(7===l.tag){n(r,l.sibling),(a=i(l,o.props.children)).return=r,r=a;break e}}else if(l.elementType===u||"object"===typeof u&&null!==u&&u.$$typeof===A&&Ja(u)===l.type){n(r,l.sibling),(a=i(l,o.props)).ref=Ga(r,l,o),a.return=r,r=a;break e}n(r,l);break}t(r,l),l=l.sibling}o.type===x?((a=Du(o.props.children,r.mode,c,o.key)).return=r,r=a):((c=Lu(o.type,o.key,o.props,null,r.mode,c)).ref=Ga(r,a,o),c.return=r,r=c)}return s(r);case w:e:{for(l=o.key;null!==a;){if(a.key===l){if(4===a.tag&&a.stateNode.containerInfo===o.containerInfo&&a.stateNode.implementation===o.implementation){n(r,a.sibling),(a=i(a,o.children||[])).return=r,r=a;break e}n(r,a);break}t(r,a),a=a.sibling}(a=Bu(o,r.mode,c)).return=r,r=a}return s(r);case A:return e(r,a,(l=o._init)(o._payload),c)}if(te(o))return v(r,a,o,c);if(L(o))return m(r,a,o,c);Wa(r,o)}return"string"===typeof o&&""!==o||"number"===typeof o?(o=""+o,null!==a&&6===a.tag?(n(r,a.sibling),(a=i(a,o)).return=r,r=a):(n(r,a),(a=ju(o,r.mode,c)).return=r,r=a),s(r)):n(r,a)}}var Ka=$a(!0),Qa=$a(!1),Ya={},Xa=Si(Ya),eo=Si(Ya),to=Si(Ya);function no(e){if(e===Ya)throw Error(a(174));return e}function ro(e,t){switch(Ti(to,t),Ti(eo,e),Ti(Xa,Ya),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ce(null,"");break;default:t=ce(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Ei(Xa),Ti(Xa,t)}function io(){Ei(Xa),Ei(eo),Ei(to)}function ao(e){no(to.current);var t=no(Xa.current),n=ce(t,e.type);t!==n&&(Ti(eo,e),Ti(Xa,n))}function oo(e){eo.current===e&&(Ei(Xa),Ei(eo))}var so=Si(0);function co(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uo=[];function lo(){for(var e=0;e<uo.length;e++)uo[e]._workInProgressVersionPrimary=null;uo.length=0}var po=k.ReactCurrentDispatcher,ho=k.ReactCurrentBatchConfig,fo=0,vo=null,mo=null,go=null,yo=!1,bo=!1,ko=0,_o=0;function wo(){throw Error(a(321))}function xo(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function So(e,t,n,r,i,o){if(fo=o,vo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,po.current=null===e||null===e.memoizedState?ss:cs,e=n(r,i),bo){o=0;do{if(bo=!1,ko=0,25<=o)throw Error(a(301));o+=1,go=mo=null,t.updateQueue=null,po.current=us,e=n(r,i)}while(bo)}if(po.current=os,t=null!==mo&&null!==mo.next,fo=0,go=mo=vo=null,yo=!1,t)throw Error(a(300));return e}function Eo(){var e=0!==ko;return ko=0,e}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===go?vo.memoizedState=go=e:go=go.next=e,go}function Po(){if(null===mo){var e=vo.alternate;e=null!==e?e.memoizedState:null}else e=mo.next;var t=null===go?vo.memoizedState:go.next;if(null!==t)go=t,mo=e;else{if(null===e)throw Error(a(310));e={memoizedState:(mo=e).memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},null===go?vo.memoizedState=go=e:go=go.next=e}return go}function Co(e,t){return"function"===typeof t?t(e):t}function Ro(e){var t=Po(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=mo,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(null!==i){o=i.next,r=r.baseState;var c=s=null,u=null,l=o;do{var d=l.lane;if((fo&d)===d)null!==u&&(u=u.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),r=l.hasEagerState?l.eagerState:e(r,l.action);else{var p={lane:d,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};null===u?(c=u=p,s=r):u=u.next=p,vo.lanes|=d,Nc|=d}l=l.next}while(null!==l&&l!==o);null===u?s=r:u.next=c,sr(r,t.memoizedState)||(ks=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{o=i.lane,vo.lanes|=o,Nc|=o,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Zo(e){var t=Po(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{o=e(o,s.action),s=s.next}while(s!==i);sr(o,t.memoizedState)||(ks=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(){}function Ao(e,t){var n=vo,r=Po(),i=t(),o=!sr(r.memoizedState,i);if(o&&(r.memoizedState=i,ks=!0),r=r.queue,Ho(Lo.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==go&&1&go.memoizedState.tag){if(n.flags|=2048,Bo(9,Oo.bind(null,n,r,i,t),void 0,null),null===Zc)throw Error(a(349));0!==(30&fo)||Io(n,t,i)}return i}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=vo.updateQueue)?(t={lastEffect:null,stores:null},vo.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Oo(e,t,n,r){t.value=n,t.getSnapshot=r,Do(t)&&No(e)}function Lo(e,t,n){return n((function(){Do(t)&&No(e)}))}function Do(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch(r){return!0}}function No(e){var t=Ra(e,1);null!==t&&ru(t,e,1,-1)}function jo(e){var t=To();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Co,lastRenderedState:e},t.queue=e,e=e.dispatch=ns.bind(null,vo,e),[t.memoizedState,e]}function Bo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=vo.updateQueue)?(t={lastEffect:null,stores:null},vo.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Uo(){return Po().memoizedState}function Vo(e,t,n,r){var i=To();vo.flags|=e,i.memoizedState=Bo(1|t,n,void 0,void 0===r?null:r)}function Fo(e,t,n,r){var i=Po();r=void 0===r?null:r;var a=void 0;if(null!==mo){var o=mo.memoizedState;if(a=o.destroy,null!==r&&xo(r,o.deps))return void(i.memoizedState=Bo(t,n,a,r))}vo.flags|=e,i.memoizedState=Bo(1|t,n,a,r)}function zo(e,t){return Vo(8390656,8,e,t)}function Ho(e,t){return Fo(2048,8,e,t)}function qo(e,t){return Fo(4,2,e,t)}function Go(e,t){return Fo(4,4,e,t)}function Wo(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Jo(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Fo(4,4,Wo.bind(null,t,e),n)}function $o(){}function Ko(e,t){var n=Po();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qo(e,t){var n=Po();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&xo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Yo(e,t,n){return 0===(21&fo)?(e.baseState&&(e.baseState=!1,ks=!0),e.memoizedState=n):(sr(n,t)||(n=vt(),vo.lanes|=n,Nc|=n,e.baseState=!0),t)}function Xo(e,t){var n=bt;bt=0!==n&&4>n?n:4,e(!0);var r=ho.transition;ho.transition={};try{e(!1),t()}finally{bt=n,ho.transition=r}}function es(){return Po().memoizedState}function ts(e,t,n){var r=nu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rs(e))is(t,n);else if(null!==(n=Ca(e,t,n,r))){ru(n,e,r,tu()),as(n,t,r)}}function ns(e,t,n){var r=nu(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rs(e))is(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,sr(s,o)){var c=t.interleaved;return null===c?(i.next=i,Pa(t)):(i.next=c.next,c.next=i),void(t.interleaved=i)}}catch(u){}null!==(n=Ca(e,t,i,r))&&(ru(n,e,r,i=tu()),as(n,t,r))}}function rs(e){var t=e.alternate;return e===vo||null!==t&&t===vo}function is(e,t){bo=yo=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function as(e,t,n){if(0!==(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,yt(e,n)}}var os={readContext:Ea,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useInsertionEffect:wo,useLayoutEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useMutableSource:wo,useSyncExternalStore:wo,useId:wo,unstable_isNewReconciler:!1},ss={readContext:Ea,useCallback:function(e,t){return To().memoizedState=[e,void 0===t?null:t],e},useContext:Ea,useEffect:zo,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Vo(4194308,4,Wo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vo(4,2,e,t)},useMemo:function(e,t){var n=To();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=To();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ts.bind(null,vo,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},To().memoizedState=e},useState:jo,useDebugValue:$o,useDeferredValue:function(e){return To().memoizedState=e},useTransition:function(){var e=jo(!1),t=e[0];return e=Xo.bind(null,e[1]),To().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=vo,i=To();if(ia){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===Zc)throw Error(a(349));0!==(30&fo)||Io(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,zo(Lo.bind(null,r,o,e),[e]),r.flags|=2048,Bo(9,Oo.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=To(),t=Zc.identifierPrefix;if(ia){var n=Qi;t=":"+t+"R"+(n=(Ki&~(1<<32-ot(Ki)-1)).toString(32)+n),0<(n=ko++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=_o++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},cs={readContext:Ea,useCallback:Ko,useContext:Ea,useEffect:Ho,useImperativeHandle:Jo,useInsertionEffect:qo,useLayoutEffect:Go,useMemo:Qo,useReducer:Ro,useRef:Uo,useState:function(){return Ro(Co)},useDebugValue:$o,useDeferredValue:function(e){return Yo(Po(),mo.memoizedState,e)},useTransition:function(){return[Ro(Co)[0],Po().memoizedState]},useMutableSource:Mo,useSyncExternalStore:Ao,useId:es,unstable_isNewReconciler:!1},us={readContext:Ea,useCallback:Ko,useContext:Ea,useEffect:Ho,useImperativeHandle:Jo,useInsertionEffect:qo,useLayoutEffect:Go,useMemo:Qo,useReducer:Zo,useRef:Uo,useState:function(){return Zo(Co)},useDebugValue:$o,useDeferredValue:function(e){var t=Po();return null===mo?t.memoizedState=e:Yo(t,mo.memoizedState,e)},useTransition:function(){return[Zo(Co)[0],Po().memoizedState]},useMutableSource:Mo,useSyncExternalStore:Ao,useId:es,unstable_isNewReconciler:!1};function ls(e,t){try{var n="",r=t;do{n+=V(r),r=r.return}while(r);var i=n}catch(a){i="\nError generating stack: "+a.message+"\n"+a.stack}return{value:e,source:t,stack:i,digest:null}}function ds(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ps(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}var hs="function"===typeof WeakMap?WeakMap:Map;function fs(e,t,n){(n=Ia(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qc||(qc=!0,Gc=r),ps(0,t)},n}function vs(e,t,n){(n=Ia(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ps(0,t)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){ps(0,t),"function"!==typeof r&&(null===Wc?Wc=new Set([this]):Wc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ms(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new hs;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Tu.bind(null,e,t,n),t.then(e,e))}function gs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ys(e,t,n,r,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ia(-1,1)).tag=2,Oa(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var bs=k.ReactCurrentOwner,ks=!1;function _s(e,t,n,r){t.child=null===e?Qa(t,null,n,r):Ka(t,e.child,n,r)}function ws(e,t,n,r,i){n=n.render;var a=t.ref;return Sa(t,i),r=So(e,t,n,r,a,i),n=Eo(),null===e||ks?(ia&&n&&ea(t),t.flags|=1,_s(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qs(e,t,i))}function xs(e,t,n,r,i){if(null===e){var a=n.type;return"function"!==typeof a||Iu(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Lu(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Ss(e,t,a,r,i))}if(a=e.child,0===(e.lanes&i)){var o=a.memoizedProps;if((n=null!==(n=n.compare)?n:cr)(o,r)&&e.ref===t.ref)return qs(e,t,i)}return t.flags|=1,(e=Ou(a,r)).ref=t.ref,e.return=t,t.child=e}function Ss(e,t,n,r,i){if(null!==e){var a=e.memoizedProps;if(cr(a,r)&&e.ref===t.ref){if(ks=!1,t.pendingProps=r=a,0===(e.lanes&i))return t.lanes=e.lanes,qs(e,t,i);0!==(131072&e.flags)&&(ks=!0)}}return Ps(e,t,n,r,i)}function Es(e,t,n){var r=t.pendingProps,i=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ti(Oc,Ic),Ic|=n;else{if(0===(1073741824&n))return e=null!==a?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ti(Oc,Ic),Ic|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:n,Ti(Oc,Ic),Ic|=r}else null!==a?(r=a.baseLanes|n,t.memoizedState=null):r=n,Ti(Oc,Ic),Ic|=r;return _s(e,t,i,n),t.child}function Ts(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ps(e,t,n,r,i){var a=Ai(n)?Zi:Ci.current;return a=Mi(t,a),Sa(t,i),n=So(e,t,n,r,a,i),r=Eo(),null===e||ks?(ia&&r&&ea(t),t.flags|=1,_s(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qs(e,t,i))}function Cs(e,t,n,r,i){if(Ai(n)){var a=!0;Di(t)}else a=!1;if(Sa(t,i),null===t.stateNode)Hs(e,t),za(t,n,r),qa(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,u=n.contextType;"object"===typeof u&&null!==u?u=Ea(u):u=Mi(t,u=Ai(n)?Zi:Ci.current);var l=n.getDerivedStateFromProps,d="function"===typeof l||"function"===typeof o.getSnapshotBeforeUpdate;d||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||c!==u)&&Ha(t,o,r,u),Za=!1;var p=t.memoizedState;o.state=p,Na(t,r,o,i),c=t.memoizedState,s!==r||p!==c||Ri.current||Za?("function"===typeof l&&(Ua(t,n,l,r),c=t.memoizedState),(s=Za||Fa(t,n,s,r,p,c,u))?(d||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.flags|=4194308)):("function"===typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=s):("function"===typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Aa(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:ma(t.type,s),o.props=u,d=t.pendingProps,p=o.context,"object"===typeof(c=n.contextType)&&null!==c?c=Ea(c):c=Mi(t,c=Ai(n)?Zi:Ci.current);var h=n.getDerivedStateFromProps;(l="function"===typeof h||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==d||p!==c)&&Ha(t,o,r,c),Za=!1,p=t.memoizedState,o.state=p,Na(t,r,o,i);var f=t.memoizedState;s!==d||p!==f||Ri.current||Za?("function"===typeof h&&(Ua(t,n,h,r),f=t.memoizedState),(u=Za||Fa(t,n,u,r,p,f,c)||!1)?(l||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,c),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,c)),"function"===typeof o.componentDidUpdate&&(t.flags|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=c,r=u):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Rs(e,t,n,r,a,i)}function Rs(e,t,n,r,i,a){Ts(e,t);var o=0!==(128&t.flags);if(!r&&!o)return i&&Ni(t,n,!1),qs(e,t,a);r=t.stateNode,bs.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=Ka(t,e.child,null,a),t.child=Ka(t,null,s,a)):_s(e,t,s,a),t.memoizedState=r.state,i&&Ni(t,n,!0),t.child}function Zs(e){var t=e.stateNode;t.pendingContext?Oi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Oi(0,t.context,!1),ro(e,t.containerInfo)}function Ms(e,t,n,r,i){return ha(),fa(i),t.flags|=256,_s(e,t,n,r),t.child}var As,Is,Os,Ls,Ds={dehydrated:null,treeContext:null,retryLane:0};function Ns(e){return{baseLanes:e,cachePool:null,transitions:null}}function js(e,t,n){var r,i=t.pendingProps,o=so.current,s=!1,c=0!==(128&t.flags);if((r=c)||(r=(null===e||null!==e.memoizedState)&&0!==(2&o)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Ti(so,1&o),null===e)return ua(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(c=i.children,e=i.fallback,s?(i=t.mode,s=t.child,c={mode:"hidden",children:c},0===(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=c):s=Nu(c,i,0,null),e=Du(e,i,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ns(n),t.memoizedState=Ds,e):Bs(t,c));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,i,o,s){if(n)return 256&t.flags?(t.flags&=-257,Us(e,t,s,r=ds(Error(a(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Nu({mode:"visible",children:r.children},i,0,null),(o=Du(o,i,s,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,0!==(1&t.mode)&&Ka(t,e.child,null,s),t.child.memoizedState=Ns(s),t.memoizedState=Ds,o);if(0===(1&t.mode))return Us(e,t,s,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var c=r.dgst;return r=c,Us(e,t,s,r=ds(o=Error(a(419)),r,void 0))}if(c=0!==(s&e.childLanes),ks||c){if(null!==(r=Zc)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(r.suspendedLanes|s))?0:i)&&i!==o.retryLane&&(o.retryLane=i,Ra(e,i),ru(r,e,i,-1))}return mu(),Us(e,t,s,r=ds(Error(a(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Cu.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ra=ui(i.nextSibling),na=t,ia=!0,aa=null,null!==e&&(Wi[Ji++]=Ki,Wi[Ji++]=Qi,Wi[Ji++]=$i,Ki=e.id,Qi=e.overflow,$i=t),t=Bs(t,r.children),t.flags|=4096,t)}(e,t,c,i,r,o,n);if(s){s=i.fallback,c=t.mode,r=(o=e.child).sibling;var u={mode:"hidden",children:i.children};return 0===(1&c)&&t.child!==o?((i=t.child).childLanes=0,i.pendingProps=u,t.deletions=null):(i=Ou(o,u)).subtreeFlags=14680064&o.subtreeFlags,null!==r?s=Ou(r,s):(s=Du(s,c,n,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,c=null===(c=e.child.memoizedState)?Ns(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},s.memoizedState=c,s.childLanes=e.childLanes&~n,t.memoizedState=Ds,i}return e=(s=e.child).sibling,i=Ou(s,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Bs(e,t){return(t=Nu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Us(e,t,n,r){return null!==r&&fa(r),Ka(t,e.child,null,n),(e=Bs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Vs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),xa(e.return,t,n)}function Fs(e,t,n,r,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function zs(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(_s(e,t,r.children,n),0!==(2&(r=so.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Vs(e,n,t);else if(19===e.tag)Vs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ti(so,r),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===co(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Fs(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===co(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Fs(t,!0,n,null,a);break;case"together":Fs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Hs(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Nc|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Ou(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Ou(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Gs(e,t){if(!ia)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ws(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Js(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ws(t),null;case 1:case 17:return Ai(t.type)&&Ii(),Ws(t),null;case 3:return r=t.stateNode,io(),Ei(Ri),Ei(Ci),lo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(da(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==aa&&(su(aa),aa=null))),Is(e,t),Ws(t),null;case 5:oo(t);var i=no(to.current);if(n=t.type,null!==e&&null!=t.stateNode)Os(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(a(166));return Ws(t),null}if(e=no(Xa.current),da(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[pi]=t,r[hi]=o,e=0!==(1&t.mode),n){case"dialog":Br("cancel",r),Br("close",r);break;case"iframe":case"object":case"embed":Br("load",r);break;case"video":case"audio":for(i=0;i<Lr.length;i++)Br(Lr[i],r);break;case"source":Br("error",r);break;case"img":case"image":case"link":Br("error",r),Br("load",r);break;case"details":Br("toggle",r);break;case"input":K(r,o),Br("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Br("invalid",r);break;case"textarea":ie(r,o),Br("invalid",r)}for(var c in ye(n,o),i=null,o)if(o.hasOwnProperty(c)){var u=o[c];"children"===c?"string"===typeof u?r.textContent!==u&&(!0!==o.suppressHydrationWarning&&Yr(r.textContent,u,e),i=["children",u]):"number"===typeof u&&r.textContent!==""+u&&(!0!==o.suppressHydrationWarning&&Yr(r.textContent,u,e),i=["children",""+u]):s.hasOwnProperty(c)&&null!=u&&"onScroll"===c&&Br("scroll",r)}switch(n){case"input":G(r),X(r,o,!0);break;case"textarea":G(r),oe(r);break;case"select":case"option":break;default:"function"===typeof o.onClick&&(r.onclick=Xr)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{c=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[pi]=t,e[hi]=r,As(e,t,!1,!1),t.stateNode=e;e:{switch(c=be(n,r),n){case"dialog":Br("cancel",e),Br("close",e),i=r;break;case"iframe":case"object":case"embed":Br("load",e),i=r;break;case"video":case"audio":for(i=0;i<Lr.length;i++)Br(Lr[i],e);i=r;break;case"source":Br("error",e),i=r;break;case"img":case"image":case"link":Br("error",e),Br("load",e),i=r;break;case"details":Br("toggle",e),i=r;break;case"input":K(e,r),i=$(e,r),Br("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=N({},r,{value:void 0}),Br("invalid",e);break;case"textarea":ie(e,r),i=re(e,r),Br("invalid",e)}for(o in ye(n,i),u=i)if(u.hasOwnProperty(o)){var l=u[o];"style"===o?me(e,l):"dangerouslySetInnerHTML"===o?null!=(l=l?l.__html:void 0)&&de(e,l):"children"===o?"string"===typeof l?("textarea"!==n||""!==l)&&pe(e,l):"number"===typeof l&&pe(e,""+l):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(s.hasOwnProperty(o)?null!=l&&"onScroll"===o&&Br("scroll",e):null!=l&&b(e,o,l,c))}switch(n){case"input":G(e),X(e,r,!1);break;case"textarea":G(e),oe(e);break;case"option":null!=r.value&&e.setAttribute("value",""+H(r.value));break;case"select":e.multiple=!!r.multiple,null!=(o=r.value)?ne(e,!!r.multiple,o,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=Xr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ws(t),null;case 6:if(e&&null!=t.stateNode)Ls(e,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(a(166));if(n=no(to.current),no(Xa.current),da(t)){if(r=t.stateNode,n=t.memoizedProps,r[pi]=t,(o=r.nodeValue!==n)&&null!==(e=na))switch(e.tag){case 3:Yr(r.nodeValue,n,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Yr(r.nodeValue,n,0!==(1&e.mode))}o&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[pi]=t,t.stateNode=r}return Ws(t),null;case 13:if(Ei(so),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ia&&null!==ra&&0!==(1&t.mode)&&0===(128&t.flags))pa(),ha(),t.flags|=98560,o=!1;else if(o=da(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(a(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(a(317));o[pi]=t}else ha(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ws(t),o=!1}else null!==aa&&(su(aa),aa=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&so.current)?0===Lc&&(Lc=3):mu())),null!==t.updateQueue&&(t.flags|=4),Ws(t),null);case 4:return io(),Is(e,t),null===e&&Fr(t.stateNode.containerInfo),Ws(t),null;case 10:return wa(t.type._context),Ws(t),null;case 19:if(Ei(so),null===(o=t.memoizedState))return Ws(t),null;if(r=0!==(128&t.flags),null===(c=o.rendering))if(r)Gs(o,!1);else{if(0!==Lc||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(c=co(e))){for(t.flags|=128,Gs(o,!1),null!==(r=c.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(o=n).flags&=14680066,null===(c=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ti(so,1&so.current|2),t.child}e=e.sibling}null!==o.tail&&Qe()>zc&&(t.flags|=128,r=!0,Gs(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=co(c))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Gs(o,!0),null===o.tail&&"hidden"===o.tailMode&&!c.alternate&&!ia)return Ws(t),null}else 2*Qe()-o.renderingStartTime>zc&&1073741824!==n&&(t.flags|=128,r=!0,Gs(o,!1),t.lanes=4194304);o.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=o.last)?n.sibling=c:t.child=c,o.last=c)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qe(),t.sibling=null,n=so.current,Ti(so,r?1&n|2:1&n),t):(Ws(t),null);case 22:case 23:return pu(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!==(1&t.mode)?0!==(1073741824&Ic)&&(Ws(t),6&t.subtreeFlags&&(t.flags|=8192)):Ws(t),null;case 24:case 25:return null}throw Error(a(156,t.tag))}function $s(e,t){switch(ta(t),t.tag){case 1:return Ai(t.type)&&Ii(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return io(),Ei(Ri),Ei(Ci),lo(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return oo(t),null;case 13:if(Ei(so),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));ha()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ei(so),null;case 4:return io(),null;case 10:return wa(t.type._context),null;case 22:case 23:return pu(),null;default:return null}}As=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Is=function(){},Os=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,no(Xa.current);var a,o=null;switch(n){case"input":i=$(e,i),r=$(e,r),o=[];break;case"select":i=N({},i,{value:void 0}),r=N({},r,{value:void 0}),o=[];break;case"textarea":i=re(e,i),r=re(e,r),o=[];break;default:"function"!==typeof i.onClick&&"function"===typeof r.onClick&&(e.onclick=Xr)}for(l in ye(n,r),n=null,i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if("style"===l){var c=i[l];for(a in c)c.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(s.hasOwnProperty(l)?o||(o=[]):(o=o||[]).push(l,null));for(l in r){var u=r[l];if(c=null!=i?i[l]:void 0,r.hasOwnProperty(l)&&u!==c&&(null!=u||null!=c))if("style"===l)if(c){for(a in c)!c.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&c[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(o||(o=[]),o.push(l,n)),n=u;else"dangerouslySetInnerHTML"===l?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(o=o||[]).push(l,u)):"children"===l?"string"!==typeof u&&"number"!==typeof u||(o=o||[]).push(l,""+u):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(s.hasOwnProperty(l)?(null!=u&&"onScroll"===l&&Br("scroll",e),o||c===u||(o=[])):(o=o||[]).push(l,u))}n&&(o=o||[]).push("style",n);var l=o;(t.updateQueue=l)&&(t.flags|=4)}},Ls=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ks=!1,Qs=!1,Ys="function"===typeof WeakSet?WeakSet:Set,Xs=null;function ec(e,t){var n=e.ref;if(null!==n)if("function"===typeof n)try{n(null)}catch(r){Eu(e,t,r)}else n.current=null}function tc(e,t,n){try{n()}catch(r){Eu(e,t,r)}}var nc=!1;function rc(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,void 0!==a&&tc(t,n,a)}i=i.next}while(i!==r)}}function ic(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ac(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"===typeof t?t(e):t.current=e}}function oc(e){var t=e.alternate;null!==t&&(e.alternate=null,oc(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[pi],delete t[hi],delete t[vi],delete t[mi],delete t[gi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sc(e){return 5===e.tag||3===e.tag||4===e.tag}function cc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||sc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function uc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=Xr));else if(4!==r&&null!==(e=e.child))for(uc(e,t,n),e=e.sibling;null!==e;)uc(e,t,n),e=e.sibling}function lc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(lc(e,t,n),e=e.sibling;null!==e;)lc(e,t,n),e=e.sibling}var dc=null,pc=!1;function hc(e,t,n){for(n=n.child;null!==n;)fc(e,t,n),n=n.sibling}function fc(e,t,n){if(at&&"function"===typeof at.onCommitFiberUnmount)try{at.onCommitFiberUnmount(it,n)}catch(s){}switch(n.tag){case 5:Qs||ec(n,t);case 6:var r=dc,i=pc;dc=null,hc(e,t,n),pc=i,null!==(dc=r)&&(pc?(e=dc,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):dc.removeChild(n.stateNode));break;case 18:null!==dc&&(pc?(e=dc,n=n.stateNode,8===e.nodeType?ci(e.parentNode,n):1===e.nodeType&&ci(e,n),Ft(e)):ci(dc,n.stateNode));break;case 4:r=dc,i=pc,dc=n.stateNode.containerInfo,pc=!0,hc(e,t,n),dc=r,pc=i;break;case 0:case 11:case 14:case 15:if(!Qs&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,void 0!==o&&(0!==(2&a)||0!==(4&a))&&tc(n,t,o),i=i.next}while(i!==r)}hc(e,t,n);break;case 1:if(!Qs&&(ec(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Eu(n,t,s)}hc(e,t,n);break;case 21:hc(e,t,n);break;case 22:1&n.mode?(Qs=(r=Qs)||null!==n.memoizedState,hc(e,t,n),Qs=r):hc(e,t,n);break;default:hc(e,t,n)}}function vc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ys),t.forEach((function(t){var r=Ru.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function mc(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,c=s;e:for(;null!==c;){switch(c.tag){case 5:dc=c.stateNode,pc=!1;break e;case 3:case 4:dc=c.stateNode.containerInfo,pc=!0;break e}c=c.return}if(null===dc)throw Error(a(160));fc(o,s,i),dc=null,pc=!1;var u=i.alternate;null!==u&&(u.return=null),i.return=null}catch(l){Eu(i,t,l)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gc(t,e),t=t.sibling}function gc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mc(t,e),yc(e),4&r){try{rc(3,e,e.return),ic(3,e)}catch(m){Eu(e,e.return,m)}try{rc(5,e,e.return)}catch(m){Eu(e,e.return,m)}}break;case 1:mc(t,e),yc(e),512&r&&null!==n&&ec(n,n.return);break;case 5:if(mc(t,e),yc(e),512&r&&null!==n&&ec(n,n.return),32&e.flags){var i=e.stateNode;try{pe(i,"")}catch(m){Eu(e,e.return,m)}}if(4&r&&null!=(i=e.stateNode)){var o=e.memoizedProps,s=null!==n?n.memoizedProps:o,c=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===c&&"radio"===o.type&&null!=o.name&&Q(i,o),be(c,s);var l=be(c,o);for(s=0;s<u.length;s+=2){var d=u[s],p=u[s+1];"style"===d?me(i,p):"dangerouslySetInnerHTML"===d?de(i,p):"children"===d?pe(i,p):b(i,d,p,l)}switch(c){case"input":Y(i,o);break;case"textarea":ae(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var f=o.value;null!=f?ne(i,!!o.multiple,f,!1):h!==!!o.multiple&&(null!=o.defaultValue?ne(i,!!o.multiple,o.defaultValue,!0):ne(i,!!o.multiple,o.multiple?[]:"",!1))}i[hi]=o}catch(m){Eu(e,e.return,m)}}break;case 6:if(mc(t,e),yc(e),4&r){if(null===e.stateNode)throw Error(a(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){Eu(e,e.return,m)}}break;case 3:if(mc(t,e),yc(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Ft(t.containerInfo)}catch(m){Eu(e,e.return,m)}break;case 4:default:mc(t,e),yc(e);break;case 13:mc(t,e),yc(e),8192&(i=e.child).flags&&(o=null!==i.memoizedState,i.stateNode.isHidden=o,!o||null!==i.alternate&&null!==i.alternate.memoizedState||(Fc=Qe())),4&r&&vc(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Qs=(l=Qs)||d,mc(t,e),Qs=l):mc(t,e),yc(e),8192&r){if(l=null!==e.memoizedState,(e.stateNode.isHidden=l)&&!d&&0!==(1&e.mode))for(Xs=e,d=e.child;null!==d;){for(p=Xs=d;null!==Xs;){switch(f=(h=Xs).child,h.tag){case 0:case 11:case 14:case 15:rc(4,h,h.return);break;case 1:ec(h,h.return);var v=h.stateNode;if("function"===typeof v.componentWillUnmount){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(m){Eu(r,n,m)}}break;case 5:ec(h,h.return);break;case 22:if(null!==h.memoizedState){wc(p);continue}}null!==f?(f.return=h,Xs=f):wc(p)}d=d.sibling}e:for(d=null,p=e;;){if(5===p.tag){if(null===d){d=p;try{i=p.stateNode,l?"function"===typeof(o=i.style).setProperty?o.setProperty("display","none","important"):o.display="none":(c=p.stateNode,s=void 0!==(u=p.memoizedProps.style)&&null!==u&&u.hasOwnProperty("display")?u.display:null,c.style.display=ve("display",s))}catch(m){Eu(e,e.return,m)}}}else if(6===p.tag){if(null===d)try{p.stateNode.nodeValue=l?"":p.memoizedProps}catch(m){Eu(e,e.return,m)}}else if((22!==p.tag&&23!==p.tag||null===p.memoizedState||p===e)&&null!==p.child){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;null===p.sibling;){if(null===p.return||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:mc(t,e),yc(e),4&r&&vc(e);case 21:}}function yc(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(sc(n)){var r=n;break e}n=n.return}throw Error(a(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(pe(i,""),r.flags&=-33),lc(e,cc(e),i);break;case 3:case 4:var o=r.stateNode.containerInfo;uc(e,cc(e),o);break;default:throw Error(a(161))}}catch(s){Eu(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bc(e,t,n){Xs=e,kc(e,t,n)}function kc(e,t,n){for(var r=0!==(1&e.mode);null!==Xs;){var i=Xs,a=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||Ks;if(!o){var s=i.alternate,c=null!==s&&null!==s.memoizedState||Qs;s=Ks;var u=Qs;if(Ks=o,(Qs=c)&&!u)for(Xs=i;null!==Xs;)c=(o=Xs).child,22===o.tag&&null!==o.memoizedState?xc(i):null!==c?(c.return=o,Xs=c):xc(i);for(;null!==a;)Xs=a,kc(a,t,n),a=a.sibling;Xs=i,Ks=s,Qs=u}_c(e)}else 0!==(8772&i.subtreeFlags)&&null!==a?(a.return=i,Xs=a):_c(e)}}function _c(e){for(;null!==Xs;){var t=Xs;if(0!==(8772&t.flags)){var n=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Qs||ic(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Qs)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ma(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&ja(t,o,r);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}ja(t,s,n)}break;case 5:var c=t.stateNode;if(null===n&&4&t.flags){n=c;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var l=t.alternate;if(null!==l){var d=l.memoizedState;if(null!==d){var p=d.dehydrated;null!==p&&Ft(p)}}}break;default:throw Error(a(163))}Qs||512&t.flags&&ac(t)}catch(h){Eu(t,t.return,h)}}if(t===e){Xs=null;break}if(null!==(n=t.sibling)){n.return=t.return,Xs=n;break}Xs=t.return}}function wc(e){for(;null!==Xs;){var t=Xs;if(t===e){Xs=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Xs=n;break}Xs=t.return}}function xc(e){for(;null!==Xs;){var t=Xs;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ic(4,t)}catch(c){Eu(t,n,c)}break;case 1:var r=t.stateNode;if("function"===typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(c){Eu(t,i,c)}}var a=t.return;try{ac(t)}catch(c){Eu(t,a,c)}break;case 5:var o=t.return;try{ac(t)}catch(c){Eu(t,o,c)}}}catch(c){Eu(t,t.return,c)}if(t===e){Xs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Xs=s;break}Xs=t.return}}var Sc,Ec=Math.ceil,Tc=k.ReactCurrentDispatcher,Pc=k.ReactCurrentOwner,Cc=k.ReactCurrentBatchConfig,Rc=0,Zc=null,Mc=null,Ac=0,Ic=0,Oc=Si(0),Lc=0,Dc=null,Nc=0,jc=0,Bc=0,Uc=null,Vc=null,Fc=0,zc=1/0,Hc=null,qc=!1,Gc=null,Wc=null,Jc=!1,$c=null,Kc=0,Qc=0,Yc=null,Xc=-1,eu=0;function tu(){return 0!==(6&Rc)?Qe():-1!==Xc?Xc:Xc=Qe()}function nu(e){return 0===(1&e.mode)?1:0!==(2&Rc)&&0!==Ac?Ac&-Ac:null!==va.transition?(0===eu&&(eu=vt()),eu):0!==(e=bt)?e:e=void 0===(e=window.event)?16:Kt(e.type)}function ru(e,t,n,r){if(50<Qc)throw Qc=0,Yc=null,Error(a(185));gt(e,n,r),0!==(2&Rc)&&e===Zc||(e===Zc&&(0===(2&Rc)&&(jc|=n),4===Lc&&cu(e,Ac)),iu(e,r),1===n&&0===Rc&&0===(1&t.mode)&&(zc=Qe()+500,Bi&&Fi()))}function iu(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ot(a),s=1<<o,c=i[o];-1===c?0!==(s&n)&&0===(s&r)||(i[o]=ht(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}(e,t);var r=pt(e,e===Zc?Ac:0);if(0===r)null!==n&&Je(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Je(n),1===t)0===e.tag?function(e){Bi=!0,Vi(e)}(uu.bind(null,e)):Vi(uu.bind(null,e)),oi((function(){0===(6&Rc)&&Fi()})),n=null;else{switch(kt(r)){case 1:n=Xe;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Zu(n,au.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function au(e,t){if(Xc=-1,eu=0,0!==(6&Rc))throw Error(a(327));var n=e.callbackNode;if(xu()&&e.callbackNode!==n)return null;var r=pt(e,e===Zc?Ac:0);if(0===r)return null;if(0!==(30&r)||0!==(r&e.expiredLanes)||t)t=gu(e,r);else{t=r;var i=Rc;Rc|=2;var o=vu();for(Zc===e&&Ac===t||(Hc=null,zc=Qe()+500,hu(e,t));;)try{bu();break}catch(c){fu(e,c)}_a(),Tc.current=o,Rc=i,null!==Mc?t=0:(Zc=null,Ac=0,t=Lc)}if(0!==t){if(2===t&&(0!==(i=ft(e))&&(r=i,t=ou(e,i))),1===t)throw n=Dc,hu(e,0),cu(e,r),iu(e,Qe()),n;if(6===t)cu(e,r);else{if(i=e.current.alternate,0===(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!sr(a(),i))return!1}catch(s){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=gu(e,r))&&(0!==(o=ft(e))&&(r=o,t=ou(e,o))),1===t))throw n=Dc,hu(e,0),cu(e,r),iu(e,Qe()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(a(345));case 2:case 5:wu(e,Vc,Hc);break;case 3:if(cu(e,r),(130023424&r)===r&&10<(t=Fc+500-Qe())){if(0!==pt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){tu(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ri(wu.bind(null,e,Vc,Hc),t);break}wu(e,Vc,Hc);break;case 4:if(cu(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ot(r);o=1<<s,(s=t[s])>i&&(i=s),r&=~o}if(r=i,10<(r=(120>(r=Qe()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ec(r/1960))-r)){e.timeoutHandle=ri(wu.bind(null,e,Vc,Hc),r);break}wu(e,Vc,Hc);break;default:throw Error(a(329))}}}return iu(e,Qe()),e.callbackNode===n?au.bind(null,e):null}function ou(e,t){var n=Uc;return e.current.memoizedState.isDehydrated&&(hu(e,t).flags|=256),2!==(e=gu(e,t))&&(t=Vc,Vc=n,null!==t&&su(t)),e}function su(e){null===Vc?Vc=e:Vc.push.apply(Vc,e)}function cu(e,t){for(t&=~Bc,t&=~jc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ot(t),r=1<<n;e[n]=-1,t&=~r}}function uu(e){if(0!==(6&Rc))throw Error(a(327));xu();var t=pt(e,0);if(0===(1&t))return iu(e,Qe()),null;var n=gu(e,t);if(0!==e.tag&&2===n){var r=ft(e);0!==r&&(t=r,n=ou(e,r))}if(1===n)throw n=Dc,hu(e,0),cu(e,t),iu(e,Qe()),n;if(6===n)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wu(e,Vc,Hc),iu(e,Qe()),null}function lu(e,t){var n=Rc;Rc|=1;try{return e(t)}finally{0===(Rc=n)&&(zc=Qe()+500,Bi&&Fi())}}function du(e){null!==$c&&0===$c.tag&&0===(6&Rc)&&xu();var t=Rc;Rc|=1;var n=Cc.transition,r=bt;try{if(Cc.transition=null,bt=1,e)return e()}finally{bt=r,Cc.transition=n,0===(6&(Rc=t))&&Fi()}}function pu(){Ic=Oc.current,Ei(Oc)}function hu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ii(n)),null!==Mc)for(n=Mc.return;null!==n;){var r=n;switch(ta(r),r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&Ii();break;case 3:io(),Ei(Ri),Ei(Ci),lo();break;case 5:oo(r);break;case 4:io();break;case 13:case 19:Ei(so);break;case 10:wa(r.type._context);break;case 22:case 23:pu()}n=n.return}if(Zc=e,Mc=e=Ou(e.current,null),Ac=Ic=t,Lc=0,Dc=null,Bc=jc=Nc=0,Vc=Uc=null,null!==Ta){for(t=0;t<Ta.length;t++)if(null!==(r=(n=Ta[t]).interleaved)){n.interleaved=null;var i=r.next,a=n.pending;if(null!==a){var o=a.next;a.next=i,r.next=o}n.pending=r}Ta=null}return e}function fu(e,t){for(;;){var n=Mc;try{if(_a(),po.current=os,yo){for(var r=vo.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}yo=!1}if(fo=0,go=mo=vo=null,bo=!1,ko=0,Pc.current=null,null===n||null===n.return){Lc=1,Dc=t,Mc=null;break}e:{var o=e,s=n.return,c=n,u=t;if(t=Ac,c.flags|=32768,null!==u&&"object"===typeof u&&"function"===typeof u.then){var l=u,d=c,p=d.tag;if(0===(1&d.mode)&&(0===p||11===p||15===p)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=gs(s);if(null!==f){f.flags&=-257,ys(f,s,c,0,t),1&f.mode&&ms(o,l,t),u=l;var v=(t=f).updateQueue;if(null===v){var m=new Set;m.add(u),t.updateQueue=m}else v.add(u);break e}if(0===(1&t)){ms(o,l,t),mu();break e}u=Error(a(426))}else if(ia&&1&c.mode){var g=gs(s);if(null!==g){0===(65536&g.flags)&&(g.flags|=256),ys(g,s,c,0,t),fa(ls(u,c));break e}}o=u=ls(u,c),4!==Lc&&(Lc=2),null===Uc?Uc=[o]:Uc.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t,Da(o,fs(0,u,t));break e;case 1:c=u;var y=o.type,b=o.stateNode;if(0===(128&o.flags)&&("function"===typeof y.getDerivedStateFromError||null!==b&&"function"===typeof b.componentDidCatch&&(null===Wc||!Wc.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t,Da(o,vs(o,c,t));break e}}o=o.return}while(null!==o)}_u(n)}catch(k){t=k,Mc===n&&null!==n&&(Mc=n=n.return);continue}break}}function vu(){var e=Tc.current;return Tc.current=os,null===e?os:e}function mu(){0!==Lc&&3!==Lc&&2!==Lc||(Lc=4),null===Zc||0===(268435455&Nc)&&0===(268435455&jc)||cu(Zc,Ac)}function gu(e,t){var n=Rc;Rc|=2;var r=vu();for(Zc===e&&Ac===t||(Hc=null,hu(e,t));;)try{yu();break}catch(i){fu(e,i)}if(_a(),Rc=n,Tc.current=r,null!==Mc)throw Error(a(261));return Zc=null,Ac=0,Lc}function yu(){for(;null!==Mc;)ku(Mc)}function bu(){for(;null!==Mc&&!$e();)ku(Mc)}function ku(e){var t=Sc(e.alternate,e,Ic);e.memoizedProps=e.pendingProps,null===t?_u(e):Mc=t,Pc.current=null}function _u(e){var t=e;do{var n=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(n=Js(n,t,Ic)))return void(Mc=n)}else{if(null!==(n=$s(n,t)))return n.flags&=32767,void(Mc=n);if(null===e)return Lc=6,void(Mc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Mc=t);Mc=t=e}while(null!==t);0===Lc&&(Lc=5)}function wu(e,t,n){var r=bt,i=Cc.transition;try{Cc.transition=null,bt=1,function(e,t,n,r){do{xu()}while(null!==$c);if(0!==(6&Rc))throw Error(a(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-ot(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}(e,o),e===Zc&&(Mc=Zc=null,Ac=0),0===(2064&n.subtreeFlags)&&0===(2064&n.flags)||Jc||(Jc=!0,Zu(tt,(function(){return xu(),null}))),o=0!==(15990&n.flags),0!==(15990&n.subtreeFlags)||o){o=Cc.transition,Cc.transition=null;var s=bt;bt=1;var c=Rc;Rc|=4,Pc.current=null,function(e,t){if(ei=Ht,hr(e=pr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(_){n=null;break e}var s=0,c=-1,u=-1,l=0,d=0,p=e,h=null;t:for(;;){for(var f;p!==n||0!==i&&3!==p.nodeType||(c=s+i),p!==o||0!==r&&3!==p.nodeType||(u=s+r),3===p.nodeType&&(s+=p.nodeValue.length),null!==(f=p.firstChild);)h=p,p=f;for(;;){if(p===e)break t;if(h===n&&++l===i&&(c=s),h===o&&++d===r&&(u=s),null!==(f=p.nextSibling))break;h=(p=h).parentNode}p=f}n=-1===c||-1===u?null:{start:c,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ti={focusedElem:e,selectionRange:n},Ht=!1,Xs=t;null!==Xs;)if(e=(t=Xs).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Xs=e;else for(;null!==Xs;){t=Xs;try{var v=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==v){var m=v.memoizedProps,g=v.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:ma(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var k=t.stateNode.containerInfo;1===k.nodeType?k.textContent="":9===k.nodeType&&k.documentElement&&k.removeChild(k.documentElement);break;default:throw Error(a(163))}}catch(_){Eu(t,t.return,_)}if(null!==(e=t.sibling)){e.return=t.return,Xs=e;break}Xs=t.return}v=nc,nc=!1}(e,n),gc(n,e),fr(ti),Ht=!!ei,ti=ei=null,e.current=n,bc(n,e,i),Ke(),Rc=c,bt=s,Cc.transition=o}else e.current=n;if(Jc&&(Jc=!1,$c=e,Kc=i),o=e.pendingLanes,0===o&&(Wc=null),function(e){if(at&&"function"===typeof at.onCommitFiberRoot)try{at.onCommitFiberRoot(it,e,void 0,128===(128&e.current.flags))}catch(t){}}(n.stateNode),iu(e,Qe()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(qc)throw qc=!1,e=Gc,Gc=null,e;0!==(1&Kc)&&0!==e.tag&&xu(),o=e.pendingLanes,0!==(1&o)?e===Yc?Qc++:(Qc=0,Yc=e):Qc=0,Fi()}(e,t,n,r)}finally{Cc.transition=i,bt=r}return null}function xu(){if(null!==$c){var e=kt(Kc),t=Cc.transition,n=bt;try{if(Cc.transition=null,bt=16>e?16:e,null===$c)var r=!1;else{if(e=$c,$c=null,Kc=0,0!==(6&Rc))throw Error(a(331));var i=Rc;for(Rc|=4,Xs=e.current;null!==Xs;){var o=Xs,s=o.child;if(0!==(16&Xs.flags)){var c=o.deletions;if(null!==c){for(var u=0;u<c.length;u++){var l=c[u];for(Xs=l;null!==Xs;){var d=Xs;switch(d.tag){case 0:case 11:case 15:rc(8,d,o)}var p=d.child;if(null!==p)p.return=d,Xs=p;else for(;null!==Xs;){var h=(d=Xs).sibling,f=d.return;if(oc(d),d===l){Xs=null;break}if(null!==h){h.return=f,Xs=h;break}Xs=f}}}var v=o.alternate;if(null!==v){var m=v.child;if(null!==m){v.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}Xs=o}}if(0!==(2064&o.subtreeFlags)&&null!==s)s.return=o,Xs=s;else e:for(;null!==Xs;){if(0!==(2048&(o=Xs).flags))switch(o.tag){case 0:case 11:case 15:rc(9,o,o.return)}var y=o.sibling;if(null!==y){y.return=o.return,Xs=y;break e}Xs=o.return}}var b=e.current;for(Xs=b;null!==Xs;){var k=(s=Xs).child;if(0!==(2064&s.subtreeFlags)&&null!==k)k.return=s,Xs=k;else e:for(s=b;null!==Xs;){if(0!==(2048&(c=Xs).flags))try{switch(c.tag){case 0:case 11:case 15:ic(9,c)}}catch(w){Eu(c,c.return,w)}if(c===s){Xs=null;break e}var _=c.sibling;if(null!==_){_.return=c.return,Xs=_;break e}Xs=c.return}}if(Rc=i,Fi(),at&&"function"===typeof at.onPostCommitFiberRoot)try{at.onPostCommitFiberRoot(it,e)}catch(w){}r=!0}return r}finally{bt=n,Cc.transition=t}}return!1}function Su(e,t,n){e=Oa(e,t=fs(0,t=ls(n,t),1),1),t=tu(),null!==e&&(gt(e,1,t),iu(e,t))}function Eu(e,t,n){if(3===e.tag)Su(e,e,n);else for(;null!==t;){if(3===t.tag){Su(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Wc||!Wc.has(r))){t=Oa(t,e=vs(t,e=ls(n,e),1),1),e=tu(),null!==t&&(gt(t,1,e),iu(t,e));break}}t=t.return}}function Tu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=tu(),e.pingedLanes|=e.suspendedLanes&n,Zc===e&&(Ac&n)===n&&(4===Lc||3===Lc&&(130023424&Ac)===Ac&&500>Qe()-Fc?hu(e,0):Bc|=n),iu(e,t)}function Pu(e,t){0===t&&(0===(1&e.mode)?t=1:(t=lt,0===(130023424&(lt<<=1))&&(lt=4194304)));var n=tu();null!==(e=Ra(e,t))&&(gt(e,t,n),iu(e,n))}function Cu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Pu(e,n)}function Ru(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(t),Pu(e,n)}function Zu(e,t){return We(e,t)}function Mu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Au(e,t,n,r){return new Mu(e,t,n,r)}function Iu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Ou(e,t){var n=e.alternate;return null===n?((n=Au(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Lu(e,t,n,r,i,o){var s=2;if(r=e,"function"===typeof e)Iu(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case x:return Du(n.children,i,o,t);case S:s=8,i|=8;break;case E:return(e=Au(12,n,t,2|i)).elementType=E,e.lanes=o,e;case R:return(e=Au(13,n,t,i)).elementType=R,e.lanes=o,e;case Z:return(e=Au(19,n,t,i)).elementType=Z,e.lanes=o,e;case I:return Nu(n,i,o,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case T:s=10;break e;case P:s=9;break e;case C:s=11;break e;case M:s=14;break e;case A:s=16,r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Au(s,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Du(e,t,n,r){return(e=Au(7,e,r,t)).lanes=n,e}function Nu(e,t,n,r){return(e=Au(22,e,r,t)).elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function ju(e,t,n){return(e=Au(6,e,null,t)).lanes=n,e}function Bu(e,t,n){return(t=Au(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Vu(e,t,n,r,i,a,o,s,c){return e=new Uu(e,t,n,s,c),1===t?(t=1,!0===a&&(t|=8)):t=0,a=Au(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ma(a),e}function Fu(e){if(!e)return Pi;e:{if(Fe(e=e._reactInternals)!==e||1!==e.tag)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ai(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(a(171))}if(1===e.tag){var n=e.type;if(Ai(n))return Li(e,n,t)}return t}function zu(e,t,n,r,i,a,o,s,c){return(e=Vu(n,r,!0,e,0,a,0,s,c)).context=Fu(null),n=e.current,(a=Ia(r=tu(),i=nu(n))).callback=void 0!==t&&null!==t?t:null,Oa(n,a,i),e.current.lanes=i,gt(e,i,r),iu(e,r),e}function Hu(e,t,n,r){var i=t.current,a=tu(),o=nu(i);return n=Fu(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ia(a,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Oa(i,t,o))&&(ru(e,i,o,a),La(e,i,o)),o}function qu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Gu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Wu(e,t){Gu(e,t),(e=e.alternate)&&Gu(e,t)}Sc=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ri.current)ks=!0;else{if(0===(e.lanes&n)&&0===(128&t.flags))return ks=!1,function(e,t,n){switch(t.tag){case 3:Zs(t),ha();break;case 5:ao(t);break;case 1:Ai(t.type)&&Di(t);break;case 4:ro(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ti(ga,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ti(so,1&so.current),t.flags|=128,null):0!==(n&t.child.childLanes)?js(e,t,n):(Ti(so,1&so.current),null!==(e=qs(e,t,n))?e.sibling:null);Ti(so,1&so.current);break;case 19:if(r=0!==(n&t.childLanes),0!==(128&e.flags)){if(r)return zs(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ti(so,so.current),r)break;return null;case 22:case 23:return t.lanes=0,Es(e,t,n)}return qs(e,t,n)}(e,t,n);ks=0!==(131072&e.flags)}else ks=!1,ia&&0!==(1048576&t.flags)&&Xi(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Hs(e,t),e=t.pendingProps;var i=Mi(t,Ci.current);Sa(t,n),i=So(null,t,r,e,i,n);var o=Eo();return t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ai(r)?(o=!0,Di(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ma(t),i.updater=Va,t.stateNode=i,i._reactInternals=t,qa(t,r,e,n),t=Rs(null,t,r,!0,o,n)):(t.tag=0,ia&&o&&ea(t),_s(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Hs(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"===typeof e)return Iu(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===C)return 11;if(e===M)return 14}return 2}(r),e=ma(r,e),i){case 0:t=Ps(null,t,r,e,n);break e;case 1:t=Cs(null,t,r,e,n);break e;case 11:t=ws(null,t,r,e,n);break e;case 14:t=xs(null,t,r,ma(r.type,e),n);break e}throw Error(a(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ps(e,t,r,i=t.elementType===r?i:ma(r,i),n);case 1:return r=t.type,i=t.pendingProps,Cs(e,t,r,i=t.elementType===r?i:ma(r,i),n);case 3:e:{if(Zs(t),null===e)throw Error(a(387));r=t.pendingProps,i=(o=t.memoizedState).element,Aa(e,t),Na(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Ms(e,t,r,n,i=ls(Error(a(423)),t));break e}if(r!==i){t=Ms(e,t,r,n,i=ls(Error(a(424)),t));break e}for(ra=ui(t.stateNode.containerInfo.firstChild),na=t,ia=!0,aa=null,n=Qa(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ha(),r===i){t=qs(e,t,n);break e}_s(e,t,r,n)}t=t.child}return t;case 5:return ao(t),null===e&&ua(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,ni(r,i)?s=null:null!==o&&ni(r,o)&&(t.flags|=32),Ts(e,t),_s(e,t,s,n),t.child;case 6:return null===e&&ua(t),null;case 13:return js(e,t,n);case 4:return ro(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ka(t,null,r,n):_s(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,ws(e,t,r,i=t.elementType===r?i:ma(r,i),n);case 7:return _s(e,t,t.pendingProps,n),t.child;case 8:case 12:return _s(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Ti(ga,r._currentValue),r._currentValue=s,null!==o)if(sr(o.value,s)){if(o.children===i.children&&!Ri.current){t=qs(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var c=o.dependencies;if(null!==c){s=o.child;for(var u=c.firstContext;null!==u;){if(u.context===r){if(1===o.tag){(u=Ia(-1,n&-n)).tag=2;var l=o.updateQueue;if(null!==l){var d=(l=l.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),l.pending=u}}o.lanes|=n,null!==(u=o.alternate)&&(u.lanes|=n),xa(o.return,n,t),c.lanes|=n;break}u=u.next}}else if(10===o.tag)s=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(s=o.return))throw Error(a(341));s.lanes|=n,null!==(c=s.alternate)&&(c.lanes|=n),xa(s,n,t),s=o.sibling}else s=o.child;if(null!==s)s.return=o;else for(s=o;null!==s;){if(s===t){s=null;break}if(null!==(o=s.sibling)){o.return=s.return,s=o;break}s=s.return}o=s}_s(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Sa(t,n),r=r(i=Ea(i)),t.flags|=1,_s(e,t,r,n),t.child;case 14:return i=ma(r=t.type,t.pendingProps),xs(e,t,r,i=ma(r.type,i),n);case 15:return Ss(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ma(r,i),Hs(e,t),t.tag=1,Ai(r)?(e=!0,Di(t)):e=!1,Sa(t,n),za(t,r,i),qa(t,r,i,n),Rs(null,t,r,!0,e,n);case 19:return zs(e,t,n);case 22:return Es(e,t,n)}throw Error(a(156,t.tag))};var Ju="function"===typeof reportError?reportError:function(e){console.error(e)};function $u(e){this._internalRoot=e}function Ku(e){this._internalRoot=e}function Qu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Yu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Xu(){}function el(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if("function"===typeof i){var s=i;i=function(){var e=qu(o);s.call(e)}}Hu(t,o,e,i)}else o=function(e,t,n,r,i){if(i){if("function"===typeof r){var a=r;r=function(){var e=qu(o);a.call(e)}}var o=zu(t,r,e,0,null,!1,0,"",Xu);return e._reactRootContainer=o,e[fi]=o.current,Fr(8===e.nodeType?e.parentNode:e),du(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"===typeof r){var s=r;r=function(){var e=qu(c);s.call(e)}}var c=Vu(e,0,!1,null,0,!1,0,"",Xu);return e._reactRootContainer=c,e[fi]=c.current,Fr(8===e.nodeType?e.parentNode:e),du((function(){Hu(t,c,n,r)})),c}(n,t,e,i,r);return qu(o)}Ku.prototype.render=$u.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));Hu(e,t,null,null)},Ku.prototype.unmount=$u.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;du((function(){Hu(null,e,null,null)})),t[fi]=null}},Ku.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<It.length&&0!==t&&t<It[n].priority;n++);It.splice(n,0,e),0===n&&Nt(e)}},_t=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(yt(t,1|n),iu(t,Qe()),0===(6&Rc)&&(zc=Qe()+500,Fi()))}break;case 13:du((function(){var t=Ra(e,1);if(null!==t){var n=tu();ru(t,e,1,n)}})),Wu(e,1)}},wt=function(e){if(13===e.tag){var t=Ra(e,134217728);if(null!==t)ru(t,e,134217728,tu());Wu(e,134217728)}},xt=function(e){if(13===e.tag){var t=nu(e),n=Ra(e,t);if(null!==n)ru(n,e,t,tu());Wu(e,t)}},St=function(){return bt},Et=function(e,t){var n=bt;try{return bt=e,t()}finally{bt=n}},we=function(e,t,n){switch(t){case"input":if(Y(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=_i(r);if(!i)throw Error(a(90));W(r),Y(r,i)}}}break;case"textarea":ae(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Ce=lu,Re=du;var tl={usingClientEntryPoint:!1,Events:[bi,ki,_i,Te,Pe,lu]},nl={findFiberByHostInstance:yi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},rl={bundleType:nl.bundleType,version:nl.version,rendererPackageName:nl.rendererPackageName,rendererConfig:nl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=qe(e))?null:e.stateNode},findFiberByHostInstance:nl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var il=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!il.isDisabled&&il.supportsFiber)try{it=il.inject(rl),at=il}catch(le){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tl,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Qu(t))throw Error(a(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:w,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Qu(e))throw Error(a(299));var n=!1,r="",i=Ju;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Vu(e,1,!1,null,0,n,0,r,i),e[fi]=t.current,Fr(8===e.nodeType?e.parentNode:e),new $u(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=null===(e=qe(t))?null:e.stateNode},t.flushSync=function(e){return du(e)},t.hydrate=function(e,t,n){if(!Yu(t))throw Error(a(200));return el(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Qu(e))throw Error(a(405));var r=null!=n&&n.hydratedSources||null,i=!1,o="",s=Ju;if(null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=zu(t,null,e,1,null!=n?n:null,i,0,o,s),e[fi]=t.current,Fr(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Ku(t)},t.render=function(e,t,n){if(!Yu(t))throw Error(a(200));return el(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Yu(e))throw Error(a(40));return!!e._reactRootContainer&&(du((function(){el(null,null,e,!1,(function(){e._reactRootContainer=null,e[fi]=null}))})),!0)},t.unstable_batchedUpdates=lu,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Yu(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return el(e,t,n,!1,r)},t.version="18.2.0-next-9e3b772b8-20220608"},1250:function(e,t,n){"use strict";var r=n(4164);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},4164:function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(4463)},6374:function(e,t,n){"use strict";var r=n(2791),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,a={},u=null,l=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(l=t.ref),t)o.call(t,r)&&!c.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:l,props:a,_owner:s.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},9117:function(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,m={};function g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||f}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=g.prototype;var k=b.prototype=new y;k.constructor=b,v(k,g.prototype),k.isPureReactComponent=!0;var _=Array.isArray,w=Object.prototype.hasOwnProperty,x={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,r){var i,a={},o=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)w.call(t,i)&&!S.hasOwnProperty(i)&&(a[i]=t[i]);var c=arguments.length-2;if(1===c)a.children=r;else if(1<c){for(var u=Array(c),l=0;l<c;l++)u[l]=arguments[l+2];a.children=u}if(e&&e.defaultProps)for(i in c=e.defaultProps)void 0===a[i]&&(a[i]=c[i]);return{$$typeof:n,type:e,key:o,ref:s,props:a,_owner:x.current}}function T(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var P=/\/+/g;function C(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function R(e,t,i,a,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case n:case r:c=!0}}if(c)return o=o(c=e),e=""===a?"."+C(c,0):a,_(o)?(i="",null!=e&&(i=e.replace(P,"$&/")+"/"),R(o,t,i,"",(function(e){return e}))):null!=o&&(T(o)&&(o=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,i+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(P,"$&/")+"/")+e)),t.push(o)),1;if(c=0,a=""===a?".":a+":",_(e))for(var u=0;u<e.length;u++){var l=a+C(s=e[u],u);c+=R(s,t,i,l,o)}else if(l=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"===typeof l)for(e=l.call(e),u=0;!(s=e.next()).done;)c+=R(s=s.value,t,i,l=a+C(s,u++),o);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function Z(e,t,n){if(null==e)return e;var r=[],i=0;return R(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function M(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var A={current:null},I={transition:null},O={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:I,ReactCurrentOwner:x};t.Children={map:Z,forEach:function(e,t,n){Z(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return Z(e,(function(){t++})),t},toArray:function(e){return Z(e,(function(e){return e}))||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=g,t.Fragment=i,t.Profiler=o,t.PureComponent=b,t.StrictMode=a,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=v({},e.props),a=e.key,o=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,s=x.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)w.call(t,u)&&!S.hasOwnProperty(u)&&(i[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)i.children=r;else if(1<u){c=Array(u);for(var l=0;l<u;l++)c[l]=arguments[l+2];i.children=c}return{$$typeof:n,type:e.type,key:a,ref:o,props:i,_owner:s}},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=E,t.createFactory=function(e){var t=E.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=I.transition;I.transition={};try{e()}finally{I.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return A.current.useCallback(e,t)},t.useContext=function(e){return A.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return A.current.useDeferredValue(e)},t.useEffect=function(e,t){return A.current.useEffect(e,t)},t.useId=function(){return A.current.useId()},t.useImperativeHandle=function(e,t,n){return A.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return A.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return A.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return A.current.useMemo(e,t)},t.useReducer=function(e,t,n){return A.current.useReducer(e,t,n)},t.useRef=function(e){return A.current.useRef(e)},t.useState=function(e){return A.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return A.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return A.current.useTransition()},t.version="18.2.0"},2791:function(e,t,n){"use strict";e.exports=n(9117)},184:function(e,t,n){"use strict";e.exports=n(6374)},6813:function(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<a(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var s=2*(r+1)-1,c=e[s],u=s+1,l=e[u];if(0>a(c,n))u<i&&0>a(l,c)?(e[r]=l,e[u]=n,r=u):(e[r]=c,e[s]=n,r=s);else{if(!(u<i&&0>a(l,n)))break e;e[r]=l,e[u]=n,r=u}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,c=s.now();t.unstable_now=function(){return s.now()-c}}var u=[],l=[],d=1,p=null,h=3,f=!1,v=!1,m=!1,g="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function k(e){for(var t=r(l);null!==t;){if(null===t.callback)i(l);else{if(!(t.startTime<=e))break;i(l),t.sortIndex=t.expirationTime,n(u,t)}t=r(l)}}function _(e){if(m=!1,k(e),!v)if(null!==r(u))v=!0,I(w);else{var t=r(l);null!==t&&O(_,t.startTime-e)}}function w(e,n){v=!1,m&&(m=!1,y(T),T=-1),f=!0;var a=h;try{for(k(n),p=r(u);null!==p&&(!(p.expirationTime>n)||e&&!R());){var o=p.callback;if("function"===typeof o){p.callback=null,h=p.priorityLevel;var s=o(p.expirationTime<=n);n=t.unstable_now(),"function"===typeof s?p.callback=s:p===r(u)&&i(u),k(n)}else i(u);p=r(u)}if(null!==p)var c=!0;else{var d=r(l);null!==d&&O(_,d.startTime-n),c=!1}return c}finally{p=null,h=a,f=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,S=!1,E=null,T=-1,P=5,C=-1;function R(){return!(t.unstable_now()-C<P)}function Z(){if(null!==E){var e=t.unstable_now();C=e;var n=!0;try{n=E(!0,e)}finally{n?x():(S=!1,E=null)}}else S=!1}if("function"===typeof b)x=function(){b(Z)};else if("undefined"!==typeof MessageChannel){var M=new MessageChannel,A=M.port2;M.port1.onmessage=Z,x=function(){A.postMessage(null)}}else x=function(){g(Z,0)};function I(e){E=e,S||(S=!0,x())}function O(e,n){T=g((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){v||f||(v=!0,I(w))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?o+a:o:a=o,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:d++,callback:i,priorityLevel:e,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(e.sortIndex=a,n(l,e),null===r(u)&&e===r(l)&&(m?(y(T),T=-1):m=!0,O(_,a-o))):(e.sortIndex=s,n(u,e),v||f||(v=!0,I(w))),e},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},5296:function(e,t,n){"use strict";e.exports=n(6813)},6712:function
vendor: 6,907 bytes, line 2
2(e){var t=e.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(t).forEach((function(e){t[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}))},
vendor: 2,647 bytes, line 2
27724:function(e,t,n){var r=n(1775),i=n(2921);t.cW=i,t.Qc=r.parse,t.rz=r.parseParams,r.parseFmtpConfig,r.parsePayloads,r.parseRemoteCandidates,r.parseImageAttributes,t.fj=r.parseSimulcastStreamList},1775:function(e,t,n){var r=function(e){return String(Number(e))===e?Number(e):e},i=function(e,t,n){var i=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:i&&!t[e.name]&&(t[e.name]={});var a=e.push?{}:i?t[e.name]:t;!function(e,t,n,i){if(i&&!n)t[i]=r(e[1]);else for(var a=0;a<n.length;a+=1)null!=e[a+1]&&(t[n[a]]=r(e[a+1]))}(n.match(e.reg),a,e.names,e.name),e.push&&t[e.push].push(a)},a=n(6712),o=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(e){var t={},n=[],r=t;return e.split(/(\r\n|\r|\n)/).filter(o).forEach((function(e){var t=e[0],o=e.slice(2);"m"===t&&(n.push({rtp:[],fmtp:[]}),r=n[n.length-1]);for(var s=0;s<(a[t]||[]).length;s+=1){var c=a[t][s];if(c.reg.test(o))return i(c,r,o)}})),t.media=n,t};var s=function(e,t){var n=t.split(/=(.+)/,2);return 2===n.length?e[n[0]]=r(n[1]):1===n.length&&t.length>1&&(e[n[0]]=void 0),e};t.parseParams=function(e){return e.split(/;\s?/).reduce(s,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(e){return e.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(r),i=0;i<n.length;i+=3)t.push({component:n[i],ip:n[i+1],port:n[i+2]});return t},t.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(s,{})}))},t.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var t,n=!1;return"~"!==e[0]?t=r(e):(t=r(e.substring(1,e.length)),n=!0),{scid:t,paused:n}}))}))}},2921:function(e,t,n){var r=n(6712),i=/%[sdv%]/g,a=function(e){var t=1,n=arguments,r=n.length;return e.replace(i,(function(e){if(t>=r)return e;var i=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}}))},o=function(e,t,n){var r=[e+"="+(t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format)];if(t.names)for(var i=0;i<t.names.length;i+=1){var o=t.names[i];t.name?r.push(n[t.name][o]):r.push(n[t.names[i]])}else r.push(n[t.name]);return a.apply(null,r)},s=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];e.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var n=t.outerOrder||s,i=t.innerOrder||c,a=[];return n.forEach((function(t){r[t].forEach((function(n){n.name in e&&null!=e[n.name]?a.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEac
2h((function(e){a.push(o(t,n,e))}))}))})),e.media.forEach((function(e){a.push(o("m",r.m[0],e)),i.forEach((function(t){r[t].forEach((function(n){n.name in e&&null!=e[n.name]?a.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach((function(e){a.push(o(t,n,e))}))}))}))})),a.join("\r\n")+"\r\n"}},104:function(e,t,n){"use strict";var r=n(4704).default,i=n(6690).default,a=n(9728).default;!function(e){var t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function r(e,n){t&&t.measure&&t.measure(e,n)}n("Zone");var o=e.__Zone_symbol_prefix||"__zone_symbol__";function s(e){return o+e}var c=!0===e[s("forceDuplicateZoneCheck")];if(e.Zone){if(c||"function"!==typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}var u=function(){function t(e,n){i(this,t),this._parent=e,this._name=n?n.name||"unnamed":"<root>",this._properties=n&&n.properties||{},this._zoneDelegate=new p(this,this._parent&&this._parent._zoneDelegate,n)}return a(t,[{key:"parent",get:function(){return this._parent}},{key:"name",get:function(){return this._name}},{key:"get",value:function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]}},{key:"getZoneWith",value:function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}},{key:"fork",value:function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}},{key:"wrap",value:function(e,t){if("function"!==typeof e)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}},{key:"run",value:function(e,t,n,r){O={parent:O,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{O=O.parent}}},{key:"runGuarded",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;O={parent:O,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(i){if(this._zoneDelegate.handleError(this,i))throw i}}finally{O=O.parent}}},{key:"runTask",value:function(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||w).name+"; Execution: "+this.name+")");if(e.state!==x||e.type!==M&&e.type!==Z){var r=e.state!=T;r&&e._transitionTo(T,E),e.runCount++;var i=L;L=e,O={parent:O,zone:this};try{e.type==Z&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(a){if(this._zoneDelegate.handleError(this,a))throw a}}finally{e.state!==x&&e.state!==C&&(e.type==M||e.data&&e.data.isPeriodic?r&&e._transitionTo(E,T):(e.runCount=0,this._updateTaskCount(e,-1),r&&e._transitionTo(x,T,x))),O=O.parent,L=i}}}},{key:"scheduleTask",value:function(e){if(e.zone&&e.zone!==this)for(var t=this;t;){if(t===e.zone)throw Error("can not reschedule task to ".concat(this.name," which is descendants of the original zone ").concat(e.zone.name));t=t.parent}e._transitionTo(S,x);var n=[];e._zoneDelegates=n,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(r){throw e._transitionTo(C,S,x),this._zoneDelegate.handleError(this,r),r}return e._zoneDelegates===n&&this._updateTaskCount(e,1),e.state==S&&e._transitionTo(E,S),e}},{key:"scheduleMicroTask",value:function(e,t,n,r){return this.scheduleTask(new h(R,e,t,n,r,void 0))}},{key:"scheduleMacroTask",value:function(e,t,n,r,i){return this.scheduleTask(new h(Z,e,t,n,r,i))}},{key:"scheduleEventTask",value:function(e,t,n,r,i){return this.scheduleTask(new h(M,e,t,n,r,i))}},{key:"cancelTask",value:function(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||w).name+"; Execution: "+this.name+")");e._transitionTo(P,E,T);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(C,P),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(x,P),e.runCount=0,e}},{key:"_updateTaskCount",value:function(e,t){var n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(var r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}}],[{key:"assertZonePatched",value:function(){if(e.Promise!==A.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}},{key:"root",get:function(){for(var e=t.current;e.parent;)e=e.parent;return e}},{key:"current",get:function(){return O.zone}},{key:"currentTask",get:function(){return L}},{key:"__load_patch",value:function(i,a){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(A.hasOwnProperty(i)){if(!o&&c)throw Error("Already loaded patch: "+i)}else if(!e["__Zone_disable_"+i]){var s="Zone:"+i;n(s),A[i]=a(e,t,I),r(s,s)}}}]),t}();u.__symbol__=s;var l,d={name:"",onHasTask:function(e,t,n,r){return e.hasTask(n,r)},onScheduleTask:function(e,t,n,r){return e.scheduleTask(n,r)},onInvokeTask:function(e,t,n,r,i,a){return e.invokeTask(n,r,i,a)},onCancelTask:function(e,t,n,r){return e.cancelTask(n,r)}},p=function(){function e(t,n,r){i(this,e),this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=t,this._parentDelegate=n,this._forkZS=r&&(r&&r.onFork?r:n._forkZS),this._forkDlgt=r&&(r.onFork?n:n._forkDlgt),this._forkCurrZone=r&&(r.onFork?this.zone:n._forkCurrZone),this._interceptZS=r&&(r.onIntercept?r:n._interceptZS),this._interceptDlgt=r&&(r.onIntercept?n:n._interceptDlgt),this._interceptCurrZone=r&&(r.onIntercept?this.zone:n._interceptCurrZone),this._invokeZS=r&&(r.onInvoke?r:n._invokeZS),this._invokeDlgt=r&&(r.onInvoke?n:n._invokeDlgt),this._invokeCurrZone=r&&(r.onInvoke?this.zone:n._invokeCurrZone),this._handleErrorZS=r&&(r.onHandleError?r:n._handleErrorZS),this._handleErrorDlgt=r&&(r.onHandleError?n:n._handleErrorDlgt),this._handleErrorCurrZone=r&&(r.onHandleError?this.zone:n._handleErrorCurrZone),this._scheduleTaskZS=r&&(r.onScheduleTask?r:n._scheduleTaskZS),this._scheduleTaskDlgt=r&&(r.onScheduleTask?n:n._scheduleTaskDlgt),this._scheduleTaskCurrZone=r&&(r.onScheduleTask?this.zone:n._scheduleTaskCurrZone),this._invokeTaskZS=r&&(r.onInvokeTask?r:n._invokeTaskZS),this._invokeTaskDlgt=r&&(r.onInvokeTask?n:n._invokeTaskDlgt),this._invokeTaskCurrZone=r&&(r.onInvokeTask?this.zone:n._invokeTaskCurrZone),this._cancelTaskZS=r&&(r.onCancelTask?r:n._cancelTaskZS),this._cancelTaskDlgt=r&&(r.onCancelTask?n:n._cancelTaskDlgt),this._cancelTaskCurrZone=r&&(r.onCancelTask?this.zone:n._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;var a=r&&r.onHasTask,o=n&&n._hasTaskZS;(a||o)&&(this._hasTaskZS=a?r:d,this._hasTaskDlgt=n,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=t,r.onScheduleTask||(this._scheduleTaskZS=d,this._scheduleTaskDlgt=n,this._scheduleTaskCurrZone=this.zone),r.onInvokeTask||(this._invokeTaskZS=d,this._invokeTaskDlgt=n,this._invokeTaskCurrZone=this.zone),r.onCancelTask||(this._cancelTaskZS=d,this._cancelTaskDlgt=n,this._cancelTaskCurrZone=this.zone))}return a(e,[{key:"fork",value:function(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new u(e,t)}},{key:"intercept",value:function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}},{key:"invoke",value:function(e,t,n,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,i):t.apply(n,r)}},{key:"handleError",value:function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}},{key:"scheduleTask",value:function(e,t){var n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),(n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t))||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=R)throw new Error("Task is missing scheduleFn.");k(t)}return n}},{key:"invokeTask",value:function(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}},{key:"cancelTask",value:function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}},{key:"hasTask",value:function(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}}},{key:"_updateTaskCount",value:function(e,t){var n=this._taskCounts,r=n[e],i=n[e]=r+t;if(i<0)throw new Error("More tasks executed then were scheduled.");
2if(0==r||0==i){var a={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this.zone,a)}}}]),e}(),h=function(){function t(n,r,a,o,s,c){if(i(this,t),this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=o,this.scheduleFn=s,this.cancelFn=c,!a)throw new Error("callback is not defined");this.callback=a;var u=this;n===M&&o&&o.useG?this.invoke=t.invokeTask:this.invoke=function(){return t.invokeTask.call(e,u,this,arguments)}}return a(t,[{key:"zone",get:function(){return this._zone}},{key:"state",get:function(){return this._state}},{key:"cancelScheduleRequest",value:function(){this._transitionTo(x,S)}},{key:"_transitionTo",value:function(e,t,n){if(this._state!==t&&this._state!==n)throw new Error("".concat(this.type," '").concat(this.source,"': can not transition to '").concat(e,"', expecting state '").concat(t,"'").concat(n?" or '"+n+"'":"",", was '").concat(this._state,"'."));this._state=e,e==x&&(this._zoneDelegates=null)}},{key:"toString",value:function(){return this.data&&"undefined"!==typeof this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}},{key:"toJSON",value:function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}],[{key:"invokeTask",value:function(e,t,n){e||(e=this),D++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==D&&_(),D--}}}]),t}(),f=s("setTimeout"),v=s("Promise"),m=s("then"),g=[],y=!1;function b(t){if(l||e[v]&&(l=e[v].resolve(0)),l){var n=l[m];n||(n=l.then),n.call(l,t)}else e[f](t,0)}function k(e){0===D&&0===g.length&&b(_),e&&g.push(e)}function _(){if(!y){for(y=!0;g.length;){var e=g;g=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(r){I.onUnhandledError(r)}}}I.microtaskDrainDone(),y=!1}}var w={name:"NO ZONE"},x="notScheduled",S="scheduling",E="scheduled",T="running",P="canceling",C="unknown",R="microTask",Z="macroTask",M="eventTask",A={},I={symbol:s,currentZoneFrame:function(){return O},onUnhandledError:N,microtaskDrainDone:N,scheduleMicroTask:k,showUncaughtError:function(){return!u[s("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:N,patchMethod:function(){return N},bindArguments:function(){return[]},patchThen:function(){return N},patchMacroTask:function(){return N},patchEventPrototype:function(){return N},isIEOrEdge:function(){return!1},getGlobalObjects:function(){},ObjectDefineProperty:function(){return N},ObjectGetOwnPropertyDescriptor:function(){},ObjectCreate:function(){},ArraySlice:function(){return[]},patchClass:function(){return N},wrapWithCurrentZone:function(){return N},filterProperties:function(){return[]},attachOriginToPatched:function(){return N},_redefineProperty:function(){return N},patchCallbacks:function(){return N},nativeScheduleMicroTask:b},O={parent:null,zone:new u(null,null)},L=null,D=0;function N(){}r("Zone","Zone"),e.Zone=u}("undefined"!==typeof window&&window||"undefined"!==typeof self&&self||n.g);var o=Object.getOwnPropertyDescriptor,s=Object.defineProperty,c=Object.getPrototypeOf,u=Object.create,l=Array.prototype.slice,d="addEventListener",p="removeEventListener",h=Zone.__symbol__(d),f=Zone.__symbol__(p),v="true",m="false",g=Zone.__symbol__("");function y(e,t){return Zone.current.wrap(e,t)}function b(e,t,n,r,i){return Zone.current.scheduleMacroTask(e,t,n,r,i)}var k=Zone.__symbol__,_="undefined"!==typeof window,w=_?window:void 0,x=_&&w||"object"===typeof self&&self||n.g,S="removeAttribute";function E(e,t){for(var n=e.length-1;n>=0;n--)"function"===typeof e[n]&&(e[n]=y(e[n],t+"_"+n));return e}function T(e){return!e||!1!==e.writable&&!("function"===typeof e.get&&"undefined"===typeof e.set)}var P="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,C=!("nw"in x)&&"undefined"!==typeof x.process&&"[object process]"==={}.toString.call(x.process),R=!C&&!P&&!(!_||!w.HTMLElement),Z="undefined"!==typeof x.process&&"[object process]"==={}
2.toString.call(x.process)&&!P&&!(!_||!w.HTMLElement),M={},A=function(e){if(e=e||x.event){var t=M[e.type];t||(t=M[e.type]=k("ON_PROPERTY"+e.type));var n,r=this||e.target||x,i=r[t];if(R&&r===w&&"error"===e.type){var a=e;!0===(n=i&&i.call(this,a.message,a.filename,a.lineno,a.colno,a.error))&&e.preventDefault()}else void 0==(n=i&&i.apply(this,arguments))||n||e.preventDefault();return n}};function I(e,t,n){var r=o(e,t);!r&&n&&(o(n,t)&&(r={enumerable:!0,configurable:!0}));if(r&&r.configurable){var i=k("on"+t+"patched");if(!e.hasOwnProperty(i)||!e[i]){delete r.writable,delete r.value;var a=r.get,c=r.set,u=t.slice(2),l=M[u];l||(l=M[u]=k("ON_PROPERTY"+u)),r.set=function(t){var n=this;(n||e!==x||(n=x),n)&&("function"===typeof n[l]&&n.removeEventListener(u,A),c&&c.call(n,null),n[l]=t,"function"===typeof t&&n.addEventListener(u,A,!1))},r.get=function(){var n=this;if(n||e!==x||(n=x),!n)return null;var i=n[l];if(i)return i;if(a){var o=a.call(this);if(o)return r.set.call(this,o),"function"===typeof n[S]&&n.removeAttribute(t),o}return null},s(e,t,r),e[i]=!0}}}function O(e,t,n){if(t)for(var r=0;r<t.length;r++)I(e,"on"+t[r],n);else{var i=[];for(var a in e)"on"==a.slice(0,2)&&i.push(a);for(var o=0;o<i.length;o++)I(e,i[o],n)}}var L=k("originalInstance");function D(e){var t=x[e];if(t){x[k(e)]=t,x[e]=function(){var n=E(arguments,e);switch(n.length){case 0:this[L]=new t;break;case 1:this[L]=new t(n[0]);break;case 2:this[L]=new t(n[0],n[1]);break;case 3:this[L]=new t(n[0],n[1],n[2]);break;case 4:this[L]=new t(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},B(x[e],t);var n,r=new t((function(){}));for(n in r)"XMLHttpRequest"===e&&"responseBlob"===n||function(t){"function"===typeof r[t]?x[e].prototype[t]=function(){return this[L][t].apply(this[L],arguments)}
2:s(x[e].prototype,t,{set:function(n){"function"===typeof n?(this[L][t]=y(n,e+"."+t),B(this[L][t],n)):this[L][t]=n},get:function(){return this[L][t]}})}(n);for(n in t)"prototype"!==n&&t.hasOwnProperty(n)&&(x[e][n]=t[n])}}function N(e,t,n){for(var r=e;r&&!r.hasOwnProperty(t);)r=c(r);!r&&e[t]&&(r=e);var i=k(t),a=null;if(r&&(!(a=r[i])||!r.hasOwnProperty(i))&&(a=r[i]=r[t],T(r&&o(r,t)))){var s=n(a,i,t);r[t]=function(){return s(this,arguments)},B(r[t],a)}return a}function j(e,t,n){var r=null;function i(e){var t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=N(e,t,(function(e){return function(t,r){var a=n(t,r);return a.cbIdx>=0&&"function"===typeof r[a.cbIdx]?b(a.name,r[a.cbIdx],a,i):e.apply(t,r)}}))}function B(e,t){e[k("OriginalDelegate")]=t}var U=!1,V=!1;function F(){if(U)return V;U=!0;try{var e=w.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(V=!0)}catch(t){}return V}Zone.__load_patch("ZoneAwarePromise",(function(e,t,n){var o=Object.getOwnPropertyDescriptor,s=Object.defineProperty;var c=n.symbol,u=[],l=!0===e[c("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],d=c("Promise"),p=c("then"),h="__creationTrace__";n.onUnhandledError=function(e){if(n.showUncaughtError()){var t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=function(){for(var e=function(){var e=u.shift();try{e.zone.runGuarded((function(){if(e.throwOriginal)throw e.rejection;throw e}))}catch(r){!function(e){n.onUnhandledError(e);try{var r=t[f];"function"===typeof r&&r.call(this,e)}catch(i){}}(r)}};u.length;)e()};var f=c("unhandledPromiseRejectionHandler");function v(e){return e&&e.then}function m(e){return e}function g(e){return B.reject(e)}var y=c("state"),b=c("value"),k=c("finally"),_=c("parentPromiseValue"),w=c("parentPromiseState"),x="Promise.then",S=null,E=!0,T=!1,P=0;function C(e,t){return function(n){try{A(e,t,n)}catch(r){A(e,!1,r)}}}var R=function(){var e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},Z="Promise resolved with itself",M=c("currentTaskTrace");function A(e,r,i){var a=R();if(e===i)throw new TypeError(Z);if(e[y]===S){var o=null;try{"object"!==typeof i&&"function"!==typeof i||(o=i&&i.then)}catch(v){return a((function(){A(e,!1,v)}))(),e}if(r!==T&&i instanceof B&&i.hasOwnProperty(y)&&i.hasOwnProperty(b)&&i[y]!==S)O(i),A(e,i[y],i[b]);else if(r!==T&&"function"===typeof o)try{o.call(i,a(C(e,r)),a(C(e,!1)))}catch(v){a((function(){A(e,!1,v)}))()}else{e[y]=r;var c=e[b];if(e[b]=i,e[k]===k&&r===E&&(e[y]=e[w],e[b]=e[_]),r===T&&i instanceof Error){var d=t.currentTask&&t.currentTask.data&&t.currentTask.data[h];d&&s(i,M,{configurable:!0,enumerable:!1,writable:!0,value:d})}for(var p=0;p<c.length;)L(e,c[p++],c[p++],c[p++],c[p++]);if(0==c.length&&r==T){e[y]=P;var f=i;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(i)+(i&&i.stack?"\n"+i.stack:""))}catch(v){f=v}l&&(f.throwOriginal=!0),f.rejection=i,f.promise=e,f.zone=t.current,f.task=t.currentTask,u.push(f),n.scheduleMicroTask()}}}return e}var I=c("rejectionHandledHandler");function O(e){if(e[y]===P){try{var n=t[I];n&&"function"===typeof n&&n.call(this,{rejection:e[b],promise:e})}catch(i){}e[y]=T;for(var r=0;r<u.length;r++)e===u[r].promise&&u.splice(r,1)}}function L(e,t,n,r,i){O(e);var a=e[y],o=a?"function"===typeof r?r:m:"function"===typeof i?i:g;t.scheduleMicroTask(x,(function(){try{var r=e[b],i=!!n&&k===n[k];i&&(n[_]=r,n[w]=a);var s=t.run(o,void 0,i&&o!==g&&o!==m?[]:[r]);A(n,!0,s)}catch(c){A(n,!1,c)}}),n)}var D=function(){},j=e.AggregateError,B=function(e,n){function o(e){i(this,o);var t=this;
2if(!(t instanceof o))throw new Error("Must be an instanceof Promise.");t[y]=S,t[b]=[];try{var n=R();e&&e(n(C(t,E)),n(C(t,T)))}catch(r){A(t,!1,r)}}return a(o,[{key:e,get:function(){return"Promise"}},{key:n,get:function(){return o}},{key:"then",value:function(e,n){var r,i=null===(r=this.constructor)||void 0===r?void 0:r[Symbol.species];i&&"function"===typeof i||(i=this.constructor||o);var a=new i(D),s=t.current;return this[y]==S?this[b].push(s,a,e,n):L(this,s,a,e,n),a}},{key:"catch",value:function(e){return this.then(null,e)}},{key:"finally",value:function(e){var n,r=null===(n=this.constructor)||void 0===n?void 0:n[Symbol.species];r&&"function"===typeof r||(r=o);var i=new r(D);i[k]=k;var a=t.current;return this[y]==S?this[b].push(a,i,e,e):L(this,a,i,e,e),i}}],[{key:"toString",value:function(){return"function ZoneAwarePromise() { [native code] }"}},{key:"resolve",value:function(e){return A(new this(null),E,e)}},{key:"reject",value:function(e){return A(new this(null),T,e)}},{key:"any",value:function(e){if(!e||"function"!==typeof e[Symbol.iterator])return Promise.reject(new j([],"All promises were rejected"));var t=[],n=0;try{var i,a=r(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;n++,t.push(o.resolve(s))}}catch(l){a.e(l)}finally{a.f()}}catch(l){return Promise.reject(new j([],"All promises were rejected"))}if(0===n)return Promise.reject(new j([],"All promises were rejected"));var c=!1,u=[];return new o((function(e,r){for(var i=0;i<t.length;i++)t[i].then((function(t){c||(c=!0,e(t))}),(function(e){u.push(e),0===--n&&(c=!0,r(new j(u,"All promises were rejected")))}))}))}},{key:"race",value:function(e){var t,n,i=new this((function(e,r){t=e,n=r}));function a(e){t(e)}function o(e){n(e)}var s,c=r(e);try{for(c.s();!(s=c.n()).done;){var u=s.value;v(u)||(u=this.resolve(u)),u.then(a,o)}}catch(l){c.e(l)}finally{c.f()}return i}},{key:"all",value:function(e){return o.allWithCallback(e)}},{key:"allSettled",value:function(e){return(this&&this.prototype instanceof o?this:o).allWithCallback(e,{thenCallback:function(e){return{status:"fulfilled",value:e}},errorCallback:function(e){return{status:"rejected",reason:e}}})}},{key:"allWithCallback",value:function(e,t){var n,i,a,o=this,s=new this((function(e,t){n=e,i=t})),c=2,u=0,l=[],d=r(e);try{var p=function(){var e=a.value;v(e)||(e=o.resolve(e));var r=u;try{e.then((function(e){l[r]=t?t.thenCallback(e):e,0===--c&&n(l)}),(function(e){t?(l[r]=t.errorCallback(e),0===--c&&n(l)):i(e)}))}catch(s){i(s)}c++,u++};for(d.s();!(a=d.n()).done;)p()}catch(h){d.e(h)}finally{d.f()}return 0===(c-=2)&&n(l),s}}]),o}(Symbol.toStringTag,Symbol.species);B.resolve=B.resolve,B.reject=B.reject,B.race=B.race,B.all=B.all;var U=e[d]=e.Promise;e.Promise=B;var V=c("thenPatched");function F(e){var t=e.prototype,n=o(t,"then");if(!n||!1!==n.writable&&n.configurable){var r=t.then;t[p]=r,e.prototype.then=function(e,t){var n=this;return new B((function(e,t){r.call(n,e,t)})).then(e,t)},e[V]=!0}}return n.patchThen=F,U&&(F(U),N(e,"fetch",(function(e){return t=e,function(e,n){var r=t.apply(e,n);if(r instanceof B)return r;var i=r.constructor;return i[V]||F(i),r};var t}))),Promise[t.__symbol__("uncaughtPromiseErrors")]=u,B})),Zone.__load_patch("toString",(function(e){var t=Function.prototype.toString,n=k("OriginalDelegate"),r=k("Promise"),i=k("Error"),a=function(){if("function"===typeof this){var a=this[n];if(a)return"function"===typeof a?t.call(a):Object.prototype.toString.call(a);if(this===Promise){var o=e[r];if(o)return t.call(o)}if(this===Error){var s=e[i];if(s)return t.call(s)}}return t.call(this)};a[n]=t,Function.prototype.toString=a;var o=Object.prototype.toString;Object.prototype.toString=function(){return"function"===typeof Promise&&this instanceof Promise?"[object Promise]":o.call(this)}}));var z=!1;if("undefined"!==typeof window)try{var H=Object.defineProperty({},"passive",{get:function(){z=!0}});window.addEventListener("test",H,H),window.removeEventListener("test",H,H)}catch(ce){z=!1}var q={useG:!0},G={},W={},J=new RegExp("^"+g+"(\\w+)(true|false)$"),$=k("propagationStopped");function K(e,t){var n=(t?t(e):e)+m,r=(t?t(e):e)+v,i=g+n,a=g+r;G[e]={},G[e][m]=i,G[e][v]=a}function Q(e,t,n,r){var i=r&&r.add||d,a=r&&r.rm||p,o=r&&r.listeners||"eventListeners",s=r&&r.rmAll||"removeAllListeners",u=k(i),l="."+i+":",h="prependListener",f="."+h+":",y=function(e,t,n){if(!e.isRemoved){var r,i=e.callback;"object"===typeof i&&i.handleEvent&&(e.callback=function(e){return i.handleEvent(e)},e.originalDelegate=i);try{e.invoke(e,t,[n])}catch(ce){r=ce}var o=e.options;if(o&&"object"===typeof o&&o.once){var s=e.originalDelegate?e.originalDelegate:e.callback;
2t[a].call(t,n.type,s,o)}return r}};function b(n,r,i){if(r=r||e.event){var a=n||r.target||e,o=a[G[r.type][i?v:m]];if(o){var s=[];if(1===o.length){var c=y(o[0],a,r);c&&s.push(c)}else for(var u=o.slice(),l=0;l<u.length&&(!r||!0!==r[$]);l++){var d=y(u[l],a,r);d&&s.push(d)}if(1===s.length)throw s[0];for(var p=function(){var e=s[h];t.nativeScheduleMicroTask((function(){throw e}))},h=0;h<s.length;h++)p()}}}var _=function(e){return b(this,e,!1)},w=function(e){return b(this,e,!0)};function x(t,n){if(!t)return!1;var r=!0;n&&void 0!==n.useG&&(r=n.useG);var d=n&&n.vh,p=!0;n&&void 0!==n.chkDup&&(p=n.chkDup);var y=!1;n&&void 0!==n.rt&&(y=n.rt);for(var b=t;b&&!b.hasOwnProperty(i);)b=c(b);if(!b&&t[i]&&(b=t),!b)return!1;if(b[u])return!1;var x,S=n&&n.eventNameToString,E={},T=b[u]=b[i],P=b[k(a)]=b[a],R=b[k(o)]=b[o],Z=b[k(s)]=b[s];n&&n.prepend&&(x=b[k(n.prepend)]=b[n.prepend]);var M=r?function(e){if(!E.isExisting)return T.call(E.target,E.eventName,E.capture?w:_,E.options)}:function(e){return T.call(E.target,E.eventName,e.invoke,E.options)},A=r?function(e){if(!e.isRemoved){var t,n=G[e.eventName];n&&(t=n[e.capture?v:m]);var r=t&&e.target[t];if(r)for(var i=0;i<r.length;i++){if(r[i]===e){r.splice(i,1),e.isRemoved=!0,0===r.length&&(e.allRemoved=!0,e.target[t]=null);break}}}if(e.allRemoved)return P.call(e.target,e.eventName,e.capture?w:_,e.options)}:function(e){return P.call(e.target,e.eventName,e.invoke,e.options)},I=n&&n.diff?n.diff:function(e,t){var n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},O=Zone[k("UNPATCHED_EVENTS")],L=e[k("PASSIVE_EVENTS")],D=function(t,i,a,o){var s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return function(){var u=this||e,l=arguments[0];n&&n.transferEventName&&(l=n.transferEventName(l));var h=arguments[1];if(!h)return t.apply(this,arguments);if(C&&"uncaughtException"===l)return t.apply(this,arguments);var f=!1;if("function"!==typeof h){if(!h.handleEvent)return t.apply(this,arguments);f=!0}if(!d||d(t,h,u,arguments)){var g=z&&!!L&&-1!==L.indexOf(l),y=function(e,t){return!z&&"object"===typeof e&&e?!!e.capture:z&&t?"boolean"===typeof e?{capture:e,passive:!0}:e?"object"===typeof e&&!1!==e.passive?Object.assign(Object.assign({},e),{passive:!0}):e:{passive:!0}:e}(arguments[2],g);if(O)for(var b=0;b<O.length;b++)if(l===O[b])return g?t.call(u,l,h,y):t.apply(this,arguments);var k=!!y&&("boolean"===typeof y||y.capture),_=!(!y||"object"!==typeof y)&&y.once,w=Zone.current,x=G[l];x||(K(l,S),x=G[l]);var T,P=x[k?v:m],R=u[P],Z=!1;if(R){if(Z=!0,p)for(var M=0;M<R.length;M++)if(I(R[M],h))return}else R=u[P]=[];var A=u.constructor.name,D=W[A];D&&(T=D[l]),T||(T=A+i+(S?S(l):l)),E.options=y,_&&(E.options.once=!1),E.target=u,E.capture=k,E.eventName=l,E.isExisting=Z;var N=r?q:void 0;N&&(N.taskData=E);var j=w.scheduleEventTask(T,h,N,a,o);return E.target=null,N&&(N.taskData=null),_&&(y.once=!0),(z||"boolean"!==typeof j.options)&&(j.options=y),j.target=u,j.capture=k,j.eventName=l,f&&(j.originalDelegate=h),c?R.unshift(j):R.push(j),s?u:void 0}}};return b[i]=D(T,l,M,A,y),x&&(b[h]=D(x,f,(function(e){return x.call(E.target,E.eventName,e.invoke,E.options)}),A,y,!0)),b[a]=function(){var t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));var i=arguments[2],a=!!i&&("boolean"===typeof i||i.capture),o=arguments[1];if(!o)return P.apply(this,arguments);if(!d||d(P,o,t,arguments)){var s,c=G[r];c&&(s=c[a?v:m]);var u=s&&t[s];if(u)for(var l=0;l<u.length;l++){var p=u[l];if(I(p,o)){if(u.splice(l,1),p.isRemoved=!0,0===u.length)if(p.allRemoved=!0,t[s]=null,"string"===typeof r)t[g+"ON_PROPERTY"+r]=null;return p.zone.cancelTask(p),y?t:void 0}}return P.apply(this,arguments)}},b[o]=function(){var t=this||e,r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));for(var i=[],a=Y(t,S?S(r):r),o=0;o<a.length;o++){var s=a[o],c=s.originalDelegate?s.originalDelegate:s.callback;i.push(c)}return i},b[s]=function(){var t=this||e,r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));var i=G[r];if(i){var o=i[m],c=i[v],u=t[o],l=t[c];if(u)for(var d=u.slice(),p=0;p<d.length;p++){var h=d[p],f=h.originalDelegate?h.originalDelegate:h.callback;this[a].call(this,r,f,h.options)}if(l)for(var g=l.slice(),b=0;b<g.length;b++){var k=g[b],_=k.originalDelegate?k.originalDelegate:k.callback;this[a].call(this,r,_,k.options)}}}else{for(var w=Object.keys(t),x=0;x<w.length;x++){var S=w[x],E=J.exec(S),T=E&&E[1];T&&"removeListener"!==T&&this[s].call(this,T)}this[s].call(this,"removeListener")}if(y)return this},B(b[i],T),B(b[a],P),Z&&B(b[s],Z),R&&B(b[o],R),!0}for(var S=[],E=0;E<n.length;E++)S[E]=x(n[E],r);return S}function Y(e,t){if(!t){var n=[];for(var r in e){var i=J.exec(r),a=i&&i[1];if(a&&(!t||a===t)){var o=e[r];if(o)for(var s=0;s<o.length;s++)n.push(o[s])}}return n}var c=G[t];c||(K(t),c=G[t]);var u=e[c[m]],l=e[c[v]];return u?l?u.concat(l):u.slice():l?l.slice():[]}function X(e,t){var n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",(function(e){return function(t,n){t[$]=!0,e&&e.apply(t,n)}}))}function ee(e,t,n,r,i){var a=Zone.__symbol__(r);if(!t[a]){var o=t[a]=t[r];
2t[r]=function(a,s,c){return s&&s.prototype&&i.forEach((function(t){var i="".concat(n,".").concat(r,"::")+t,a=s.prototype;try{if(a.hasOwnProperty(t)){var o=e.ObjectGetOwnPropertyDescriptor(a,t);o&&o.value?(o.value=e.wrapWithCurrentZone(o.value,i),e._redefineProperty(s.prototype,t,o)):a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}else a[t]&&(a[t]=e.wrapWithCurrentZone(a[t],i))}catch(c){}})),o.call(t,a,s,c)},e.attachOriginToPatched(t[r],o)}}function te(e,t,n){if(!n||0===n.length)return t;var r=n.filter((function(t){return t.target===e}));if(!r||0===r.length)return t;var i=r[0].ignoreProperties;return t.filter((function(e){return-1===i.indexOf(e)}))}function ne(e,t,n,r){e&&O(e,te(e,t,n),r)}function re(e){return Object.getOwnPropertyNames(e).filter((function(e){return e.startsWith("on")&&e.length>2})).map((function(e){return e.substring(2)}))}function ie(e,t){if((!C||Z)&&!Zone[e.symbol("patchEvents")]){var n=t.__Zone_ignore_on_properties,r=[];if(R){var i=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);var a=function(){try{var e=w.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch(t){}return!1}()?[{target:i,ignoreProperties:["error"]}]:[];ne(i,re(i),n?n.concat(a):n,c(i))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(var o=0;o<r.length;o++){var s=t[r[o]];s&&s.prototype&&ne(s.prototype,re(s.prototype),n)}}}Zone.__load_patch("util",(function(e,t,n){var r=re(e);n.patchOnProperties=O,n.patchMethod=N,n.bindArguments=E,n.patchMacroTask=j;var i=t.__symbol__("BLACK_LISTED_EVENTS"),a=t.__symbol__("UNPATCHED_EVENTS");e[a]&&(e[i]=e[a]),e[i]&&(t[i]=t[a]=e[i]),n.patchEventPrototype=X,n.patchEventTarget=Q,n.isIEOrEdge=F,n.ObjectDefineProperty=s,n.ObjectGetOwnPropertyDescriptor=o,n.ObjectCreate=u,n.ArraySlice=l,n.patchClass=D,n.wrapWithCurrentZone=y,n.filterProperties=te,n.attachOriginToPatched=B,n._redefineProperty=Object.defineProperty,n.patchCallbacks=ee,n.getGlobalObjects=function(){return{globalSources:W,zoneSymbolEventNames:G,eventNames:r,isBrowser:R,isMix:Z,isNode:C,TRUE_STR:v,FALSE_STR:m,ZONE_SYMBOL_PREFIX:g,ADD_EVENT_LISTENER_STR:d,REMOVE_EVENT_LISTENER_STR:p}}}));var ae=k("zoneTask");function oe(e,t,n,r){var i=null,a=null;n+=r;var o={};function s(t){var n=t.data;return n.args[0]=function(){return t.invoke.apply(this,arguments)},n.handleId=i.apply(e,n.args),t}function c(t){return a.call(e,t.data.handleId)}i=N(e,t+=r,(function(n){return function(i,a){if("function"===typeof a[0]){var u={isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?a[1]||0:void 0,args:a},l=a[0];a[0]=function(){try{return l.apply(this,arguments)}finally{u.isPeriodic||("number"===typeof u.handleId?delete o[u.handleId]:u.handleId&&(u.handleId[ae]=null))}};var d=b(t,a[0],u,s,c);if(!d)return d;var p=d.data.handleId;return"number"===typeof p?o[p]=d:p&&(p[ae]=d),p&&p.ref&&p.unref&&"function"===typeof p.ref&&"function"===typeof p.unref&&(d.ref=p.ref.bind(p),d.unref=p.unref.bind(p)),"number"===typeof p||p?p:d}return n.apply(e,a)}})),a=N(e,n,(function(t){return function(n,r){var i,a=r[0];"number"===typeof a?i=o[a]:(i=a&&a[ae])||(i=a),i&&"string"===typeof i.type?"notScheduled"!==i.state&&(i.cancelFn&&i.data.isPeriodic||0===i.runCount)&&("number"===typeof a?delete o[a]:a&&(a[ae]=null),i.zone.cancelTask(i)):t.apply(e,r)}}))}function se(e,t){if(!Zone[t.symbol("patchEventTarget")]){for(var n=t.getGlobalObjects(),r=n.eventNames,i=n.zoneSymbolEventNames,a=n.TRUE_STR,o=n.FALSE_STR,s=n.ZONE_SYMBOL_PREFIX,c=0;c<r.length;c++){var u=r[c],l=s+(u+o),d=s+(u+a);i[u]={},i[u][o]=l,i[u][a]=d}var p=e.EventTarget;if(p&&p.prototype)return t.patchEventTarget(e,t,[p&&p.prototype]),!0}}Zone.__load_patch("legacy",(function(e){var t=e[Zone.__symbol__("legacyPatch")];t&&t()})),Zone.__load_patch("queueMicrotask",(function(e,t,n){n.patchMethod(e,"queueMicrotask",(function(e){return function(e,n){t.current.scheduleMicroTask("queueMicrotask",n[0])}}))})),Zone.__load_patch("timers",(function(e){var t="set",n="clear";oe(e,t,n,"Timeout"),oe(e,t,n,"Interval"),oe(e,t,n,"Immediate")})),Zone.__load_patch("requestAnimationFrame",(function(e){oe(e,"request","cancel","AnimationFrame"),oe(e,"mozRequest","mozCancel","AnimationFrame"),oe(e,"webkitRequest","webkitCancel","AnimationFrame")})),Zone.__load_patch("blocking",(function(e,t){for(var n=["alert","prompt","confirm"],r=0;r<n.length;r++){N(e,n[r],(function(n,r,i){return function(r,a){return t.current.run(n,e,a,i)}}))}})),Zone.__load_patch("EventTarget",(function(e,t,n){!function(e,t){t.patchEventPrototype(e,t)}(e,n),se(e,n);var r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])})),Zone.__load_patch("MutationObserver",(function(e,t,n){D("MutationObserver"),D("WebKitMutationObserver")})),Zone.__load_patch("IntersectionObserver",(function(e,t,n){D("IntersectionObserver")})),Zone.__load_patch("FileReader",(function(e,t,n){D("FileReader")})),Zone.__load_patch("on_property",(function(e,t,n){ie(n,e)})),Zone.__load_patch("customElements",(function(e,t,n){!function(e,t){var n=t.getGlobalObjects(),r=n.isBrowser,i=n.isMix;(r||i)&&e.customElements&&"customElements"in e&&t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(e,n)})),Zone.__load_patch("XHR",(function(e,t){!function(e){var c=e.XMLHttpRequest;if(!c)return;var u=c.prototype;var l=u[h],d=u[f];if(!l){var p=e.XMLHttpRequestEventTarget;if(p){var v=p.prototype;l=v[h],d=v[f]}}var m="readystatechange",g="scheduled";function y(e){var r=e.data,o=r.target;o[a]=!1,o[s]=!1;var c=o[i];l||(l=o[h],d=o[f]),c&&d.call(o,m,c);var u=o[i]=function(){if(o.readyState===o.DONE)if(!r.aborted&&o[a]&&e.state===g){var n=o[t.__symbol__("loadfalse")];if(0!==o.status&&n&&n.length>0){var i=e.invoke;e.invoke=function(){for(var n=o[t.__symbol__("loadfalse")],a=0;a<n.length;a++)n[a]===e&&n.splice(a,1);r.aborted||e.state!==g||i.call(e)},n.push(e)}else e.invoke()}else r.aborted||!1!==o[a]||(o[s]=!0)};return l.call(o,m,u),o[n]||(o[n]=e),T.apply(o,r.args),o[a]=!0,e}function _(){}function w(e){var t=e.data;return t.aborted=!0,P.apply(t.target,t.args)}var x=N(u,"open",(function(){return function(e,t){return e[r]=0==t[2],e[o]=t[1],x.apply(e,t)}})),S=k("fetchTaskAborting"),E=k("fetchTaskScheduling"),T=N(u,"send",(function(){return function(e,n){if(!0===t.current[E])return T.apply(e,n);if(e[r])return T.apply(e,n);var i={target:e,url:e[o],isPeriodic:!1,args:n,aborted:!1},a=b("XMLHttpRequest.send",_,i,y,w);
2e&&!0===e[s]&&!i.aborted&&a.state===g&&a.invoke()}})),P=N(u,"abort",(function(){return function(e,r){var i=e[n];if(i&&"string"==typeof i.type){if(null==i.cancelFn||i.data&&i.data.aborted)return;i.zone.cancelTask(i)}else if(!0===t.current[S])return P.apply(e,r)}}))}(e);var n=k("xhrTask"),r=k("xhrSync"),i=k("xhrListener"),a=k("xhrScheduled"),o=k("xhrURL"),s=k("xhrErrorBeforeScheduled")})),Zone.__load_patch("geolocation",(function(e){e.navigator&&e.navigator.geolocation&&function(e,t){for(var n=e.constructor.name,r=function(){var r=t[i],a=e[r];if(a){if(!T(o(e,r)))return"continue";e[r]=function(e){var t=function(){return e.apply(this,E(arguments,n+"."+r))};return B(t,e),t}(a)}},i=0;i<t.length;i++)r()}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])})),Zone.__load_patch("PromiseRejectionEvent",(function(e,t){function n(t){return function(n){Y(e,t).forEach((function(r){var i=e.PromiseRejectionEvent;if(i){var a=new i(t,{promise:n.promise,reason:n.rejection});r.invoke(a)}}))}}e.PromiseRejectionEvent&&(t[k("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[k("rejectionHandledHandler")]=n("rejectionhandled"))}))},3897:function(e){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports},5372:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},3405:function(e,t,n){var r=n(3897);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},6115:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7156:function(e){function t(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,i)}
2e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,a){var o=e.apply(n,r);function s(e){t(o,i,a,s,c,"next",e)}function c(e){t(o,i,a,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},3515:function(e,t,n){var r=n(6015),i=n(9617);function a(t,n,o){return i()?(e.exports=a=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=a=function(e,t,n){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return n&&r(a,n.prototype),a},e.exports.__esModule=!0,e.exports.default=e.exports),a.apply(null,arguments)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},9728:function(e,t,n){var r=n(4062);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,r(i.key),i)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},4704:function(e,t,n){var r=n(6116);e.exports=function(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}},e.exports.__esModule=!0,e.exports.default=e.exports},6389:function(e,t,n){var r=n(3808),i=n(9617),a=n(4993);e.exports=function(e){var t=i();return function(){var n,i=r(e);if(t){var o=r(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return a(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},3808:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:function(e,t,n){var r=n(6015);e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},6035:function(e){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},9617:function(e){e.exports=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},9498:function(e){e.exports=function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8872:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:function(e){e.exports=function(){throw new TypeError("Invalid attempt to de
2structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},2281:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},4993:function(e,t,n){var r=n(8698).default,i=n(6115);e.exports=function(e,t){if(t&&("object"===r(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7061:function(e,t,n){var r=n(8698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,a=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(M){d=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(r||[]);return o(a,"_invoke",{value:S(e,n,s)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(M){return{type:"throw",arg:M}}}t.wrap=p;var f={};function v(){}function m(){}function g(){}var y={};d(y,c,(function(){return this}));var b=Object.getPrototypeOf,k=b&&b(b(R([])));k&&k!==n&&a.call(k,c)&&(y=k);var _=g.prototype=v.prototype=Object.create(y);function w(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(i,o,s,c){var u=h(e[i],e,o);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,c)}),(function(e){n("throw",e,s,c)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}})}function S(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return Z()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=E(o,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=h(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=h(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(a.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:Z}}function Z(){return{value:void 0,done:!0}}return m.prototype=g,o(_,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=d(g,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},w(x.prototype),d(x.prototype,u,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new x(p(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},w(_),d(_,l,"Generator"),d(_,c,(function(){return this})),d(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=R,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
vendor: 6,440 bytes, line 2
2h(P),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},6015:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:function(e,t,n){var r=n(5372),i=n(8872),a=n(6116),o=n(2218);e.exports=function(e,t){return r(e)||i(e,t)||a(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},861:function(e,t,n){var r=n(3405),i=n(9498),a=n(6116),o=n(2281);e.exports=function(e){return r(e)||i(e)||a(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},5036:function(e,t,n){var r=n(8698).default;e.exports=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:function(e,t,n){var r=n(8698).default,i=n(5036);e.exports=function(e){var t=i(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:function(e,t,n){var r=n(3897);e.exports=function(e,t){if(e){if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},3496:function(e,t,n){var r=n(3808),i=n(6015),a=n(6035),o=n(3515);function s(t){var n="function"===typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!a(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},907:function(e,t,n){"use strict";function r(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}n.d(t,{Z:function(){return r}})},3878:function(e,t,n){"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,{Z:function(){return r}})},7326:function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return r}})},5861:function(e,t,n){"use strict";function r(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(u){return void n(u)}s.done?t(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,c,"next",e)}function c(e){r(o,i,a,s,c,"throw",e)}s(void 0)}))}}n.d(t,{Z:function(){return i}})},5671:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{Z:function(){return r}})},5647:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9611),i=n(8814);function a(e,t,n){return a=(0,i.Z)()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return n&&(0,r.Z)(a,n.prototype),a},a.apply(null,arguments)}},3144:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(9142);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.Z)(i.key),i)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},7762:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(181);function i(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];
2if(!n){if(Array.isArray(e)||(n=(0,r.Z)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}},7277:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1120),i=n(8814),a=n(1002),o=n(7326);function s(e){var t=(0,i.Z)();return function(){var n,i=(0,r.Z)(e);if(t){var s=(0,r.Z)(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return function(e,t){if(t&&("object"===(0,a.Z)(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}(this,n)}}},4942:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9142);function i(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},1120:function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:function(){return r}})},136:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9611);function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.Z)(e,t)}},8814:function(e,t,n){"use strict";function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}n.d(t,{Z:function(){return r}})},9199:function(e,t,n){"use strict";function r(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,{Z:function(){return r}})},5267:function(e,t,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(t,{Z:function(){return r}})},1413:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(4942);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}},4925:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{Z:function(){return r}})},4165:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1002);function i(){i=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}
vendor: 4,233 bytes, line 2
2try{l({},"")}catch(Z){l=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),s=new P(r||[]);return a(o,"_invoke",{value:x(e,n,s)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(Z){return{type:"throw",arg:Z}}}e.wrap=d;var h={};function f(){}function v(){}function m(){}var g={};l(g,s,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(C([])));b&&b!==t&&n.call(b,s)&&(g=b);var k=m.prototype=f.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function i(a,o,s,c){var u=p(e[a],e,o);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==(0,r.Z)(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,c)}),(function(e){i("throw",e,s,c)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return i("throw",e,s,c)}))}c(u.arg)}var o;a(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function x(e,t,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return R()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=p(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=p(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:R}}function R(){return{value:void 0,done:!0}}return v.prototype=m,a(k,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:v,configurable:!0}),v.displayName=l(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,l(e,u,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},_(w.prototype),l(w.prototype,c,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,a){void 0===a&&(a=Promise);var o=new w(d(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},_(k),l(k,u,"Generator"),l(k,s,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=C,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
2h(T),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type="throw",o.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}},9611:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:function(){return r}})},9439:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(3878);var i=n(181),a=n(5267);function o(e,t){return(0,r.Z)(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}(e,t)||(0,i.Z)(e,t)||(0,a.Z)()}},3433:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(907);var i=n(9199),a=n(181);function o(e){return function(e){if(Array.isArray(e))return(0,r.Z)(e)}(e)||(0,i.Z)(e)||(0,a.Z)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},9142:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1002);function i(e){var t=function(e,t){if("object"!==(0,r.Z)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==(0,r.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===(0,r.Z)(t)?t:String(t)}},1002:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:function(){return r}})},181:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(907);function i(e,t){if(e){if("string"===typeof e)return(0,r.Z)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.Z)(e,t):void 0}}},8664:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(1120),i=n(9611);var a=n(5647);function o(e){var t="function"===typeof Map?new Map:void 0;return o=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,o)}function o(){return(0,a.Z)(e,arguments,(0,r.Z)(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(o,e)},o(e)}}},t={};function n(r){var i=t[r];
2if(void 0!==i)return i.exports;var a=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.m=e,n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,r){return n.f[r](e,t),t}),[]))},n.u=function(e){return"static/js/"+e+"."+{35:"234f880e",96:"4ff96bea",201:"a17e5e57",256:"b16443c5",290:"f5076d6d",296:"9d93b2ed",424:"101b174d",475:"4eb48367",492:"4132dc22",616:"7050a39d",675:"f0b984a9",784:"a17c0f46",787:"cda612ba",813:"4b1105ea",874:"8df15c61",937:"fd356672",976:"7bf9a52c",1068:"926c5f1e",1368:"a13a275f",1376:"aeb4a7bb",1408:"96835163",1421:"3410132a",1485:"e691aa8d",1529:"420b8b2e",1530:"30197888",1678:"1e3ab9e9",1712:"a0e803cd",1771:"88417222",1790:"69381477",1817:"09211330",1862:"456fe51a",1870:"243914a8",1901:"68ab5fe3",1941:"412f2a3f",2027:"94cdb77e",2046:"6d08a8af",2072:"7216aad2",2162:"220114e9",2192:"605a7345",2249:"91304252",2304:"2f2244c3",2332:"e2c4e9fa",2392:"3fd81ad8",2401:"090f2fe4",2427:"f388f685",2469:"4c99668b",2485:"ab1773e1",2742:"c5dd6340",2761:"4dd8bcdf",2793:"a46b8738",2945:"0304659d",2996:"cd6994a5",3012:"7104b176",3058:"6e800140",3224:"c38a50a2",3353:"bf519e4f",3459:"7c24fafa",3555:"363af885",3586:"d35f8bf6",3642:"7181612c",3718:"7a85b635",3769:"5d02d261",3791:"af779e9e",3958:"6808f318",4e3:"f81348a5",4022:"677410d0",4059:"0f5e7f72",4197:"2d035514",4307:"1914c2c3",4361:"e9b915c6",4597:"df9205ba",4604:"16de3b0a",4673:"521b098d",4701:"79ea9fba",4734:"265b6bec",4813:"a020eb5b",4815:"f67f0fa7",4816:"bfd2c0d6",4830:"b66fdf92",4854:"e4e4308e",4869:"fc73ceb3",4880:"611978c5",4987:"cb35b813",5e3:"98fb7a38",5181:"852953b8",5199:"42719dc5",5288:"9122c6e5",5391:"b5e3119c",5438:"edb80587",5509:"8e218b92",5546:"0fdedefa",5633:"b9b1833c",5677:"ad7954d4",5710:"55689d94",5719:"f61811db",5729:"9067ae39",5796:"437b8346",6055:"23bb8dd4",6191:"52ecc24b",6200:"325dc2fc",6275:"b0f14e17",6301:"924a2ffd",6324:"e8681094",6546:"a87c91ab",6769:"1c3a6f14",6967:"f8e17c7d",7003:"f18dea45",7019:"1cc4ae56",7047:"3ea3da87",7106:"85d280de",7133:"23e99c94",7181:"8d433438",7205:"07be4ad6",7298:"82d0d158",7403:"24508766",7568:"c72e3074",7598:"a11545ae",7743:"650cf55d",7766:"5898bda5",7770:"f5b40905",7999:"60487720",8053:"c1781c48",8068:"79a31e52",8123:"4e0942a7",8136:"794f992c",8176:"c3fc1357",8223:"d6e77c90",8250:"1a1b2df0",8350:"30e7bac0",8521:"b6a51abf",8555:"646dd5fd",8621:"1a3ea968",8675:"5725a9a5",8684:"22da9f88",8715:"7aec690c",8719:"af31287d",8785:"87d7150d",8967:"5a54ed22",8996:"559ccbf3",9038:"1dcc5d52",9080:"8deee655",9091:"18f08112",9225:"1cef1152",9244:"9a766a49",9258:"177cb528",9281:"00112f83",9361:"c330890d",9434:"d42730d6",9546:"0482194a",9697:"cf8f5e17",9712:"ba070f91",9716:"b9da16cb",9808:"bd46773e",9981:"f616a029"}[e]+".chunk.js"},n.miniCssF=function(e){},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="frontend:";n.l=function(r,i,a,o){if(e[r])e[r].push(i);else{var s,c;if(void 0!==a)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==r||d.getAttribute("data-webpack")==t+a){s=d;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+a),s.src=r),e[r]=[i];var p=function(t,n){s.onerror=s.onload=null,clearTimeout(h);var i=e[r];if(delete e[r],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((function(e){return e(n)})),t)return t(n)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}}}(),n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
2),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/",function(){var e={179:0};n.f.j=function(t,r){var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var a=new Promise((function(n,r){i=e[t]=[n,r]}));r.push(i[2]=a);var o=n.p+n.u(t),s=new Error;n.l(o,(function(r){if(n.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}}),"chunk-"+t,t)}};var t=function(t,r){var i,a,o=r[0],s=r[1],c=r[2],u=0;if(o.some((function(t){return 0!==e[t]}))){for(i in s)n.o(s,i)&&(n.m[i]=s[i]);if(c)c(n)}for(t&&t(r);u<o.length;u++)a=o[u],n.o(e,a)&&e[a]&&e[a][0](),e[a]=0},r=self.webpackChunkfrontend=self.webpackChunkfrontend||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}(),function(){"use strict";var e=n(2791),t=n(1250),r=n(4165),i=n(5861),a=n(9439),o=n(5671),s=n(3144),c=n(136),u=n(7277),l=function(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())}))},d=function(e,t,n){var r=t.className||t.class,i=n.className||n.class,a=f(e),o=f(r?r.split(" "):[]),s=f(i?i.split(" "):[]),c=[];return a.forEach((function(e){o.has(e)?(c.push(e),o.delete(e)):s.has(e)||c.push(e)})),o.forEach((function(e){return c.push(e)})),c.join(" ")},p=function(e){if("undefined"===typeof document)return!0;var t="on"+e,n=t in document;if(!n){var r=document.createElement("div");r.setAttribute(t,"return;"),n="function"===typeof r[t]}return n},h=function(e,t,n){var r=e.__events||(e.__events={}),i=r[t];i&&e.removeEventListener(t,i),e.addEventListener(t,r[t]=function(e){n&&n.call(this,e)})},f=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t},v=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach((function(t){!function(e,t){"function"===typeof e?e(t):null!=e&&(e.current=t)}(t,e)}))}},m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},g=function(t,n,r,i){void 0!==i&&i();var a=t.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(""),f=function(n){(0,c.Z)(f,n);var i=(0,u.Z)(f);function f(e){var t;return(0,o.Z)(this,f),(t=i.call(this,e)).setComponentElRef=function(e){t.componentEl=e},t}
2return(0,s.Z)(f,[{key:"componentDidMount",value:function(){this.componentDidUpdate(this.props)}},{key:"componentDidUpdate",value:function(e){!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e instanceof Element){var r=d(e.classList,t,n);""!==r&&(e.className=r),Object.keys(t).forEach((function(n){if("children"!==n&&"style"!==n&&"ref"!==n&&"class"!==n&&"className"!==n&&"forwardedRef"!==n)if(0===n.indexOf("on")&&n[2]===n[2].toUpperCase()){var r=n.substring(2),i=r[0].toLowerCase()+r.substring(1);p(i)||h(e,i,t[n])}else e[n]=t[n],"string"===typeof t[n]&&e.setAttribute(l(n),t[n])}))}}(this.componentEl,this.props,e)}},{key:"render",value:function(){var n=this.props,i=n.children,a=n.forwardedRef,o=n.style,s=(n.className,n.ref,m(n,["children","forwardedRef","style","className","ref"])),c=Object.keys(s).reduce((function(e,t){var n=s[t];if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var r=t.substring(2).toLowerCase();"undefined"!==typeof document&&p(r)&&(e[t]=n)}else{var i=typeof n;"string"!==i&&"boolean"!==i&&"number"!==i||(e[l(t)]=n)}return e}),{});r&&(c=r(this.props,c));var u=Object.assign(Object.assign({},c),{ref:v(a,this.setComponentElRef),style:o});return(0,e.createElement)(t,u,i)}}],[{key:"displayName",get:function(){return a}}]),f}(e.Component);return n&&(f.contextType=n),function(t,n){var r=function(n,r){return e.createElement(t,Object.assign({},n,{forwardedRef:r}))};return r.displayName=n,e.forwardRef(r)}(f,a)},y=(n(4164),n(4313));!function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}(),(0,y.q)();var b=g("dyte-meeting"),k=n(1252),_=(n(2725),n(5855),n(7622),n(6758),n(9666),n(6454),n(4402),n(4153),n(4130),n(8097)),w=(Object.defineProperty,{exports:{}}),x={};Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()||Object.assign;var S=e,E=60103;if(x.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var T=Symbol.for;E=T("react.element"),x.Fragment=T("react.fragment")}var P=S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,C=Object.prototype.hasOwnProperty,R={key:!0,ref:!0,__self:!0,__source:!0};function Z(e,t,n){var r,i={},a=null,o=null;for(r in void 0!==n&&(a=""+n),void 0!==t.key&&(a=""+t.key),void 0!==t.ref&&(o=t.ref),t)C.call(t,r)&&!R.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:E,type:e,key:a,ref:o,props:i,_owner:P.current}}x.jsx=Z,x.jsxs=Z,w.exports=x;w.exports.jsx,(0,e.createContext)({meeting:void 0,updates:void 0});var M="https://dyte-audio.fly.dev",A=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t){var n,i,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(M,"/meetings/").concat(t,"/participants"),{method:"POST",body:JSON.stringify({name:"new user",preset_name:"audio_proc_preset",meeting_id:t}),headers:{"Content-Type":"application/json"}});case 2:return n=e.sent,e.next=5,n.json();case 5:return i=e.sent,a=JSON.parse(i.detail),e.abrupt("return",a.data.token);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),I=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(M,"/multiple_voices_list"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({meeting_id:window.location.pathname.split("/")[2],admin_id:window.localStorage.getItem("adminId")||"undefined"})});case 2:return t=e.sent,e.next=5,t.json();case 5:if(!(n=e.sent).details){e.next=8;break}return e.abrupt("return",void 0);case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=n(184),L=function(){var t=(0,e.useState)([]),n=(0,a.Z)(t,2),o=n[0],s=n[1],c=(0,e.useState)(""),u=(0,a.Z)(c,2),l=(u[0],u[1]),d=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,I();case 3:t=e.sent,s(t),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),l("User don't have admin privileges.");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();return(0,e.useEffect)((function(){if(null!==o&&void 0!==o&&o.map){var e=setInterval((function(){d()}),3e4);return function(){clearInterval(e)}}}),[o]),(0,O.jsx)(O.Fragment,{children:(0,O.jsx)("div",{style:{padding:"0px 20px"},children:null!==o&&void 0!==o&&o.map&&o?o.map((function(e){return(0,O.jsxs)("div",{style:{display:"flex",justifyContent:"start",margin:"50px 20px"},children:[(0,O.jsx)("div",{style:{marginRight:"20px"},children:(0,O.jsx)("img",{src:"https://images.yourstory.com/cs/images/companies/Dyte-1608553297314.jpg",style:{borderRadius:"50px",height:"60px",border:"1px double lightblue"}})}),(0,O.jsx)("div",{style:{textAlign:"center",padding:"20px",backgroundColor:"#2160fd",fontSize:"large",fontWeight:"400",borderRadius:"10px 10px 10px 10px",width:"80%"},children:(0,O.jsxs)("div",{style:{color:"white",padding:"20px 0px",textAlign:"left"},children:[e[4].split("<>").map((function(e){return(0,O.jsx)("div",{children:e})})),(0,O.jsxs)("div",{children:["Timestamp: ",new Date(e[0]).toLocaleStr
2ing()]})]})})]})})):(0,O.jsx)("div",{style:{color:"white"},children:"Wait or check if you have admin privileges to access the proctoring dashboard."})})})},D=function(e){var t=e.text;return(0,O.jsx)("div",{className:"heading-proctor",style:{padding:"10px",textAlign:"center",backgroundColor:"#000",borderBottom:"solid 0.5px gray"},children:t})},N=n(8350),j="https://dyte-audio.fly.dev",B=0;function U(e){for(var t=e.length,n=new Int16Array(t);t--;)n[t]=32767*Math.min(1,e[t]);return n}var V=function(){var t=(0,e.useRef)(),n=function(){var t=(0,e.useRef)(!1),n=(0,e.useState)(),o=(0,a.Z)(n,2),s=o[0],c=o[1],u=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.current){e.next=2;break}return e.abrupt("return",void 0);case 2:return t.current=!0,e.prev=3,e.next=6,_.Z.init(n);case 6:return i=e.sent,c(i),i.self.on("roomLeft",(function(){return c(void 0)})),e.abrupt("return",i);case 12:e.prev=12,e.t0=e.catch(3);case 14:return e.prev=14,t.current=!1,e.finish(14);case 17:return e.abrupt("return",void 0);case 18:case"end":return e.stop()}}),e,null,[[3,12,14,17]])})));return function(t){return e.apply(this,arguments)}}();return[s,u]}(),o=(0,a.Z)(n,2),s=o[0],c=o[1],u=(0,e.useState)(),l=(0,a.Z)(u,2),d=l[0],p=l[1],h=(0,e.useState)(null),f=(0,a.Z)(h,2),v=f[0],m=f[1],g=window.location.pathname.split("/")[2];function y(e){return w.apply(this,arguments)}function w(){return(w=(0,i.Z)((0,r.Z)().mark((function e(t){var n,i,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.createScriptProcessor(1024,1,1),i=new N.d(1,44100,128),512,a=[],n.onaudioprocess=function(e){var t=e.inputBuffer.getChannelData(0),n=i.encodeBuffer(U(t));n.length>0&&a.push(n);var r=Date.now();if(a.length>=512&&r-B>6e4){B=r;var o=new File(a,"audio.mp3"),c=new FormData;c.append("file",o),c.append("meeting_id",g),c.append("participant_id",null===s||void 0===s?void 0:s.self.id),c.append("participant_name",null===s||void 0===s?void 0:s.self.name),fetch("".concat(j,"/multiple_voices"),{method:"POST",body:c}),a=[]}},e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t){var n,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(j,"/is_admin"),{method:"POST",body:JSON.stringify({admin_id:window.localStorage.getItem("adminId")||"",meeting_id:g||""}),headers:{"Content-Type":"application/json"}});case 2:return n=e.sent,e.next=5,n.json();case 5:i=e.sent,m(i.admin);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),S=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!g){e.next=7;break}return e.next=3,A(g);case 3:return t=e.sent,e.next=6,c({authToken:t});case 6:p(t);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,e.useEffect)((function(){g&&!d&&S(),x()}),[]),(0,e.useEffect)((function(){d&&(0,k.p)(t.current,{theme:"dark"})}),[d]),(0,e.useEffect)((function(){return!1===v&&null!==s&&void 0!==s&&s.self&&s.self.addAudioMiddleware(y),function(){!1===v&&null!==s&&void 0!==s&&s.self&&s.self.removeAudioMiddleware(y)}}),[null===s||void 0===s?void 0:s.self,v]),(0,O.jsx)("div",{style:{height:"96vh",width:"100vw",display:"flex"},children:d&&(0,O.jsxs)(O.Fragment,{children:[v&&(0,O.jsxs)("div",{style:{width:"40vw",height:"100vh",overflowY:"scroll",backgroundColor:"black",borderRight:"solid 0.5px gray"},children:[(0,O.jsx)(D,{text:"Proctoring Information"}),(0,O.jsx)(L,{meeting:s})]}),v?(0,O.jsxs)("div",{style:{width:"60vw",height:"96vh"},children:[(0,O.jsx)(D,{text:"Proctoring Admin Interface"}),(0,O.jsx)(b,{mode:"fill",meeting:s,ref:t})]}):(0,O.jsxs)("div",{style:{width:"100vw",height:"96vh"},children:[(0,O.jsx)(D,{text:"Proctoring Candidate Interface"}),(0,O.jsx)(b,{mode:"fill",meeting:s,ref:t})]})]})})},F=n(3433),z=n(8664),H=n(3878),q=n(9199),G=n(181),W=n(5267);var J,$=n(7762);function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(J||(J={}));var Q,Y="popstate";function X(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function ee(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function te(e,t){return{usr:e.state,key:e.key,idx:t}}function ne(e,t,n,r){return void 0===n&&(n=null),K({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?ie(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function re(e){var t=e.pathname,n=void 0===t?"/":t,r=e.search,i=void 0===r?"":r,a=e.hash,o=void 0===a?"":a;return i&&"?"!==i&&(n+="?"===i.charAt(0)?i:"?"+i),o&&"#"!==o&&(n+="#"===o.charAt(0)?o:"#"+o),n}function ie(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ae(e,t,n,r){void 0===r&&(r={});var i=r,a=i.window,o=void 0===a?document.defaultView:a,s=i.v5Compat,c=void 0!==s&&s,u=o.history,l=J.Pop,d=null,p=h();function h(){return(u.state||{idx:null}).idx}function f(){l=J.Pop;var e=h(),t=null==e?null:e-p;p=e,d&&d({action:l,location:m.location,delta:t})}function v(e){var t="null"!==o.location.origin?o.location.origin:o.location.href,n="string"===typeof e?e:re(e);return X(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==p&&(p=0,u.replaceState(K({},u.state,{idx:p}),""));var m={get action(){return l},get location(){return e(o,u)},listen:function(e){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Y,f),d=e,function(){o.removeEventListener(Y,f),d=null}},createHref:function(e){return t(o,e)},createURL:v,encodeLocation:function(e){var t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=J.Push;var r=ne(m.location,e,t);n&&n(r,e);var i=te(r,p=h()+1),a=m.createHref(r);try{u.pushState(i,"",a)}catch(s){o.location.assign(a)}c&&d&&d({action:l,location:m.location,delta:1})},replace:function(e,t){l=J.Replace;var r=ne(m.location,e,t);n&&n(r,e);var i=te(r,p=h()),a=m.createHref(r);u.replaceState(i,"",a),c&&d&&d({action:l,location:m.location,delta:0})},go:function(e){return u.go(e)}};return m}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(Q||(Q={}));
2new Set(["lazy","caseSensitive","path","id","index","children"]);function oe(e,t,n){void 0===n&&(n="/");var r=ke(("string"===typeof t?ie(t):t).pathname||"/",n);if(null==r)return null;var i=se(e);!function(e){e.sort((function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var n=e.length===t.length&&e.slice(0,-1).every((function(e,n){return e===t[n]}));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((function(e){return e.childrenIndex})),t.routesMeta.map((function(e){return e.childrenIndex})))}))}(i);for(var a=null,o=0;null==a&&o<i.length;++o)a=ge(i[o],be(r));return a}function se(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");var i=function(e,i,a){var o={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};o.relativePath.startsWith("/")&&(X(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));var s=Se([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(X(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),se(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:me(s,e.index),routesMeta:c})};return e.forEach((function(e,t){var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?")){var r,a=(0,$.Z)(ce(e.path));try{for(a.s();!(r=a.n()).done;){var o=r.value;i(e,t,o)}}catch(s){a.e(s)}finally{a.f()}}else i(e,t)})),t}function ce(e){var t=e.split("/");if(0===t.length)return[];var n,r=(n=t,(0,H.Z)(n)||(0,q.Z)(n)||(0,G.Z)(n)||(0,W.Z)()),i=r[0],a=r.slice(1),o=i.endsWith("?"),s=i.replace(/\?$/,"");if(0===a.length)return o?[s,""]:[s];var c=ce(a.join("/")),u=[];return u.push.apply(u,(0,F.Z)(c.map((function(e){return""===e?s:[s,e].join("/")})))),o&&u.push.apply(u,(0,F.Z)(c)),u.map((function(t){return e.startsWith("/")&&""===t?"/":t}))}var ue=/^:\w+$/,le=3,de=2,pe=1,he=10,fe=-2,ve=function(e){return"*"===e};function me(e,t){var n=e.split("/"),r=n.length;return n.some(ve)&&(r+=fe),t&&(r+=de),n.filter((function(e){return!ve(e)})).reduce((function(e,t){return e+(ue.test(t)?le:""===t?pe:he)}),r)}function ge(e,t){for(var n=e.routesMeta,r={},i="/",a=[],o=0;o<n.length;++o){var s=n[o],c=o===n.length-1,u="/"===i?t:t.slice(i.length)||"/",l=ye({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},u);if(!l)return null;
2Object.assign(r,l.params);var d=s.route;a.push({params:r,pathname:Se([i,l.pathname]),pathnameBase:Ee(Se([i,l.pathnameBase])),route:d}),"/"!==l.pathnameBase&&(i=Se([i,l.pathnameBase]))}return a}function ye(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});var n=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);ee("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');var r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(function(e,t){return r.push(t),"/([^\\/]+)"}));e.endsWith("*")?(r.push("*"),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");var a=new RegExp(i,t?void 0:"i");return[a,r]}(e.path,e.caseSensitive,e.end),r=(0,a.Z)(n,2),i=r[0],o=r[1],s=t.match(i);if(!s)return null;var c=s[0],u=c.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:o.reduce((function(e,t,n){if("*"===t){var r=l[n]||"";u=c.slice(0,c.length-r.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return ee(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(l[n]||"",t),e}),{}),pathname:c,pathnameBase:u,pattern:e}}function be(e){try{return decodeURI(e)}catch(t){return ee(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function ke(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;var n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function _e(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function we(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function xe(e,t,n,r){var i;void 0===r&&(r=!1),"string"===typeof e?i=ie(e):(X(!(i=K({},e)).pathname||!i.pathname.includes("?"),_e("?","pathname","search",i)),X(!i.pathname||!i.pathname.includes("#"),_e("#","pathname","hash",i)),X(!i.search||!i.search.includes("#"),_e("#","search","hash",i)));var a,o=""===e||""===i.pathname,s=o?"/":i.pathname;if(r||null==s)a=n;else{var c=t.length-1;if(s.startsWith("..")){for(var u=s.split("/");".."===u[0];)u.shift(),c-=1;i.pathname=u.join("/")}a=c>=0?t[c]:"/"}var l=function(e,t){void 0===t&&(t="/");var n="string"===typeof e?ie(e):e,r=n.pathname,i=n.search,a=void 0===i?"":i,o=n.hash,s=void 0===o?"":o,c=r?r.startsWith("/")?r:function(e,t){var n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((function(e){".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(r,t):t;return{pathname:c,search:Te(a),hash:Pe(s)}}(i,a),d=s&&"/"!==s&&s.endsWith("/"),p=(o||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!d&&!p||(l.pathname+="/"),l}var Se=function(e){return e.join("/").replace(/\/\/+/g,"/")},Ee=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},Te=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},Pe=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},Ce=function(e){(0,c.Z)(n,e);var t=(0,u.Z)(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n)}((0,z.Z)(Error));function Re(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var Ze=["post","put","patch","delete"],Me=(new Set(Ze),["get"].concat(Ze));new Set(Me),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!==typeof window&&"undefined"!==typeof window.document&&window.document.createElement;Symbol("deferred");function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ae.apply(this,arguments)}var Ie=e.createContext(null);var Oe=e.createContext(null);var Le=e.createContext(null);var De=e.createContext(null);var Ne=e.createContext(null);var je=e.createContext({outlet:null,matches:[],isDataRoute:!1});var Be=e.createContext(null);function Ue(){return null!=e.useContext(Ne)}function Ve(){return Ue()||X(!1),e.useContext(Ne).location}function Fe(t){e.useContext(De).static||e.useLayoutEffect(t)}function ze(){return e.useContext(je).isDataRoute?function(){var t=Xe(We.UseN
2avigateStable).router,n=tt(Je.UseNavigateStable),r=e.useRef(!1);return Fe((function(){r.current=!0})),e.useCallback((function(e,i){void 0===i&&(i={}),r.current&&("number"===typeof e?t.navigate(e):t.navigate(e,Ae({fromRouteId:n},i)))}),[t,n])}():function(){Ue()||X(!1);var t=e.useContext(Ie),n=e.useContext(De),r=n.basename,i=n.navigator,a=e.useContext(je).matches,o=Ve().pathname,s=JSON.stringify(we(a).map((function(e){return e.pathnameBase}))),c=e.useRef(!1);return Fe((function(){c.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),c.current)if("number"!==typeof e){var a=xe(e,JSON.parse(s),o,"path"===n.relative);null==t&&"/"!==r&&(a.pathname="/"===a.pathname?r:Se([r,a.pathname])),(n.replace?i.replace:i.push)(a,n.state,n)}else i.go(e)}),[r,i,s,o,t])}()}function He(t,n){var r=(void 0===n?{}:n).relative,i=e.useContext(je).matches,a=Ve().pathname,o=JSON.stringify(we(i).map((function(e){return e.pathnameBase})));return e.useMemo((function(){return xe(t,JSON.parse(o),a,"path"===r)}),[t,o,a,r])}function qe(t,n,r){Ue()||X(!1);var i,a=e.useContext(De).navigator,o=e.useContext(je).matches,s=o[o.length-1],c=s?s.params:{},u=(s&&s.pathname,s?s.pathnameBase:"/"),l=(s&&s.route,Ve());if(n){var d,p="string"===typeof n?ie(n):n;"/"===u||(null==(d=p.pathname)?void 0:d.startsWith(u))||X(!1),i=p}else i=l;var h=i.pathname||"/",f=oe(t,{pathname:"/"===u?h:h.slice(u.length)||"/"});var v=Ye(f&&f.map((function(e){return Object.assign({},e,{params:Object.assign({},c,e.params),pathname:Se([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:Se([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})})),o,r);return n&&v?e.createElement(Ne.Provider,{value:{location:Ae({pathname:"/",search:"",hash:"",state:null,key:"default"},i),navigationType:J.Pop}},v):v}function Ge(){var t=function(){var t,n=e.useContext(Be),r=et(Je.UseRouteError),i=tt(Je.UseRouteError);if(n)return n;return null==(t=r.errors)?void 0:t[i]}(),n=Re(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},n),r?e.createElement("pre",{style:a},r):null,null)}var We,Je,$e=e.createElement(Ge,null),Ke=function(t){(0,c.Z)(r,t);var n=(0,u.Z)(r);function r(e){var t;return(0,o.Z)(this,r),(t=n.call(this,e)).state={location:e.location,revalidation:e.revalidation,error:e.error},t}return(0,s.Z)(r,[{key:"componentDidCatch",value:function(e,t){console.error("React Router caught the following error during render",e,t)}},{key:"render",value:function(){return this.state.error?e.createElement(je.Provider,{value:this.props.routeContext},e.createElement(Be.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{error:e}}},{key:"getDerivedStateFromProps",value:function(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}}]),r}(e.Component);function Qe(t){var n=t.routeContext,r=t.match,i=t.children,a=e.useContext(Ie);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(je.Provider,{value:n},i)}function Ye(t,n,r){var i;if(void 0===n&&(n=[]),void 0===r&&(r=null),null==t){var a;if(null==(a=r)||!a.errors)return null;t=r.matches}var o=t,s=null==(i=r)?void 0:i.errors;if(null!=s){var c=o.findIndex((function(e){return e.route.id&&(null==s?void 0:s[e.route.id])}));c>=0||X(!1),o=o.slice(0,Math.min(o.length,c+1))}return o.reduceRight((function(t,i,a){var c=i.route.id?null==s?void 0:s[i.route.id]:null,u=null;r&&(u=i.route.errorElement||$e);var l=n.concat(o.slice(0,a+1)),d=function(){var n;return n=c?u:i.route.Component?e.createElement(i.route.Component,null):i.route.element?i.route.element:t,e.createElement(Qe,{match:i,routeContext:{outlet:t,matches:l,isDataRoute:null!=r},children:n})};return r&&(i.route.ErrorBoundary||i.route.errorElement||0===a)?e.createElement(Ke,{location:r.location,revalidation:r.revalidation,component:u,error:c,children:d(),routeC
2ontext:{outlet:null,matches:l,isDataRoute:!0}}):d()}),null)}function Xe(t){var n=e.useContext(Ie);return n||X(!1),n}function et(t){var n=e.useContext(Oe);return n||X(!1),n}function tt(t){var n=function(t){var n=e.useContext(je);return n||X(!1),n}(),r=n.matches[n.matches.length-1];return r.route.id||X(!1),r.route.id}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(We||(We={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(Je||(Je={}));var nt;function rt(e){X(!1)}function it(t){var n=t.basename,r=void 0===n?"/":n,i=t.children,a=void 0===i?null:i,o=t.location,s=t.navigationType,c=void 0===s?J.Pop:s,u=t.navigator,l=t.static,d=void 0!==l&&l;Ue()&&X(!1);var p=r.replace(/^\/*/,"/"),h=e.useMemo((function(){return{basename:p,navigator:u,static:d}}),[p,u,d]);"string"===typeof o&&(o=ie(o));var f=o,v=f.pathname,m=void 0===v?"/":v,g=f.search,y=void 0===g?"":g,b=f.hash,k=void 0===b?"":b,_=f.state,w=void 0===_?null:_,x=f.key,S=void 0===x?"default":x,E=e.useMemo((function(){var e=ke(m,p);return null==e?null:{location:{pathname:e,search:y,hash:k,state:w,key:S},navigationType:c}}),[p,m,y,k,w,S,c]);return null==E?null:e.createElement(De.Provider,{value:h},e.createElement(Ne.Provider,{children:a,value:E}))}function at(e){var t=e.children,n=e.location;return qe(st(t),n)}!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(nt||(nt={}));var ot=new Promise((function(){}));e.Component;function st(t,n){void 0===n&&(n=[]);var r=[];return e.Children.forEach(t,(function(t,i){if(e.isValidElement(t)){var a=[].concat((0,F.Z)(n),[i]);if(t.type!==e.Fragment){t.type!==rt&&X(!1),t.props.index&&t.props.children&&X(!1);var o={id:t.props.id||a.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(o.children=st(t.props.children,a)),r.push(o)}else r.push.apply(r,st(t.props.children,a))}})),r}function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ct.apply(this,arguments)}function ut(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var lt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function dt(t){var n,r=t.basename,i=t.children,o=t.window,s=e.useRef();null==s.current&&(s.current=(void 0===(n={window:o,v5Compat:!0})&&(n={}),ae((function(e,t){var n=e.location;return ne("",{pathname:n.pathname,search:n.search,hash:n.hash},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:re(t)}),null,n)));var c=s.current,u=e.useState({action:c.action,location:c.location}),l=(0,a.Z)(u,2),d=l[0],p=l[1];return e.useLayoutEffect((function(){return c.listen(p)}),[c]),e.createElement(it,{basename:r,children:i,location:d.location,navigationType:d.action,navigator:c})}var pt="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,ht=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ft=e.forwardRef((function(t,n){var r,i=t.onClick,a=t.relative,o=t.reloadDocument,s=t.replace,c=t.state,u=t.target,l=t.to,d=t.preventScrollReset,p=ut(t,lt),h=e.useContext(De).basename,f=!1;if("string"===typeof l&&ht.test(l)&&(r=l,pt))try{var v=new URL(window.location.href),m=l.startsWith("//")?new URL(v.protocol+l):new URL(l),g=ke(m.pathname,h);m.origin===v.origin&&null!=g?l=g+m.search+m.hash:f=!0}catch(k){}var y=function(t,n){var r=(void 0===n?{}:n).relative;Ue()||X(!1);var i=e.useContext(De),a=i.basename,o=i.navigator,s=He(t,{relative:r}),c=s.hash,u=s.pathname,l=s.search,d=u;return"/"!==a&&(d="/"===u?a:Se([a,u])),o.createHref({pathname:d,search:l,hash:c})}(l,{relative:a}),b=function(t,n){var r=void 0===n?{}:n,i=r.target,a=r.replace,o=r.state,s=r.preventScrollReset,c=r.relative,u=ze(),l=Ve(),d=He(t,{relative:c}
2);return e.useCallback((function(e){if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(e,i)){e.preventDefault();var n=void 0!==a?a:re(l)===re(d);u(t,{replace:n,state:o,preventScrollReset:s,relative:c})}}),[l,u,d,a,o,i,t,s,c])}(l,{replace:s,state:c,target:u,preventScrollReset:d,relative:a});return e.createElement("a",ct({},p,{href:r||y,onClick:f||o?i:function(e){i&&i(e),e.defaultPrevented||b(e)},ref:n,target:u}))}));var vt,mt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(vt||(vt={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(mt||(mt={}));var gt=function(e){var t=e.meetingId;return(0,O.jsx)("div",{style:{height:"100vh",width:"100vw",fontSize:"x-large",display:"flex",justifyContent:"center",alignItems:"center",color:"white  "},children:t&&!window.location.pathname.split("/")[2]&&(0,O.jsx)(O.Fragment,{children:(0,O.jsx)("div",{children:(0,O.jsx)(ft,{to:"/meeting/".concat(t),children:"Create and Join Meeting"})})})})};var yt=function(){var t=(0,e.useState)(),n=(0,a.Z)(t,2),o=n[0],s=n[1],c=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat("https://dyte-audio.fly.dev","/meetings"),{method:"POST",body:JSON.stringify({title:"Joint Entrance Examination"}),headers:{"Content-Type":"application/json"}});case 2:return t=e.sent,e.next=5,t.json();case 5:n=e.sent,window.localStorage.setItem("adminId",n.admin_id),s(n.data.id);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,e.useEffect)((function(){window.localStorage.removeItem("refImgUrl"),window.location.pathname.split("/")[2]||c()}),[]),(0,O.jsx)(dt,{children:(0,O.jsxs)(at,{children:[(0,O.jsx)(rt,{path:"/",element:(0,O.jsx)(gt,{meetingId:o})}),(0,O.jsx)(rt,{path:"/meeting/:meetingId",element:(0,O.jsx)(V,{})})]})})},bt=function(e){e&&e instanceof Function&&n.e(787).then(n.bind(n,787)).then((function(t){var n=t.getCLS,r=t.getFID,i=t.getFCP,a=t.getLCP,o=t.getTTFB;n(e),r(e),i(e),a(e),o(e)}))};t.createRoot(document.getElementById("root")).render((0,O.jsx)(e.StrictMode,{children:(0,O.jsx)(yt,{})})),bt()}()}();
3//# sourceMappingURL=main.48ebaacd.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.