@snapcall/stream-ui 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stream-ui.esm.js +39 -31
- package/dist/stream-ui.js +39 -31
- package/dist/stream-ui.umd.js +200 -200
- package/package.json +1 -1
package/dist/stream-ui.umd.js
CHANGED
|
@@ -302,14 +302,14 @@ to {
|
|
|
302
302
|
/*! iNoBounce - v0.2.0
|
|
303
303
|
* https://github.com/lazd/iNoBounce/
|
|
304
304
|
* Copyright (c) 2013 Larry Davis <lazdnet@gmail.com>; Licensed BSD */
|
|
305
|
-
!function(e){var t=0,r=!1,n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,i)}catch(e){}var a=function(e){var r=e.target,n=window.innerWidth/window.document.documentElement.clientWidth;if(!(e.touches.length>1||1!==n)){for(;r!==document.body&&r!==document;){var i=window.getComputedStyle(r);if(!i)break;if("INPUT"===r.nodeName&&"range"===r.getAttribute("type"))return;var a=i.getPropertyValue("-webkit-overflow-scrolling"),o=i.getPropertyValue("overflow-y"),s=parseInt(i.getPropertyValue("height"),10),c="touch"===a&&("auto"===o||"scroll"===o),l=r.scrollHeight>r.offsetHeight;if(c&&l){var d=e.touches?e.touches[0].screenY:e.screenY,u=t<=d&&0===r.scrollTop,p=t>=d&&r.scrollHeight-r.scrollTop===s;return void((u||p)&&e.preventDefault())}r=r.parentNode}e.preventDefault()}},o=function(e){t=e.touches?e.touches[0].screenY:e.screenY},s=function(){window.addEventListener("touchstart",o,!!n&&{passive:!1}),window.addEventListener("touchmove",a,!!n&&{passive:!1}),r=!0},c=document.createElement("div");document.documentElement.appendChild(c),c.style.WebkitOverflowScrolling="touch";var l="getComputedStyle"in window&&"touch"===window.getComputedStyle(c)["-webkit-overflow-scrolling"];document.documentElement.removeChild(c),l&&s();var d={enable:s,disable:function(){window.removeEventListener("touchstart",o,!1),window.removeEventListener("touchmove",a,!1),r=!1},isEnabled:function(){return r},isScrollSupported:l};Ar&&(Ar=d),"function"==typeof e.define?(0,e.define)("iNoBounce",[],(function(){return d})):e.iNoBounce=d}(Ar);var tn={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},rn=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.init(t,r)}return zr(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||tn,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,en(en({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}()),nn=function(){function e(){Br(this,e),this.observers={}}return zr(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,r)}))}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach((function(t){t.apply(t,[e].concat(r))}))}}}]),e}();function an(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function on(e){return null==e?"":""+e}function sn(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function cn(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var a="string"!=typeof t?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=n(a.shift());!e[o]&&r&&(e[o]=new r),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return i()?{}:{obj:e,k:n(a.shift())}}function ln(e,t,r){var n=cn(e,t,Object);n.obj[n.k]=r}function dn(e,t){var r=cn(e,t),n=r.obj,i=r.k;if(n)return n[i]}function un(e,t,r){var n=dn(e,r);return void 0!==n?n:dn(t,r)}function pn(e,t,r){for(var n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?r&&(e[n]=t[n]):pn(e[n],t[n],r):e[n]=t[n]);return e}function hn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var fn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function mn(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return fn[e]})):e}var gn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,vn=[" ",",","?","!",";"];function yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wn(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}function xn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,a=0;a<n.length;++a){if(!i)return;if("string"==typeof i[n[a]]&&a+1<n.length)return;if(void 0===i[n[a]]){for(var o=2,s=n.slice(a,a+o).join(r),c=i[s];void 0===c&&n.length>a+o;)o++,c=i[s=n.slice(a,a+o).join(r)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(s)){if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s]}var l=n.slice(a+o).join(r);return l?xn(c,l,r):void 0}i=i[n[a]]}return i}}var _n=function(e){Hr(r,e);var t=wn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Br(this,r),n=t.call(this),gn&&nn.call(Ur(n)),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return zr(r,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,t];r&&"string"!=typeof r&&(o=o.concat(r)),r&&"string"==typeof r&&(o=o.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(o=e.split("."));var s=dn(this.data,o);return s||!a||"string"!=typeof r?s:xn(this.data&&this.data[e]&&this.data[e][t],r,i)}},{key:"addResource",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var o=[e,t];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(n=t,t=(o=e.split("."))[1]),this.addNamespaces(t),ln(this.data,o,n),i.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in r)"string"!=typeof r[i]&&"[object Array]"!==Object.prototype.toString.apply(r[i])||this.addResource(e,t,i,r[i],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(o=e.split("."))[1]),this.addNamespaces(t);var s=dn(this.data,o)||{};n?pn(s,r,i):s=bn(bn({},s),r),ln(this.data,o,s),a.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?bn(bn({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),r}(nn),Sn={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var a=this;return e.forEach((function(e){a.processors[e]&&(t=a.processors[e].process(t,r,n,i))})),t}};function kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function En(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}var Rn={},Pn=function(e){Hr(r,e);var t=En(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Br(this,r),n=t.call(this),gn&&nn.call(Ur(n)),sn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,Ur(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=rn.create("translator"),n}return zr(r,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],a=r&&e.indexOf(r)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var n=vn.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(0===n.length)return!0;var i=new RegExp("(".concat(n.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),a=!i.test(e);if(!a){var o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a}(e,r,n));if(a&&!o){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};var c=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(n)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,n){var i=this;if("object"!==Nr(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),c=s.key,l=s.namespaces,d=l[l.length-1],u=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return a?(f.res="".concat(d).concat(h).concat(c),f):"".concat(d).concat(h).concat(c)}return a?(f.res=c,f):c}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||c,v=f&&f.exactUsedKey||c,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,_="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&_&&b.indexOf(y)<0&&("string"!=typeof w||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Cn(Cn({},t),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(f.res=S,f):S}if(o){var k="[object Array]"===y,C=k?[]:{},E=k?v:g;for(var R in m)if(Object.prototype.hasOwnProperty.call(m,R)){var P="".concat(E).concat(o).concat(R);C[R]=this.translate(P,Cn(Cn({},t),{joinArrays:!1,ns:l})),C[R]===P&&(C[R]=m[R])}m=C}}else if(x&&"string"==typeof w&&"[object Array]"===y)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,n));else{var T=!1,j=!1,O=void 0!==t.count&&"string"!=typeof t.count,M=r.hasDefaultValue(t),I=O?this.pluralResolver.getSuffix(u,t.count,t):"",L=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(m)&&M&&(T=!0,m=L),this.isValidLookup(m)||(j=!0,m=c);var D=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,A=D&&j?void 0:m,N=M&&L!==m&&this.options.updateMissing;if(j||T||N){if(this.logger.log(N?"updateKey":"missingKey",u,d,c,N?L:m),o){var B=this.resolve(c,Cn(Cn({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var U=0;U<z.length;U++)F.push(z[U]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var V=function(e,r,n){var a=M&&n!==m?n:A;i.options.missingKeyHandler?i.options.missingKeyHandler(e,d,r,a,N,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,d,r,a,N,t),i.emit("missingKey",e,d,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(r){V([e],c+r,t["defaultValue".concat(r)]||L)}))})):V(F,c,L))}m=this.extendTranslation(m,e,t,f,n),j&&m===c&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(c)),(j||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(c):c,T?m:void 0):this.options.parseMissingKeyHandler(m))}return a?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,r,n,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Cn(Cn({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(Cn(Cn({},r),{interpolation:Cn(Cn({},this.options.interpolation),r.interpolation)}));var o,s="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var c=e.match(this.interpolator.nestingRegexp);o=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=Cn(Cn({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),s){var d=e.match(this.interpolator.nestingRegexp);o<(d&&d.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return i&&i[0]===n[0]&&!r.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):a.translate.apply(a,n.concat([t]))}),r)),r.interpolation&&this.interpolator.reset()}var u=r.postProcess||this.options.postProcess,p="string"==typeof u?[u]:u;return null!=e&&p&&p.length&&!1!==r.applyPostProcessor&&(e=Sn.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Cn({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,i,a,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!o.isValidLookup(t)){var c=o.extractFromKey(e,s),l=c.key;r=l;var d=c.namespaces;o.options.fallbackNS&&(d=d.concat(o.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,p=u&&!s.ordinal&&0===s.count&&o.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);d.forEach((function(e){o.isValidLookup(t)||(a=e,!Rn["".concat(f[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(a)&&(Rn["".concat(f[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(r,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(r){if(!o.isValidLookup(t)){i=r;var a,c=[l];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(c,l,r,e,s);else{var d;u&&(d=o.pluralResolver.getSuffix(r,s.count,s));var f="".concat(o.options.pluralSeparator,"zero");if(u&&(c.push(l+d),p&&c.push(l+f)),h){var m="".concat(l).concat(o.options.contextSeparator).concat(s.context);c.push(m),u&&(c.push(m+d),p&&c.push(m+f))}}for(;a=c.pop();)o.isValidLookup(t)||(n=a,t=o.getResource(r,e,a,s))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:i,usedNS:a}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),r}(nn);function Tn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var jn=function(){function e(t){Br(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rn.create("languageUtils")}return zr(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tn(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tn(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=Tn(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach((function(e){if(!t){var n=r.formatLanguageCode(e);r.options.supportedLngs&&!r.isSupportedCode(n)||(t=n)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find((function(e){if(0===e.indexOf(n))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],a=function(e){e&&(r.isSupportedCode(e)?i.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),n.forEach((function(e){i.indexOf(e)<0&&a(r.formatLanguageCode(e))})),i}}]),e}(),On=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Mn={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},In=["v1","v2","v3"],Ln={zero:0,one:1,two:2,few:3,many:4,other:5};function Dn(){var e={};return On.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:Mn[t.fc]}}))})),e}var An=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.languageUtils=t,this.options=r,this.logger=rn.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Dn()}return zr(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((function(e,t){return Ln[e]-Ln[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):n.numbers.map((function(n){return t.getSuffix(e,n,r)})):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var a=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?a():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!In.includes(this.options.compatibilityJSON)}}]),e}();function Nn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=rn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return zr(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:mn,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?hn(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?hn(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?hn(t.nestingPrefix):t.nestingPrefixEscaped||hn("$t("),this.nestingSuffix=t.nestingSuffix?hn(t.nestingSuffix):t.nestingSuffixEscaped||hn(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var i,a,o,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var d=function(e){if(e.indexOf(s.formatSeparator)<0){var i=un(t,c,e);return s.alwaysFormat?s.format(i,void 0,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:e})):i}var a=e.split(s.formatSeparator),o=a.shift().trim(),l=a.join(s.formatSeparator).trim();return s.format(un(t,c,o),l,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:o}))};this.resetRegExp();var u=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?l(s.escape(e)):l(e)}}].forEach((function(t){for(o=0;i=t.regex.exec(e);){var r=i[1].trim();if(void 0===(a=d(r)))if("function"==typeof u){var c=u(e,i,n);a="string"==typeof c?c:""}else if(n&&n.hasOwnProperty(r))a="";else{if(p){a=i[0];continue}s.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),a=""}else"string"==typeof a||s.useRawValueToEscape||(a=on(a));var l=t.safeValue(a);if(e=e.replace(i[0],l),p?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++o>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,n,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Bn({},a);function s(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),i="{".concat(n[1]);e=n[0],i=(i=this.interpolate(i,o)).replace(/'/g,'"');try{o=JSON.parse(i),t&&(o=Bn(Bn({},t),o))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(i)}return delete o.defaultValue,e}for(o.applyPostProcessor=!1,delete o.defaultValue;r=this.nestingRegexp.exec(e);){var c=[],l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var d=r[1].split(this.formatSeparator).map((function(e){return e.trim()}));r[1]=d.shift(),c=d,l=!0}if((n=t(s.call(this,r[1].trim(),o),o))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=on(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),l&&(n=c.reduce((function(e,t){return i.format(e,t,a.lng,Bn(Bn({},a),{},{interpolationkey:r[1].trim()}))}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();function zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=rn.create("formatter"),this.options=t,this.formats={number:function(e,t,r){return new Intl.NumberFormat(t,r).format(e)},currency:function(e,t,r){return new Intl.NumberFormat(t,Un(Un({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,Un({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,Un({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,Un({},r)).format(e)}},this.init(t)}return zr(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"format",value:function(e,t,r,n){var i=this;return t.split(this.formatSeparator).reduce((function(e,t){var a=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=Jr(e.split(":")),n=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[n.trim()]||(r[n.trim()]=i),"false"===i&&(r[n.trim()]=!1),"true"===i&&(r[n.trim()]=!0),isNaN(i)||(r[n.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:r}}(t),o=a.formatName,s=a.formatOptions;if(i.formats[o]){var c=e;try{var l=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},d=l.locale||l.lng||n.locale||n.lng||r;c=i.formats[o](e,d,Un(Un(Un({},s),n),l))}catch(e){i.logger.warn(e)}return c}return i.logger.warn("there was no format function for ".concat(o)),e}),e)}}]),e}();function Hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $n(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wn(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}var qn=function(e){Hr(r,e);var t=Wn(r);function r(e,n,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Br(this,r),a=t.call(this),gn&&nn.call(Ur(a)),a.backend=e,a.store=n,a.services=i,a.languageUtils=i.languageUtils,a.options=o,a.logger=rn.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=o.maxParallelReads||10,a.readingCalls=0,a.maxRetries=o.maxRetries>=0?o.maxRetries:5,a.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(i,o.backend,o),a}return zr(r,[{key:"queueLoad",value:function(e,t,r,n){var i=this,a={},o={},s={},c={};return e.forEach((function(e){var n=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!r.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?void 0===o[s]&&(o[s]=!0):(i.state[s]=1,n=!1,void 0===o[s]&&(o[s]=!0),void 0===a[s]&&(a[s]=!0),void 0===c[t]&&(c[t]=!0)))})),n||(s[e]=!0)})),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),i=n[0],a=n[1];t&&this.emit("failedLoading",i,a,t),r&&this.store.addResourceBundle(i,a,r),this.state[e]=t?-1:2;var o={};this.queue.forEach((function(r){var n,s,c,l,d,u;n=r.loaded,s=a,l=cn(n,[i],Object),d=l.obj,u=l.k,d[u]=d[u]||[],c&&(d[u]=d[u].concat(s)),c||d[u].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(e){o[e]||(o[e]={});var t=r.loaded[e];t.length&&t.forEach((function(t){void 0===o[e][t]&&(o[e][t]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:i,wait:a,callback:o}):(this.readingCalls++,this.backend[r](e,t,(function(s,c){if(n.readingCalls--,n.waitingReads.length>0){var l=n.waitingReads.shift();n.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}s&&c&&i<n.maxRetries?setTimeout((function(){n.read.call(n,e,t,r,i+1,2*a,o)}),a):o(s,c)}))):o(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(a," for language ").concat(i," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(a," for language ").concat(i),o),t.loaded(e,n,o)}))}},{key:"saveMissing",value:function(e,t,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,$n($n({},a),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),r}(nn);function Gn(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Nr(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Nr(e[2])||"object"===Nr(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Zn(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qn(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}function Jn(){}function Xn(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ei=function(e){Hr(r,e);var t=Qn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Br(this,r),e=t.call(this),gn&&nn.call(Ur(e)),e.options=Zn(n),e.services={},e.logger=rn,e.modules={external:[]},Xn(Ur(e)),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),$r(e,Ur(e));setTimeout((function(){e.init(n,i)}),0)}return e}return zr(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var n=Gn();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=Yn(Yn(Yn({},n),this.options),Zn(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Yn(Yn({},n.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var a;this.modules.logger?rn.init(i(this.modules.logger),this.options):rn.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=Vn);var o=new jn(this.options);this.store=new _n(this.options.resources,this.options);var s=this.services;s.logger=rn,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new An(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!a||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=i(a),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new Fn(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new qn(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Pn(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,r||(r=Jn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var d=["addResource","addResources","addResourceBundle","removeResourceBundle"];d.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}}));var u=an(),p=function(){var t=function(t,n){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),u}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jn,n=r,i="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return n();var a=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};if(i)o(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return o(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(a,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,r){var n=an();return e||(e=this.languages),t||(t=this.options.ns),r||(r=Jn),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),r(e)})),n}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Sn.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=an();this.emit("languageChanging",e);var i=function(e){r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.resolvedLanguage=void 0,r.setResolvedLanguage(e)},a=function(a){e||a||!r.services.languageDetector||(a=[]);var o="string"==typeof a?a:r.services.languageUtils.getBestMatchFromCodes(a);o&&(r.language||i(o),r.translator.language||r.translator.changeLanguage(o),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(o)),r.loadResources(o,(function(e){!function(e,a){a?(i(a),r.translator.changeLanguage(a),r.isLanguageChangingTo=void 0,r.emit("languageChanged",a),r.logger.log("languageChanged",a)):r.isLanguageChangingTo=void 0,n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,r){var n=this,i=function e(t,i){var a;if("object"!==Nr(i)){for(var o=arguments.length,s=new Array(o>2?o-2:0),c=2;c<o;c++)s[c-2]=arguments[c];a=n.options.overloadTranslationOptionHandler([t,i].concat(s))}else a=Yn({},i);a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,a.keyPrefix=a.keyPrefix||r||e.keyPrefix;var l=n.options.keySeparator||".",d=a.keyPrefix?"".concat(a.keyPrefix).concat(l).concat(t):t;return n.t(d,a)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};if(r.precheck){var s=r.precheck(this,o);if(void 0!==s)return s}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=an();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=an();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter((function(e){return n.indexOf(e)<0}));return i.length?(this.options.preload=n.concat(i),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jn,i=Yn(Yn(Yn({},this.options),t),{isClone:!0}),a=new r(i),o=["store","services","language"];return o.forEach((function(t){a[t]=e[t]})),a.services=Yn({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new Pn(a.services,a.options),a.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];a.emit.apply(a,[e].concat(r))})),a.init(i,n),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(nn);qr(ei,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ei(e,t)}));var ti=ei.createInstance();ti.createInstance=ei.createInstance;ti.createInstance,ti.init,ti.loadResources,ti.reloadResources,ti.use,ti.changeLanguage,ti.getFixedT,ti.t,ti.exists,ti.setDefaultNamespace,ti.hasLoadedNamespace,ti.loadNamespaces,ti.loadLanguages;var ri=ti,ni={},ii={};(ii=function(e){if(Array.isArray(e))return e}).__esModule=!0,ii.default=ii;var ai={};(ai=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}).__esModule=!0,ai.default=ai;var oi={},si={};(si=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}).__esModule=!0,si.default=si,(oi=function(e,t){if(e){if("string"==typeof e)return si(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?si(e,t):void 0}}).__esModule=!0,oi.default=oi;var ci={};(ci=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,ci.default=ci,(ni=function(e,t){return ii(e)||ai(e,t)||oi(e,t)||ci()}).__esModule=!0,ni.default=ni;var li={};(li=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}).__esModule=!0,li.default=li;Ie=a("85Hg2");var di={};(di=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,di.default=di;var ui={};function pi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(ui=function(e,t,r){return t&&pi(e.prototype,t),r&&pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,ui.default=ui;Ie=a("85Hg2");var hi=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,fi={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},mi=function(e){return fi[e]};function gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(n),!0).forEach((function(t){r(li)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yi,bi={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(hi,mi)}},wi=(0,Ie.createContext)();function xi(){return bi}var _i=function(){function e(){r(di)(this,e),this.usedNamespaces={}}return r(ui)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Si(){return yi}var ki={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};bi=vi(vi({},bi),e)}(e.options.react),function(e){yi=e}(e)}};function Ci(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];"string"==typeof r[0]&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var Ei={};function Ri(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&Ei[t[0]]||("string"==typeof t[0]&&(Ei[t[0]]=new Date),Ci.apply(void 0,t))}function Pi(e,t,r){e.loadNamespaces(t,(function(){if(e.isInitialized)r();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),r()}))}}))}function Ti(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],i=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};return!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(n,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,e))))}function ji(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return Ri("i18n.languages were undefined or empty",t.languages),!0;var n=void 0!==t.options.ignoreJSONStructure;return n?t.hasLoadedNamespace(e,{precheck:function(t,n){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):Ti(e,t,r)}function Oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oi(Object(n),!0).forEach((function(t){r(li)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ii=function(e,t){var r=(0,Ie.useRef)();return(0,Ie.useEffect)((function(){r.current=t?r.current:e}),[e,t]),r.current};function Li(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,i=(0,Ie.useContext)(wi)||{},a=i.i18n,o=i.defaultNS,s=n||a||Si();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new _i),!s){Ri("You will need to pass in an i18next instance by using initReactI18next");var c=function(e){return Array.isArray(e)?e[e.length-1]:e},l=[c,{},!1];return l.t=c,l.i18n={},l.ready=!1,l}s.options.react&&void 0!==s.options.react.wait&&Ri("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Mi(Mi(Mi({},xi()),s.options.react),t),u=d.useSuspense,p=d.keyPrefix,h=e||o||s.options&&s.options.defaultNS;h="string"==typeof h?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var f=(s.isInitialized||s.initializedStoreOnce)&&h.every((function(e){return ji(e,s,d)}));function m(){return s.getFixedT(null,"fallback"===d.nsMode?h:h[0],p)}var g=(0,Ie.useState)(m),v=r(ni)(g,2),y=v[0],b=v[1],w=h.join(),x=Ii(w),_=(0,Ie.useRef)(!0);(0,Ie.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function r(){_.current&&b(m)}return _.current=!0,f||u||Pi(s,h,(function(){_.current&&b(m)})),f&&x&&x!==w&&_.current&&b(m),e&&s&&s.on(e,r),t&&s&&s.store.on(t,r),function(){_.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,r)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,r)}))}}),[s,w]);var S=(0,Ie.useRef)(!0);(0,Ie.useEffect)((function(){_.current&&!S.current&&b(m),S.current=!1}),[s,p]);var k=[y,s,f];if(k.t=y,k.i18n=s,k.ready=f,f)return k;if(!f&&!u)return k;throw new Promise((function(e){Pi(s,h,(function(){e()}))}))}const Di=()=>{try{const e=localStorage.getItem("stream_ui_language");return e||"en"}catch(e){return console.warn(e),"en"}},Ai={en:{name:"English",translation:{notifications:{screensharingError:"An error occured when trying to toggle screensharing",microphoneError:"An error occured when trying to toggle the microphone",cameraError:"An error occured when trying to toggle the camera",cameraRotateError:"An error occured when trying to rotate the camera",noCamera:"No camera available",blockedMicrophonePopupTitle:"Camera and microphone are blocked",blockedMicrophonePopup:"SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser's address bar.",reload:"Reload",criticalError:"A critical error has occurred (error {{code}}).",agentJoinError:"An error occured while trying to join the room as an agent",close:"Close",connectedTo:"Connected to {{name}}"},endView:{goBack:"Go back to call",tooLate:"You arrived too late",callIsOver:"The call is over or deleted",callEnded:"The call is now ended",callLeft:"You left the call",full:"You can't join this call",fullDescription:"The room is full. Please try to join the call later."},menu:{title:"Menu",new:"NEW",openNewTab:"Open new tab",quickConnect:"Quick Connect",pictureInPicture:"Picture-in-Picture",screenSharing:"Screen sharing"},copyLink:{title:"Copy link",description:"Copy link into clipboard",error:"An error occured when trying to copy to clipboard",copied:"Link copied to clipboard"},quickConnect:{title:"Quick Connect",scanTitle:"Scan QR Code",scan:"Scan this QR code with your phone camera to open the call."},settings:{title:"Settings",preferences:"Preferences",language:"Language",devices:"Devices",help:"Help",helpCenter:"Go to help center"},audioMenu:{title:"Audio",blockedMicrophone:"Microphone is blocked.",microphonePermissions:"Please accept microphone sharing before accessing these options."},videoMenu:{title:"Video",lowDef:"Low definition (240p)",standardDef:"Standard definition (480p)",highDef:"High definition (720p)",blockedCamera:"Camera is blocked.",cameraPermissions:"Please accept camera sharing before accessing these options.",sendResolution:"Send Resolution (maximum)"},shareLink:{title:"Share link",title2:"Share a link",invalid:"Invalid link",sentToUsers:"Link sent to users",sentToUser:"Link sent to {{user}}",failed:"Failed to send link",poweredBy:"Powered by",invoice:"{{user}} sent you an invoice.",pay:"Pay"},youtube:{title:"Watch Together",url:"YOUTUBE URL",invalid:"Invalid YouTube URL",share:"Watch now"},sharedHistory:{shared:"Shared with you"},snapshot:{title:"Snapshot",shared:"Snapshot shared.",sentToUsers:"Snapshot sent to users.",sentToUser:"Snapshot sent to {{user}}",save:"Save photo",error:"An error occured when trying to send the snapshot"},gdpr:{recordedWarning:"To improve the quality of our service, this call will be recorded."},requestDevice:{requestInput:"Request input devices",request:"{{user}} would like you to share your {{device}}",timedOut:"Your request has timed out.",declined:"Your request has been declined.",userDeclined:"{{user}} has declined your request."},leave:{title:"Leave",leaveCall:"Leave call",endCall:"End call for all"},virtualBackground:{title:"Virtual Background",setBackground:"Set Background"},misc:{someone:"Someone",camera:"Camera",microphone:"Microphone",screen:"Screen",speaker:"Speaker",user:"User",open:"Open",from:"From",accept:"Accept",decline:"Decline",you:"You"},invite:{title:"Share link to start a conversation",copy:"Copy",description:"You are currently the only participant. Invite people to start the conversation."},greeting:{mainTitle:"Welcome to SnapCall",sideTitle:"Are you ready to join?",sideDescription:"Before joining the room, enter your name. It will displayed to participants.",namePlaceholder:"Your name",nameSubmit:"Join Conversation",footerTitle:"Powered by SnapCall",footerDescription:"Meet SnapCall, the easiest way to add real-time video to platform, product or service."}}},fr:{name:"Français",translation:{notifications:{screensharingError:"Une erreur est survenue pendant l'activation du partage d'écran",microphoneError:"Une erreur est survenue pendant l'activation du micro",cameraError:"Une erreur est survenue pendant l'activation de la caméra",cameraRotateError:"Une erreur est survenue pendant la rotation de la caméra",noCamera:"Aucune caméra disponible",blockedMicrophonePopupTitle:"Votre caméra et micro sont bloqués",blockedMicrophonePopup:"SnapCall a besoin d'accéder à votre caméra et micro. Cliquez sur l'icône de caméra bloquée dans la barre d'adresse du navigateur.",reload:"Recharger",criticalError:"Une erreur critique est survenue (erreur {{code}}).",agentJoinError:"Une erreur est survenue en essayant de rejoindre la salle en tant qu'agent",close:"Fermer",connectedTo:"Connecté à {{name}}"},endView:{goBack:"Retourner dans l'appel",tooLate:"Vous êtes arrivez trop tard",callIsOver:"Cet appel est terminé ou supprimé",callEnded:"Cet appel est terminé",callLeft:"Vous avez quitté l'appel",full:"Impossible de rejoindre l'appel",fullDescription:"Limite d'utilisateurs atteinte. Merci de rejoindre l'appel ultérieurement."},menu:{title:"Menu",new:"NOUVEAU",openNewTab:"Ouvrir un nouvel onglet",quickConnect:"Quick Connect",pictureInPicture:"Picture-in-Picture",screenSharing:"Partage d'écran"},copyLink:{title:"Copier le lien",description:"Copier le lien dans le presse-papiers",error:"Une erreur est survenue pendant la copie du lien dans le presse-papier",copied:"Lien copié dans le presse-papier"},quickConnect:{title:"Quick Connect",scanTitle:"Scannez le QR Code",scan:"Scannez ce QR code avec votre téléphone pour ouvrir l'appel."},settings:{title:"Paramètres",preferences:"Préférences",language:"Langage",devices:"Appareils",help:"Aide",helpCenter:"Accéder au centre d'aide"},audioMenu:{title:"Audio",blockedMicrophone:"Votre micro est bloqué.",microphonePermissions:"Please accept microphone sharing before accessing these options."},videoMenu:{title:"Video",lowDef:"Basse définition (240p)",standardDef:"Définition standard (480p)",highDef:"Haute définition (720p)",blockedCamera:"Votre caméra est bloqué.",cameraPermissions:"Please accept camera sharing before accessing these options.",sendResolution:"Résolution envoyée (max)"},shareLink:{title:"Partager un lien",title2:"Partager un lien",invalid:"Lien invalide",sentToUsers:"Lien envoyé aux participants",sentToUser:"Lien envoyé à {{user}}",failed:"Une erreur est survenue pendant l'envoi du lien",poweredBy:"Proposé par",invoice:"{{user}} vous a envoyé une facture.",pay:"Payer"},youtube:{title:"Regardons Ensemble",url:"URL YOUTUBE",invalid:"URL YouTube invalide",share:"Regarder maintenant"},sharedHistory:{shared:"Partagé avec vous"},snapshot:{title:"Snapshot",shared:"Snapshot envoyé.",sentToUsers:"Snapshot envoyé aux participants.",sentToUser:"Snapshot envoyé à {{user}}",save:"Sauvegarder l'image",error:"Une erreur est survenue pendant l'envoi du snapshot"},gdpr:{recordedWarning:"Pour améliorer la qualité de notre service, cet appel va être enregistré."},requestDevice:{requestInput:"Demander l'activation",request:"{{user}} voudrait que vous partagiez votre {{device}}",timedOut:"Votre requête n'a pas eu de réponse",declined:"Votre requête a été refusé.",userDeclined:"{{user}} a décliné votre requête."},leave:{title:"Quitter",leaveCall:"Quitter l'appel",endCall:"Terminer l'appel"},virtualBackground:{title:"Arrière plan virtuel",setBackground:"Mettre l'arrière plan"},misc:{someone:"Quelqu'un",camera:"Caméra",microphone:"Micro",screen:"Écran",speaker:"Haut-parleur",user:"Utilisateur",open:"Ouvrir",from:"Depuis",accept:"Accepter",decline:"Décliner",you:"Vous"},invite:{title:"Partagez le lien pour commencer une conversation",copy:"Copier",description:"Vous êtes actuellement le seul participant. Inviter des personnes pour commencer la conversation."},greeting:{mainTitle:"Bienvenue sur SnapCall",sideTitle:"Prêt à rejoindre ?",sideDescription:"Avant de rejoindre la salle, veuillez entrer votre nom.",namePlaceholder:"Nom",nameSubmit:"Rejoindre la conversation",footerTitle:"Propulsé par SnapCall",footerDescription:"Découvrez SnapCall, ajoutez de la vidéo en temps réel à n'importe quelle plateforme, produit ou service."}}},it:{name:"Italiano",translation:{notifications:{screensharingError:"Si è verificato un errore durante l'attivazione della condivisione dello schermo",microphoneError:"Si è verificato un errore durante l'attivazione del microfono",cameraError:"Si è verificato un errore durante l'attivazione della fotocamera",cameraRotateError:"Si è verificato un errore durante la rotazione della fotocamera",noCamera:"Nessuna fotocamera disponibile",blockedMicrophonePopupTitle:"La tua fotocamera e il tuo microfono sono bloccati",blockedMicrophonePopup:"SnapCall ha bisogno di accedere alla fotocamera e al microfono. Fare clic sull'icona della fotocamera bloccata nella barra degli indirizzi del browser.",reload:"Ricaricare",criticalError:"Si è verificato un errore critico (errore {{code}}).",agentJoinError:"Si è verificato un errore cercando di entrare nella conversazione come agente",close:"Chiudere",connectedTo:"Connesso a {{name}}"},endView:{goBack:"Torna alla chiamata",tooLate:"Sei arrivato troppo tardi",callIsOver:"Questa chiamata è finita o è stata eliminata",callEnded:"Questa chiamata è finita",callLeft:"Hai lasciato la chiamata",full:"Impossibile partecipare alla chiamata",fullDescription:"Limite d'uso attenente."},menu:{title:"Menù",new:"NUOVO",openNewTab:"Apri una nuova scheda",quickConnect:"Connessione Rapida",pictureInPicture:"Immagine nell'immagine",screenSharing:"Condivisione dello schermo"},copyLink:{title:"Copia il link",description:"Copia il link negli appunti",error:"Si è verificato un errore durante la copia negli Appunti",copied:"Link copiato negli Appunti"},quickConnect:{title:"Connessione Rapida",scanTitle:"Scansiona il codice QR",scan:"Scansiona questo codice QR con il telefono per aprire la chiamata."},settings:{title:"Impostazioni",preferences:"Preferenze",language:"Linguaggio",devices:"Dispositivi",help:"Aiuto",helpCenter:"Accedi all'Assistenza"},audioMenu:{title:"Audio",blockedMicrophone:"Il tuo microfono è bloccato.",microphonePermissions:"Si prega di accettare la condivisione del microfono prima di accedere a queste opzioni."},videoMenu:{title:"Video",lowDef:"Definizione bassa (240p)",standardDef:"Definizione standard (480p)",highDef:"Alta definizione (720p)",blockedCamera:"La fotocamera è bloccata.",cameraPermissions:"Si prega di accettare la condivisione della fotocamera prima di accedere a queste opzioni.",sendResolution:"Risoluzione inviata (max)"},shareLink:{title:"Condividi un link",title2:"Condividi un link",invalid:"Collegamento non valido",sentToUsers:"Link inviato ai partecipanti",sentToUser:"Link inviato a {{user}}",failed:"Si è verificato un errore durante l'invio del link",poweredBy:"Proposto da",invoice:"{{User}} ti ha inviato una fattura.",pay:"Paga"},youtube:{title:"Vedere Assieme",url:"URL YOUTUBE",invalid:"URL YouTube non valido",share:"Guarda ora"},sharedHistory:{shared:"Condiviso con te"},snapshot:{title:"Schermata",shared:"Schermata inviata",sentToUsers:"Schermanta inviata ai partecipanti",sentToUser:"Schermata inviata a {{user}}",save:"Salva l'immagine",error:"Si è verificato un errore durante l'invio della schermata"},gdpr:{recordedWarning:"Per migliorare la qualità del nostro servizio, questa chiamata verrà registrata."},requestDevice:{requestInput:"Richiesta di attivazione",request:"{{user}} vorrebbe condividere il tuo {{device}}",timedOut:"La tua richiesta non ha ricevuto risposta",declined:"La tua richiesta è stata rifiutata.",userDeclined:"{{user}} ha rifiutato la tua richiesta"},leave:{title:"Lasciare",leaveCall:"Lascia la chiamata",endCall:"Termina la chiamata per tutti"},virtualBackground:{title:"Sfondo virtuale",setBackground:"Imposta sfondo"},virtualbackground:{title:"Virtual Background",setBackground:"Set Background"},misc:{someone:"Qualcuno",camera:"Telecamera",microphone:"Microfono",screen:"Schermo",speaker:"Altoparlante",user:"Utente",open:"Aprire",from:"Da",accept:"Accettare",decline:"Declinare",you:"Voi"},invite:{title:"Condividi link per avviare una conversazione",copy:"Copiare",description:"Attualmente sei l'unico partecipante. Invita le persone ad iniziare la conversazione."},greeting:{mainTitle:"Benvenuto a SnapCall",sideTitle:"Sei pronto per unirti?",sideDescription:"Prima di entrare nella stanza, inserisci il tuo nome. Verrà visualizzato ai partecipanti.",namePlaceholder:"Il tuo nome",nameSubmit:"Partecipa alla conversazione",footerTitle:"Offerto da SnapCall",footerDescription:"Incontrare SnapCall, il modo più semplice per aggiungere video in tempo reale a piattaforma, prodotto o servizio."}}}};ri.use(ki).init({lng:Di(),fallbackLng:"en",resources:Ai,interpolation:{escapeValue:!1}});var Ni,Bi=ri,Fi=(Ie=a("85Hg2"),a("4Fy4N")),zi=new Uint8Array(16);function Ui(){if(!Ni&&!(Ni="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 Ni(zi)}var Vi=/^(?:[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;for(var Hi=function(e){return"string"==typeof e&&Vi.test(e)},$i=[],Wi=0;Wi<256;++Wi)$i.push((Wi+256).toString(16).substr(1));var qi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=($i[e[t+0]]+$i[e[t+1]]+$i[e[t+2]]+$i[e[t+3]]+"-"+$i[e[t+4]]+$i[e[t+5]]+"-"+$i[e[t+6]]+$i[e[t+7]]+"-"+$i[e[t+8]]+$i[e[t+9]]+"-"+$i[e[t+10]]+$i[e[t+11]]+$i[e[t+12]]+$i[e[t+13]]+$i[e[t+14]]+$i[e[t+15]]).toLowerCase();if(!Hi(r))throw TypeError("Stringified UUID is invalid");return r};var Gi,Zi,Ki,Yi=function(e,t,r){var n=(e=e||{}).random||(e.rng||Ui)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return qi(n)},Qi=JSON.parse('{"name":"protoo-client","version":"4.0.6","description":"protoo JavaScript client module","author":"Iñaki Baz Castillo <ibc@aliax.net>","homepage":"https://protoo.versatica.com","license":"MIT","repository":{"type":"git","url":"https://github.com/ibc/protoo.git"},"main":"lib/index.js","keywords":["nodejs","browser","websocket"],"engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint -c .eslintrc.js lib"},"dependencies":{"debug":"^4.3.1","events":"^3.2.0","retry":"^0.12.0"},"devDependencies":{"eslint":"^5.16.0"},"optionalDependencies":{"websocket":"^1.0.33"}}').version,Ji={},Xi=a("hZG0u");const ea="protoo-client";Ji=class{constructor(e){e?(this._debug=Xi(`protoo-client:${e}`),this._warn=Xi(`protoo-client:WARN:${e}`),this._error=Xi(`protoo-client:ERROR:${e}`)):(this._debug=Xi(ea),this._warn=Xi("protoo-client:WARN"),this._error=Xi("protoo-client:ERROR")),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}get debug(){return this._debug}get warn(){return this._warn}get error(){return this._error}};var ta,ra=a("3oV8N").EventEmitter;ta=class extends ra{constructor(e){super(),this.setMaxListeners(1/0),this._logger=e||new Ji("EnhancedEventEmitter")}safeEmit(e,...t){try{this.emit(e,...t)}catch(t){this._logger.error("safeEmit() | event listener threw an error [event:%s]:%o",e,t)}}async safeEmitAsPromise(e,...t){return new Promise(((r,n)=>{this.safeEmit(e,...t,r,n)}))}};var na={},ia=function(){return Math.round(1e7*Math.random())};const aa=new Ji("Message");na=class{static parse(e){let t;const r={};try{t=JSON.parse(e)}catch(e){return void aa.error("parse() | invalid JSON: %s",e)}if("object"==typeof t&&!Array.isArray(t)){if(t.request){if(r.request=!0,"string"!=typeof t.method)return void aa.error("parse() | missing/invalid method field");if("number"!=typeof t.id)return void aa.error("parse() | missing/invalid id field");r.id=t.id,r.method=t.method,r.data=t.data||{}}else if(t.response){if(r.response=!0,"number"!=typeof t.id)return void aa.error("parse() | missing/invalid id field");r.id=t.id,t.ok?(r.ok=!0,r.data=t.data||{}):(r.ok=!1,r.errorCode=t.errorCode,r.errorReason=t.errorReason)}else{if(!t.notification)return void aa.error("parse() | missing request/response field");if(r.notification=!0,"string"!=typeof t.method)return void aa.error("parse() | missing/invalid method field");r.method=t.method,r.data=t.data||{}}return r}aa.error("parse() | not an object")}static createRequest(e,t){return{request:!0,id:ia(),method:e,data:t||{}}}static createSuccessResponse(e,t){return{response:!0,id:e.id,ok:!0,data:t||{}}}static createErrorResponse(e,t,r){return{response:!0,id:e.id,ok:!1,errorCode:t,errorReason:r}}static createNotification(e,t){return{notification:!0,method:e,data:t||{}}}};const oa=new Ji("Peer");Ki=class extends ta{constructor(e){super(oa),oa.debug("constructor()"),this._closed=!1,this._transport=e,this._connected=!1,this._data={},this._sents=new Map,this._handleTransport()}get closed(){return this._closed}get connected(){return this._connected}get data(){return this._data}set data(e){throw new Error("cannot override data object")}close(){if(!this._closed){oa.debug("close()"),this._closed=!0,this._connected=!1,this._transport.close();for(const e of this._sents.values())e.close();this.safeEmit("close")}}async request(e,t){const r=na.createRequest(e,t);return this._logger.debug("request() [method:%s, id:%s]",e,r.id),await this._transport.send(r),new Promise(((e,t)=>{const n=1500*(15+.1*this._sents.size),i={id:r.id,method:r.method,resolve:t=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),e(t))},reject:e=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),t(e))},timer:setTimeout((()=>{this._sents.delete(r.id)&&t(new Error("request timeout"))}),n),close:()=>{clearTimeout(i.timer),t(new Error("peer closed"))}};this._sents.set(r.id,i)}))}async notify(e,t){const r=na.createNotification(e,t);this._logger.debug("notify() [method:%s]",e),await this._transport.send(r)}_handleTransport(){if(this._transport.closed)return this._closed=!0,void setTimeout((()=>{this._closed||(this._connected=!1,this.safeEmit("close"))}));this._transport.on("open",(()=>{this._closed||(oa.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))})),this._transport.on("disconnected",(()=>{this._closed||(oa.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))})),this._transport.on("failed",(e=>{this._closed||(oa.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))})),this._transport.on("close",(()=>{this._closed||(this._closed=!0,oa.debug('emit "close"'),this._connected=!1,this.safeEmit("close"))})),this._transport.on("message",(e=>{e.request?this._handleRequest(e):e.response?this._handleResponse(e):e.notification&&this._handleNotification(e)}))}_handleRequest(e){try{this.emit("request",e,(t=>{const r=na.createSuccessResponse(e,t);this._transport.send(r).catch((()=>{}))}),((t,r)=>{t instanceof Error?(r=t.message,t=500):"number"==typeof t&&r instanceof Error&&(r=r.message);const n=na.createErrorResponse(e,t,r);this._transport.send(n).catch((()=>{}))}))}catch(t){const r=na.createErrorResponse(e,500,String(t));this._transport.send(r).catch((()=>{}))}}_handleResponse(e){const t=this._sents.get(e.id);if(t)if(e.ok)t.resolve(e.data);else{const r=new Error(e.errorReason);r.code=e.errorCode,t.reject(r)}else oa.error("received response does not match any sent request [id:%s]",e.id)}_handleNotification(e){this.safeEmit("notification",e)}};var sa;if("object"==typeof globalThis)sa=globalThis;else try{sa=a("jCEG4")}catch(e){}finally{if(sa||"undefined"==typeof window||(sa=window),!sa)throw new Error("Could not determine global this")}var ca,la=sa.WebSocket||sa.MozWebSocket;function da(e,t){return t?new la(e,t):new la(e)}ca=a("kUMHr").version,la&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(da,e,{get:function(){return la[e]}})}));var ua={w3cwebsocket:la?da:null,version:ca}.w3cwebsocket,pa={};pa=a("jxXWz");const ha={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},fa=new Ji("WebSocketTransport");Gi=Ki,Zi=class extends ta{constructor(e,t){super(fa),fa.debug("constructor() [url:%s, options:%o]",e,t),this._closed=!1,this._url=e,this._options=t||{},this._ws=null,this._runWebSocket()}get closed(){return this._closed}close(){if(!this._closed){fa.debug("close()"),this._closed=!0,this.safeEmit("close");try{this._ws.onopen=null,this._ws.onclose=null,this._ws.onerror=null,this._ws.onmessage=null,this._ws.close()}catch(e){fa.error("close() | error closing the WebSocket: %o",e)}}}async send(e){if(this._closed)throw new Error("transport closed");try{this._ws.send(JSON.stringify(e))}catch(e){throw fa.warn("send() failed:%o",e),e}}_runWebSocket(){const e=pa.operation(this._options.retry||ha);let t=!1;e.attempt((r=>{this._closed?e.stop():(fa.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new ua(this._url,"protoo",this._options.origin,this._options.headers,this._options.requestOptions,this._options.clientConfig),this._ws.onopen=()=>{this._closed||(t=!0,this.safeEmit("open"))},this._ws.onclose=n=>{if(!this._closed){if(fa.warn('WebSocket "close" event [wasClean:%s, code:%s, reason:"%s"]',n.wasClean,n.code,n.reason),4e3!==n.code){if(t){if(e.stop(),this.safeEmit("disconnected"),this._closed)return;return void this._runWebSocket()}if(this.safeEmit("failed",r),this._closed)return;if(e.retry(!0))return}this._closed=!0,this.safeEmit("close")}},this._ws.onerror=()=>{this._closed||fa.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;const t=na.parse(e.data);t&&(0!==this.listenerCount("message")?this.safeEmit("message",t):fa.error('no listeners for WebSocket "message" event, ignoring received message'))})}))}};var ma={};e(ma,"FunctionToString",(()=>Aa)),e(ma,"InboundFilters",(()=>Ba));var ga=Object.prototype.toString;function va(e,t){return ga.call(e)===`[object ${t}]`}function ya(e){return va(e,"String")}function ba(e){return va(e,"Object")}function wa(e){return Boolean(e&&e.then&&"function"==typeof e.then)}var xa=(0,(Ea=a("bWPEY")).getGlobalObject)(),_a=["debug","info","warn","error","log","assert","trace"];function Sa(e){var t=(0,Ea.getGlobalObject)();if(!("console"in t))return e();var r=t.console,n={};_a.forEach((e=>{var i=r[e]&&r[e].__sentry_original__;e in t.console&&i&&(n[e]=r[e],r[e]=i)}));try{return e()}finally{Object.keys(n).forEach((e=>{r[e]=n[e]}))}}function ka(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?_a.forEach((r=>{t[r]=(...t)=>{e&&Sa((()=>{xa.console[r](`Sentry Logger [${r}]:`,...t)}))}})):_a.forEach((e=>{t[e]=()=>{}})),t}let Ca;Ca="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,Ea.getGlobalSingleton)("logger",ka):ka();var Ea=a("bWPEY");Ea=a("bWPEY");function Ra(e,t){return!!ya(e)&&(va(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Pa(e){return Ta(e,new Map)}function Ta(e,t){if(ba(e)){if(void 0!==(i=t.get(e)))return i;var r={};for(var n of(t.set(e,r),Object.keys(e)))void 0!==e[n]&&(r[n]=Ta(e[n],t));return r}if(Array.isArray(e)){var i;if(void 0!==(i=t.get(e)))return i;r=[];return t.set(e,r),e.forEach((e=>{r.push(Ta(e,t))})),r}return e}function ja(){var e=(0,Ea.getGlobalObject)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var n=e=>{let t=e.toString(16);for(;t.length<4;)t=`0${t}`;return t};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function Oa(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Ma(e){const{message:t,event_id:r}=e;if(t)return t;var n=Oa(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}var Ia;!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Ia||(Ia={}));class La{__init(){this._state=Ia.PENDING}__init2(){this._handlers=[]}constructor(e){La.prototype.__init.call(this),La.prototype.__init2.call(this),La.prototype.__init3.call(this),La.prototype.__init4.call(this),La.prototype.__init5.call(this),La.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new La(((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new La(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}__init3(){this._resolve=e=>{this._setResult(Ia.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Ia.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===Ia.PENDING&&(wa(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==Ia.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Ia.RESOLVED&&e[1](this._value),this._state===Ia.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}let Da;class Aa{constructor(){Aa.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Aa.id}setupOnce(){Da=Function.prototype.toString,Function.prototype.toString=function(...e){var t=this.__sentry_original__||this;return Da.apply(t,e)}}}Aa.__initStatic();var Na=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class Ba{static __initStatic(){this.id="InboundFilters"}__init(){this.name=Ba.id}constructor(e={}){this._options=e,Ba.prototype.__init.call(this)}setupOnce(e,t){var r=e=>{var r=t();if(r){var n=r.getIntegration(Ba);if(n){var i=r.getClient(),a=i?i.getOptions():{},o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...Na],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(n._options,a);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Ma(e)}`),!0;if(function(e,t){return!(!t||!t.length)&&function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:r=""}=e.exception.values&&e.exception.values[0]||{};return[`${r}`,`${t}: ${r}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.error(`Cannot extract message for event ${Ma(e)}`),[]}return[]}(e).some((e=>t.some((t=>Ra(e,t)))))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ma(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;var r=Fa(e);return!!r&&t.some((e=>Ra(r,e)))}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ma(e)}.\nUrl: ${Fa(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;var r=Fa(e);return!r||t.some((e=>Ra(r,e)))}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ma(e)}.\nUrl: ${Fa(e)}`),!0;return!1}(e,o)?null:e}}return e};r.id=this.name,e(r)}}function Fa(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let r=e.length-1;r>=0;r--){var t=e[r];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.error(`Cannot extract url for event ${Ma(e)}`),null}}Ba.__initStatic();var za=a("gTODe"),Ua=(Ea=a("bWPEY"),a("hLvaX"));a("gTODe"),Ea=a("bWPEY"),za=a("gTODe");function Va(e){var t=(0,za.timestampInSeconds)(),r={sid:ja(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Pa({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&Ha(r,e),r}function Ha(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,za.timestampInSeconds)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ja()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function $a(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),Ha(e,r)}class Wa{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){var t=new Wa;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Ha(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof Wa?t:this}return e instanceof Wa?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):ba(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var r="number"==typeof t?Math.min(t,100):100;if(r<=0)return this;var n={timestamp:(0,za.dateTimestampInSeconds)(),...e};return this._breadcrumbs=[...this._breadcrumbs,n].slice(-r),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var r=this._span.transaction&&this._span.transaction.name;r&&(e.tags={transaction:r,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...qa(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,n=0){return new La(((i,a)=>{var o=e[n];if(null===t||"function"!=typeof o)i(t);else{var s=o({...t},r);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.id&&null===s&&Ca.log(`Event processor "${o.id}" dropped event`),wa(s)?s.then((t=>this._notifyEventProcessors(e,t,r,n+1).then(i))).then(null,a):this._notifyEventProcessors(e,s,r,n+1).then(i).then(null,a)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function qa(){return(0,Ea.getGlobalSingleton)("globalEventProcessors",(()=>[]))}var Ga=100;class Za{__init(){this._stack=[{}]}constructor(e,t=new Wa,r=4){this._version=r,Za.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=Wa.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var r=this._lastEventId=t&&t.event_id?t.event_id:ja(),n=new Error("Sentry syntheticException");return this._withClient(((i,a)=>{i.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},a)})),r}captureMessage(e,t,r){var n=this._lastEventId=r&&r.event_id?r.event_id:ja(),i=new Error(e);return this._withClient(((a,o)=>{a.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},o)})),n}captureEvent(e,t){var r=t&&t.event_id?t.event_id:ja();return"transaction"!==e.type&&(this._lastEventId=r),this._withClient(((n,i)=>{n.captureEvent(e,{...t,event_id:r},i)})),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!r||!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Ga}=n.getOptions&&n.getOptions()||{};if(!(a<=0)){var o={timestamp:(0,za.dateTimestampInSeconds)(),...e},s=i?Sa((()=>i(o,t))):o;null!==s&&r.addBreadcrumb(s,a)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var r=this.getScope();r&&r.setTag(e,t)}setExtra(e,t){var r=this.getScope();r&&r.setExtra(e,t)}setContext(e,t){var r=this.getScope();r&&r.setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();t&&r&&e(t)}run(e){var t=Ya(this);try{e(this)}finally{Ya(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,r=t&&t.getSession();r&&$a(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var a=(0,Ea.getGlobalObject)();const{userAgent:o}=a.navigator||{};var s=Va({release:n,environment:i,...t&&{user:t.getUser()},...o&&{userAgent:o},...e});if(t){var c=t.getSession&&t.getSession();c&&"ok"===c.status&&Ha(c,{status:"exited"}),this.endSession(),t.setSession(s)}return s}shouldSendDefaultPii(){var e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}}_withClient(e){const{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){var r=Ka().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ka(){var e=(0,Ea.getGlobalObject)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ya(e){var t=Ka(),r=Xa(t);return eo(t,e),r}function Qa(){var e=Ka();return Ja(e)&&!Xa(e).isOlderThan(4)||eo(e,new Za),(0,Ua.isNodeEnv)()?function(e){try{var t=Ka().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return Xa(e);if(!Ja(r)||Xa(r).isOlderThan(4)){var n=Xa(e).getStackTop();eo(r,new Za(n.client,Wa.clone(n.scope)))}return Xa(r)}catch(t){return Xa(e)}}(e):Xa(e)}function Ja(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Xa(e){return(0,Ea.getGlobalSingleton)("hub",(()=>new Za),e)}function eo(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function to(e,t){return Qa().captureException(e,{captureContext:t})}function ro(e){Qa().addBreadcrumb(e)}const no=1,io=2,ao=3,oo=4,so=5,co={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"};let lo=Number(2);const uo=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class po{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){const i=`[ ${uo.format(new Date)} ][ ${co[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||lo)?t(i,...n):ro({type:"debug",level:co[e],category:"console",data:{head:i,arguments:n}})}debug(e,...t){this.print(so,console.debug,e,...t)}error(e,...t){this.print(no,console.error,e,...t)}info(e,...t){this.print(ao,console.info,e,...t)}log(e,...t){this.print(oo,console.log,e,...t)}warn(e,...t){this.print(io,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){lo=e}setLogLevel(e){this.customLogLevel=e}}const ho=new po("AudioLevels.ts"),fo=window.AudioContext||window.webkitAudioContext;class mo{speakStartEventTime=0;speakStopEventTime=0;speaking=!1;audioMedianInterval=-1;audioLevelInterval=-1;audioLevels=[];constructor(e,t){this.id=e.id,this.listener=t,this.stream=e,this.audioContext=new fo,this.analyser=this.audioContext.createAnalyser(),this.audioStreamSource=this.audioContext.createMediaStreamSource(this.stream),this.analyser.fftSize=32,this.analyser.minDecibels=-90,this.analyser.maxDecibels=-10,this.audioStreamSource.connect(this.analyser)}getAudioLevelMedian(){const{length:e}=this.audioLevels;return this.audioLevels.reduce(((e,t)=>e+t),0)/e}getCurrentAudioLevel(){const{length:e}=this.audioLevels;return e?this.audioLevels[e-1]:0}audioMuteDetection(){0===this.getAudioLevelMedian()&&this.audioLevels.length>0&&this.listener?.onMuteDetection?.(this.id)}detectSpeakingChange(e){e<20&&!this.speakStopEventTime&&(this.speakStartEventTime=0,this.speakStopEventTime=Date.now()),e>=20&&!this.speakStartEventTime&&(this.speakStartEventTime=Date.now(),this.speakStopEventTime=0);const t=this.speakStartEventTime||this.speakStopEventTime,r=Boolean(this.speakStartEventTime);(Date.now()-t>500&&r||Date.now()-t>300&&!r)&&this.speaking!==r&&(this.speaking=r,r?this.listener?.onStartSpeak():this.listener?.onStopSpeak())}computeRMS(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r]*e[r];return t/=e.length,Math.sqrt(t)}getInstantAudioLevel(){const e=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(e);const t=this.computeRMS(e);return t>0?100*t/255:0}loopCalcul(){const e=this.getInstantAudioLevel();this.audioLevels=this.audioLevels.splice(-59),this.detectSpeakingChange(e),this.audioLevels.push(e),this.listener?.onAudioLevel?.(e,this.id)}analyse(){this.audioLevelInterval=window.setInterval((()=>this.loopCalcul()),1e3/60),this.audioMedianInterval=window.setInterval((()=>this.audioMuteDetection()),2e3)}release(){this.listener=void 0,clearInterval(this.audioLevelInterval),clearInterval(this.audioMedianInterval),this.stream.getTracks().forEach((e=>{this.stream.removeTrack(e)}));try{this.audioStreamSource.disconnect(this.analyser)}catch(e){ho.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch((e=>{ho.error("release","audioContext failed to close",e)})),this.audioLevels=[]}static isAPIAvailable(){return!!fo}}const go=new po("AudioRenderer.ts");var vo=class{constructor({consumerId:e}){this.consumerId=e,this.audio=new Audio,this.audio.id=e,this.audio.autoplay=!0,document.body.appendChild(this.audio)}destroy(){this.audio.pause(),this.audio.srcObject=null,document.body.removeChild(this.audio)}setSource(e){this.audio.srcObject=e}async setSink(e){await(this.audio.setSinkId?.(e))}getSink(){return this.audio.sinkId}async play(){await this.audio.play().catch((e=>{go.warn("play","failed to play"),setTimeout((()=>{this.play()}),1e3)}))}};const yo=e=>new Promise((t=>{const r=window.devicePixelRatio||1,n=e.getContext("2d"),i=new Blob(['<svg width="103" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity=".8" fill="#fff"><path d="M10.994 33.06c.903 0 1.658-.734 1.392-1.581a5.249 5.249 0 0 0-1.279-2.124 5.171 5.171 0 0 0-3.673-1.535 5.171 5.171 0 0 0-3.673 1.535c-.595.6-1.03 1.33-1.28 2.124-.265.847.49 1.582 1.393 1.582h7.12ZM10.65 16.2c-.902 0-1.658.735-1.392 1.582.25.794.685 1.524 1.28 2.124a5.171 5.171 0 0 0 3.672 1.535 5.172 5.172 0 0 0 3.674-1.535 5.25 5.25 0 0 0 1.279-2.124c.266-.847-.49-1.582-1.393-1.582h-7.12ZM14.21 31.455c0 .887.75 1.63 1.606 1.35a5.187 5.187 0 0 0 2.067-1.279 5.264 5.264 0 0 0 1.521-3.706c0-1.39-.547-2.723-1.52-3.705a5.187 5.187 0 0 0-2.068-1.278c-.856-.281-1.606.462-1.606 1.349v7.27ZM7.434 17.806c0-.887-.75-1.63-1.607-1.35a5.186 5.186 0 0 0-2.066 1.279 5.264 5.264 0 0 0-1.522 3.706c0 1.39.548 2.723 1.522 3.705a5.186 5.186 0 0 0 2.066 1.278c.857.281 1.607-.462 1.607-1.349v-7.27Z"/><path d="M32.965 31.098c-1.442 0-2.601-.227-3.478-.68-.865-.465-1.517-1.043-1.955-1.734a.416.416 0 0 1-.052-.187c0-.125.057-.227.173-.306l.986-.731a.286.286 0 0 1 .208-.085c.103 0 .201.062.294.187.773 1.224 2.07 1.836 3.893 1.836.796 0 1.471-.142 2.025-.425.565-.284.848-.737.848-1.36 0-.465-.161-.827-.485-1.088-.311-.26-.796-.493-1.453-.697-.6-.181-.975-.289-1.125-.323-.992-.283-1.707-.504-2.146-.663-1.107-.408-1.84-.878-2.198-1.41-.357-.534-.536-1.089-.536-1.667 0-.476.15-.986.45-1.53.311-.555.796-1.025 1.453-1.41.67-.397 1.506-.595 2.51-.595 1.05 0 1.932.13 2.647.39.716.25 1.396.67 2.042 1.258.081.08.121.159.121.238 0 .114-.057.204-.173.272l-1.107.731a.469.469 0 0 1-.225.085c-.104 0-.202-.05-.294-.153-.692-.725-1.644-1.088-2.856-1.088-.692 0-1.228.102-1.609.306-.37.204-.617.431-.744.68-.115.25-.173.47-.173.663 0 .408.162.737.485.986.323.25.801.476 1.436.68.058.023.502.153 1.332.391.52.136 1.056.29 1.61.46 1.21.396 2.019.9 2.422 1.512.416.612.623 1.201.623 1.768 0 .612-.15 1.196-.45 1.75-.288.556-.801 1.02-1.54 1.395-.727.362-1.713.544-2.959.544ZM44.114 21.766c.865 0 1.667.249 2.405.748.739.487 1.108 1.388 1.108 2.702v5.321a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085H46.14a.423.423 0 0 1-.277-.085.407.407 0 0 1-.087-.272v-5.032c-.035-.646-.22-1.155-.554-1.53-.323-.373-.744-.56-1.263-.56-.37 0-.738.102-1.107.306-.358.192-.664.492-.918.9-.253.397-.403.896-.45 1.496v4.42a.365.365 0 0 1-.103.272c-.058.057-.145.085-.26.085h-1.125a.423.423 0 0 1-.276-.085.407.407 0 0 1-.087-.272v-8.193c0-.114.029-.199.087-.255a.378.378 0 0 1 .276-.102h1.125c.116 0 .202.034.26.102.069.056.103.141.103.255v.204c0 .079.012.141.035.187a.168.168 0 0 0 .121.05c.092 0 .214-.062.364-.186a4.02 4.02 0 0 1 1.038-.612c.38-.148.738-.221 1.073-.221ZM57.436 28.207c.023.34.081.607.173.8.093.18.289.322.589.424.184.068.277.165.277.29a.396.396 0 0 1-.052.17l-.485.951c-.092.204-.242.278-.45.221-.669-.147-1.13-.47-1.384-.969-.058-.124-.115-.187-.173-.187-.058 0-.121.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.056-1.02-.207-.408-.311-.799-.311-1.173 0-.612.19-1.161.571-1.648.392-.488.975-.828 1.748-1.02.53-.125 1.269-.221 2.215-.29.646-.045 1.113-.09 1.401-.135.231-.034.335-.17.312-.408-.058-.51-.23-.918-.52-1.224-.276-.318-.743-.476-1.4-.476-.428 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.104.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288 0-.034.011-.085.034-.153a3.292 3.292 0 0 1 1.367-1.564c.635-.397 1.46-.595 2.475-.595.992 0 1.834.255 2.526.765.693.498 1.062 1.224 1.108 2.176.011.453.017 1.06.017 1.819.012.759.017 1.308.017 1.648Zm-4.326 1.445c.312 0 .652-.073 1.021-.22.38-.148.715-.403 1.004-.766.3-.374.484-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.162-.09-.277-.067l-.675.067c-.75.069-1.361.148-1.834.238-.462.08-.86.227-1.194.442a.984.984 0 0 0-.485.884c0 .465.208.782.623.952.416.17.871.255 1.367.255ZM64.486 21.766c1.107 0 1.967.26 2.578.782.611.51 1.027 1.116 1.246 1.819a6.83 6.83 0 0 1 .329 2.073c0 .692-.11 1.389-.329 2.091-.22.692-.635 1.298-1.246 1.82-.611.509-1.47.764-2.578.764-.9 0-1.65-.238-2.25-.714-.08-.08-.161-.119-.242-.119-.116 0-.173.096-.173.29v3.569c0 .113-.035.198-.104.255-.058.068-.144.102-.26.102H60.42a.378.378 0 0 1-.277-.102c-.058-.057-.086-.142-.086-.255V22.344c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.038c.116 0 .202.034.26.102.069.056.104.141.104.255 0 .09.011.164.034.22.035.046.075.069.122.069.057 0 .109-.023.155-.068.612-.533 1.396-.8 2.354-.8Zm-.173 7.785c.888 0 1.54-.3 1.955-.9.427-.601.64-1.338.64-2.21 0-.873-.213-1.61-.64-2.21-.415-.601-1.067-.902-1.955-.902-.877 0-1.518.3-1.921.901-.393.59-.589 1.326-.589 2.21 0 .884.197 1.627.589 2.227.403.59 1.044.884 1.92.884ZM76.268 31.097c-1.316 0-2.452-.277-3.41-.833a5.531 5.531 0 0 1-2.163-2.277c-.484-.975-.726-2.08-.726-3.315 0-1.236.242-2.335.727-3.298a5.507 5.507 0 0 1 2.163-2.295c.957-.555 2.094-.833 3.409-.833 1.246 0 2.324.25 3.236.748a5.437 5.437 0 0 1 2.163 2.09c.034.069.052.131.052.188 0 .125-.087.215-.26.272l-1.298.323a.39.39 0 0 1-.12.017c-.151 0-.266-.074-.347-.221-.715-1.156-1.857-1.734-3.426-1.734-.97 0-1.771.221-2.406.663a3.907 3.907 0 0 0-1.401 1.75c-.3.715-.45 1.491-.45 2.33 0 .838.15 1.615.45 2.329.3.713.767 1.291 1.401 1.733.635.442 1.437.663 2.406.663.911 0 1.701-.21 2.37-.628.681-.42 1.165-1.06 1.454-1.921.08-.216.225-.306.433-.272l1.315.17c.196.034.294.124.294.272 0 .022-.012.079-.035.17-.507 1.303-1.246 2.283-2.215 2.94-.957.646-2.163.97-3.616.97ZM91.216 28.207c.023.34.08.607.173.8.092.18.288.322.588.424.185.068.277.165.277.29a.396.396 0 0 1-.052.17l-.484.951c-.093.204-.243.278-.45.221-.67-.147-1.13-.47-1.385-.969-.057-.124-.115-.187-.173-.187-.057 0-.12.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.055-1.02-.208-.408-.312-.799-.312-1.173 0-.612.19-1.161.571-1.648.393-.488.975-.828 1.748-1.02.53-.125 1.27-.221 2.215-.29.646-.045 1.113-.09 1.402-.135.23-.034.334-.17.311-.408-.057-.51-.23-.918-.519-1.224-.277-.318-.744-.476-1.401-.476-.427 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.103.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288a.53.53 0 0 1 .034-.153 3.293 3.293 0 0 1 1.368-1.564c.634-.397 1.459-.595 2.474-.595.992 0 1.834.255 2.527.765.692.498 1.06 1.224 1.107 2.176.012.453.017 1.06.017 1.819.012.759.018 1.308.018 1.648Zm-4.326 1.445c.311 0 .651-.073 1.02-.22.381-.148.716-.403 1.004-.766.3-.374.485-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.161-.09-.277-.067l-.675.067c-.75.069-1.36.148-1.834.238-.461.08-.86.227-1.194.442a.984.984 0 0 0-.484.884c0 .465.207.782.622.952.416.17.871.255 1.368.255ZM95.687 30.536a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085h-1.125a.424.424 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.029-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.116 0 .202.034.26.102.069.056.104.141.104.255v11.746ZM100.033 30.536a.364.364 0 0 1-.104.272c-.057.057-.144.085-.26.085h-1.124a.423.423 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.115 0 .202.034.26.102.069.056.103.141.103.255v11.746Z" stroke="#fff" stroke-width=".5"/><path d="M43.151 8.686c.296 0 .554-.036.774-.108.22-.076.402-.182.546-.318.148-.14.258-.308.33-.504.072-.2.108-.422.108-.666a1.75 1.75 0 0 0-.108-.63 1.245 1.245 0 0 0-.324-.48 1.41 1.41 0 0 0-.546-.3 2.516 2.516 0 0 0-.78-.108h-1.206v3.114h1.206Zm0-4.362c.58 0 1.082.068 1.506.204.424.136.774.326 1.05.57.276.244.48.536.612.876.136.34.204.712.204 1.116 0 .42-.07.806-.21 1.158-.14.348-.35.648-.63.9s-.632.448-1.056.588c-.42.14-.912.21-1.476.21h-1.206V13h-1.614V4.324h2.82Zm6.819 2.424c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222Zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516Zm12.85-5.106L60.866 13h-1.188c-.136 0-.23-.088-.282-.264L58.29 9.178c-.036-.12-.07-.238-.102-.354a5.729 5.729 0 0 1-.072-.36 6.81 6.81 0 0 1-.084.366c-.028.12-.06.24-.096.36l-1.122 3.546c-.048.176-.154.264-.318.264h-1.14l-1.95-6.156h1.182c.108 0 .2.026.276.078a.363.363 0 0 1 .15.198l.882 3.288c.044.18.082.356.114.528.036.172.066.344.09.516.044-.172.09-.344.138-.516l.162-.528 1.02-3.3a.382.382 0 0 1 .138-.198.429.429 0 0 1 .258-.078h.654c.104 0 .192.026.264.078a.363.363 0 0 1 .15.198l.99 3.3c.052.18.1.358.144.534.048.172.094.344.138.516.052-.34.126-.69.222-1.05l.906-3.288a.405.405 0 0 1 .15-.198.429.429 0 0 1 .258-.078h1.128Zm4.704 2.37c0-.192-.028-.372-.084-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.826.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm6.668-2.196c.192-.368.42-.656.684-.864a1.45 1.45 0 0 1 .936-.318c.284 0 .512.062.684.186l-.096 1.11a.294.294 0 0 1-.09.156.239.239 0 0 1-.15.042c-.06 0-.15-.01-.27-.03a2.01 2.01 0 0 0-.342-.03 1.11 1.11 0 0 0-.786.282c-.1.088-.19.196-.27.324a3.44 3.44 0 0 0-.216.438V13h-1.482V6.844h.87c.152 0 .258.028.318.084.06.052.1.148.12.288l.09.696Zm6.87 1.302c0-.192-.029-.372-.085-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.827.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm9.134-1.692a1.451 1.451 0 0 0-.552-.432 1.597 1.597 0 0 0-.636-.126c-.224 0-.426.042-.606.126a1.21 1.21 0 0 0-.462.384 1.8 1.8 0 0 0-.294.648c-.068.26-.102.568-.102.924 0 .36.028.666.084.918.06.248.144.452.252.612.108.156.24.27.396.342.156.068.33.102.522.102.308 0 .57-.064.786-.192.216-.128.42-.31.612-.546v-2.76Zm1.482-4.332V13h-.906c-.196 0-.32-.09-.372-.27l-.126-.594a3.09 3.09 0 0 1-.858.69c-.32.176-.694.264-1.122.264-.336 0-.644-.07-.924-.21a2.098 2.098 0 0 1-.726-.606 3.033 3.033 0 0 1-.468-.99 5.072 5.072 0 0 1-.162-1.344c0-.456.062-.88.186-1.272s.302-.732.534-1.02c.232-.288.51-.512.834-.672a2.384 2.384 0 0 1 1.092-.246c.344 0 .638.054.882.162.244.108.462.254.654.438V4.084h1.482Zm5.863 7.32c.168.204.35.348.546.432.2.084.41.126.63.126.228 0 .432-.04.612-.12.184-.084.34-.212.468-.384a1.93 1.93 0 0 0 .294-.666 4.05 4.05 0 0 0 .102-.972c0-.676-.112-1.164-.336-1.464-.224-.304-.546-.456-.966-.456-.284 0-.532.066-.744.198a2.38 2.38 0 0 0-.606.546v2.76Zm0-3.804a3.02 3.02 0 0 1 .822-.618c.304-.156.65-.234 1.038-.234.356 0 .676.07.96.21.288.14.532.342.732.606.204.26.36.576.468.948.108.372.162.79.162 1.254 0 .5-.062.954-.186 1.362a3.132 3.132 0 0 1-.534 1.05 2.4 2.4 0 0 1-.828.672c-.324.16-.684.24-1.08.24a2.103 2.103 0 0 1-.954-.216 1.891 1.891 0 0 1-.366-.246c-.108-.1-.212-.21-.312-.33l-.066.414c-.024.104-.066.178-.126.222a.37.37 0 0 1-.234.066h-.978V4.084h1.482V7.6Zm10.743-.756-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084H97.68l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188Z"/></g></svg>'],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(i),o=new Image;o.onload=()=>{const i=e.width/r-o.width-16,a=e.height/r-o.height-16;n?.drawImage(o,i,a),t(e)},o.src=a})),bo=async e=>{const{videoWidth:t,videoHeight:r}=e,n=t>r?"landscape":"portrait",i="portrait"===n?t:r,a="landscape"===n?r:t,o="landscape"===n?(t-i)/2:0,s="portrait"===n?(r-a)/2:0,c=document.createElement("canvas"),l=c.getContext("2d"),d=window.devicePixelRatio||1;c.width=i*d,c.height=a*d,l?.scale(d,d),l?.drawImage(e,o,s,i,a,0,0,c.width/d,c.height/d);return(await yo(c)).toDataURL("image/jpeg")},wo=async e=>{const t=document.createElement("video"),r=new MediaStream;r.addTrack(e),t.srcObject=r,t.setAttribute("muted","true");const n=e.getSettings();t.width=n.width||0,t.height=n.height||0,await t.play();const i=document.createElement("canvas"),a=i.getContext("2d");i.height=t.height,i.width=t.width,a?.drawImage(t,0,0);return(await yo(i)).toDataURL("image/jpeg")};var xo=a("eEB2e"),_o=(Fi=a("4Fy4N"),{}),So=_o&&_o.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),ko=_o&&_o.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Co=_o&&_o.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&So(t,e,r);return ko(t,e),t},Eo=_o&&_o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_o,"__esModule",{value:!0}),_o.debug=_o.parseScalabilityMode=_o.detectDevice=_o.Device=_o.version=_o.types=void 0;const Ro=Eo(a("hZG0u"));_o.debug=Ro.default;var Po=a("1ZHQC");Object.defineProperty(_o,"Device",{enumerable:!0,get:function(){return Po.Device}}),Object.defineProperty(_o,"detectDevice",{enumerable:!0,get:function(){return Po.detectDevice}});const To=Co(a("cQumC"));_o.types=To,_o.version="3.6.53";var jo=a("fT1lN");Object.defineProperty(_o,"parseScalabilityMode",{enumerable:!0,get:function(){return jo.parse}});const Oo=new po("StreamerMediasoup");function Mo(){try{const r=navigator.userAgent,n=Fi.getParser(r);e="DeviceDetectionForced",t=!0,Qa().setTag(e,t),ro({type:"debug",category:"browser",data:n.getResult()});const i=n.getOS();if("Safari"===n.getBrowserName()&&"iOS"===i.name&&Number(i.version)>=14.3)return new(0,_o.Device)({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){Oo.error("deviceAutoDetection",e),to(e)}var e,t;return new(0,_o.Device)({handlerName:"Chrome74"})}class Io{constructor(e,t){this.mediasoupDevice=e,this.config=t}static async create(e,t){const r=await e.request("getRouterRtpCapabilities");r.headerExtensions=r.headerExtensions?.filter((e=>"urn:3gpp:video-orientation"!==e.uri));const n=function(){try{return new(0,_o.Device)}catch(e){return Oo.error("failed to detects device from mediasoup, fallback on auto detection",e),Mo()}}();return n.load({routerRtpCapabilities:r}),new Io(n,t)}getRtpCapabilities(){return this.mediasoupDevice.rtpCapabilities}async createTransportConfig(e){const t=await e.request("createWebRtcTransport");return{id:t.id,iceParameters:t.iceParameters,iceCandidates:t.iceCandidates,dtlsParameters:{...t.dtlsParameters,role:"auto"},sctpParameters:t.sctpParameters,iceServers:this.config.iceServers,proprietaryConstraints:{optional:[{googDscp:!0}]},additionalSettings:{encodedInsertableStreams:!1}}}async createSendTransport(e){const t=this.mediasoupDevice.createSendTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{Oo.log("dtlsParameters",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),t.on("produce",(async({kind:r,rtpParameters:n,appData:i},a,o)=>{try{const{id:o}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:i});a({id:o}),Oo.log("producerTransport: ",t)}catch(e){o(e)}})),t}async createRecvTransport(e){const t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{Oo.log("dtls",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),t}async createTransport(e,t){return"send"===t?await this.createSendTransport(e):await this.createRecvTransport(e)}}var Lo={};(function(){"use strict";var e;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t];for(var r=0;r<e.length;++r){var n=e[r];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function a(e,t){if(t)e:{var r=i;e=e.split(".");for(var a=0;a<e.length-1;a++){var o=e[a];if(!(o in r))break e;r=r[o]}(t=t(a=r[e=e[e.length-1]]))!=a&&null!=t&&n(r,e,{configurable:!0,writable:!0,value:t})}}function o(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function s(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:r(e)}}function c(e){if(!(e instanceof Array)){e=s(e);for(var t,r=[];!(t=e.next()).done;)r.push(t.value);e=r}return e}a("Symbol",(function(e){function t(e,t){this.g=e,n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(n||"")+"_"+i++,n)}})),a("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<t.length;a++){var s=i[t[a]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return o(r(this))}})}return e}));var l,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)l=Object.setPrototypeOf;else{var u;e:{var p={};try{p.__proto__={a:!0},u=p.a;break e}catch(e){}u=!1}l=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=l;function f(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var r in t)if("prototype"!=r)if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n)}else e[r]=t[r];e.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function v(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,r){return e.g=r,{value:t}}function b(e){this.g=new m,this.h=e}function w(e,t,r,n){try{var i=t.call(e.g.i,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var a=i.value}catch(t){return e.g.i=null,v(e.g,t),x(e)}return e.g.i=null,n.call(e.g,a),x(e)}function x(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,v(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function _(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=x(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(v(e.g,t),t=x(e)),t},this.return=function(t){return function(e,t){g(e.g);var r=e.g.i;return r?w(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),x(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function S(e,t){return t=new _(new b(t)),h&&e.prototype&&h(t,e.prototype),t}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s};var k="function"==typeof Object.assign?Object.assign:function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};a("Object.assign",(function(e){return e||k})),a("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.g=null}function n(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;r.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var a=i.setTimeout;r.prototype.i=function(e){a(e,0)},r.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.j(e)}}}this.g=null},r.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var r=null!=e;break e;case"function":r=!0;break e;default:r=!1}r?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;a((function(){if(e.B()){var t=i.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,r=i.dispatchEvent;return void 0===r||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,r(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)o.h(this.g[e]);this.g=null}};var o=new r;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var r=this.j();try{e.call(t,r.resolve,r.reject)}catch(e){r.reject(e)}},t.prototype.then=function(e,r){function n(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){a(e)}}:t}var i,a,o=new t((function(e,t){i=e,a=t}));return this.J(n(e,i),n(r,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function r(){switch(n.h){case 1:e(n.i);break;case 2:t(n.i);break;default:throw Error("Unexpected state: "+n.h)}}var n=this;null==this.g?o.h(r):this.g.push(r),this.o=!0},t.resolve=n,t.reject=function(e){return new t((function(t,r){r(e)}))},t.race=function(e){return new t((function(t,r){for(var i=s(e),a=i.next();!a.done;a=i.next())n(a.value).J(t,r)}))},t.all=function(e){var r=s(e),i=r.next();return i.done?n([]):new t((function(e,t){function a(t){return function(r){o[t]=r,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,n(i.value).J(a(o.length-1),t),i=r.next()}while(!i.done)}))},t})),a("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),a("Array.prototype.includes",(function(e){return e||function(e,t){var r=this;r instanceof String&&(r=String(r));var n=r.length;for(0>(t=t||0)&&(t=Math.max(t+n,0));t<n;t++){var i=r[t];if(i===e||Object.is(i,e))return!0}return!1}})),a("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),a("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var r=0,n=!1,i={next:function(){if(!n&&r<e.length){var i=r++;return{value:t(i,e[i]),done:!1}}return n=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var C=this||self;function E(e,t){e=e.split(".");var r,n=C;e[0]in n||void 0===n.execScript||n.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===t?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t}function R(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var P,T,j="undefined"!=typeof TextDecoder,O="undefined"!=typeof TextEncoder;function M(e){if(O)e=(T||(T=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var r=0,n=new Uint8Array(3*e.length),i=0;i<e.length;i++){var a=e.charCodeAt(i);if(128>a)n[r++]=a;else{if(2048>a)n[r++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&i<e.length){var o=e.charCodeAt(++i);if(56320<=o&&57343>=o){a=1024*(a-55296)+o-56320+65536,n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");a=65533}n[r++]=a>>12|224,n[r++]=a>>6&63|128}n[r++]=63&a|128}}e=n.subarray(0,r)}return e}var I={},L=null;function D(e,t){void 0===t&&(t=0),N(),t=I[t];for(var r=Array(Math.floor(e.length/3)),n=t[64]||"",i=0,a=0;i<e.length-2;i+=3){var o=e[i],s=e[i+1],c=e[i+2],l=t[o>>2];o=t[(3&o)<<4|s>>4],s=t[(15&s)<<2|c>>6],c=t[63&c],r[a++]=l+o+s+c}switch(l=0,c=n,e.length-i){case 2:c=t[(15&(l=e[i+1]))<<2]||n;case 1:e=e[i],r[a]=t[e>>2]+t[(3&e)<<4|l>>4]+c+n}return r.join("")}function A(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):-1!="=.".indexOf(e[t-1])&&(r=-1!="=.".indexOf(e[t-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),i=L[r];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}N();for(var n=0;;){var i=r(-1),a=r(0),o=r(64),s=r(64);if(64===s&&-1===i)break;t(i<<2|a>>4),64!=o&&(t(a<<4&240|o>>2),64!=s&&t(o<<6&192|s))}}(e,(function(e){n[i++]=e})),n.subarray(0,i)}function N(){if(!L){L={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));I[r]=n;for(var i=0;i<n.length;i++){var a=n[i];void 0===L[a]&&(L[a]=i)}}}}var B,F="function"==typeof Uint8Array.prototype.slice;function z(e,t,r){return t===r?B||(B=new Uint8Array(0)):F?e.slice(t,r):new Uint8Array(e.subarray(t,r))}var U=0;function V(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.l=!1,this.v=t,e&&H(this,e)}function H(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?A(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.j=0,e.i=e.h.length,e.g=e.j}function $(e){var t=e.h,r=t[e.g],n=127&r;return 128>r?(e.g+=1,n):(n|=(127&(r=t[e.g+1]))<<7,128>r?(e.g+=2,n):(n|=(127&(r=t[e.g+2]))<<14,128>r?(e.g+=3,n):(n|=(127&(r=t[e.g+3]))<<21,128>r?(e.g+=4,n):(n|=(15&(r=t[e.g+4]))<<28,128>r?(e.g+=5,n>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&e.g++,n)))))}function W(e){var t=e.h[e.g],r=e.h[e.g+1],n=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,e=2*((r=(t<<0|r<<8|n<<16|i<<24)>>>0)>>31)+1,t=r>>>23&255,r&=8388607,255==t?r?NaN:1/0*e:0==t?e*Math.pow(2,-149)*r:e*Math.pow(2,t-150)*(r+Math.pow(2,23))}V.prototype.reset=function(){this.g=this.j};var q=[];function G(){this.g=new Uint8Array(64),this.h=0}function Z(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function K(e){var t={},r=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=r,t=this.o,q.length?(r=q.pop(),t&&(r.v=t.v),e&&H(r,e),e=r):e=new V(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function Y(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.m=e.g.g;var r=7&(t=$(e.g));return 0!=r&&5!=r&&1!=r&&2!=r&&3!=r&&4!=r?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=r,!0)}function Q(e){switch(e.h){case 0:if(0!=e.h)Q(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Q(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Q(e);else{var t=$(e.g);(e=e.g).g+=t}break;case 5:5!=e.h?Q(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!Y(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Q(e)}break;default:e.j=!0}}function J(e,t,r){var n=e.g.i,i=$(e.g);return i=e.g.g+i,e.g.i=i,r(t,e),e.g.g=i,e.g.i=n,t}function X(e){var t,r=$(e.g),n=(e=e.g).g;if(e.g+=r,e=e.h,j)(t=P)||(t=P=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(n,n+r));else{r=n+r;for(var i,a,o,s=[],c=null;n<r;)128>(i=e[n++])?s.push(i):224>i?n>=r?s.push(65533):(a=e[n++],194>i||128!=(192&a)?(n--,s.push(65533)):s.push((31&i)<<6|63&a)):240>i?n>=r-1?s.push(65533):128!=(192&(a=e[n++]))||224===i&&160>a||237===i&&160<=a||128!=(192&(t=e[n++]))?(n--,s.push(65533)):s.push((15&i)<<12|(63&a)<<6|63&t):244>=i?n>=r-2?s.push(65533):128!=(192&(a=e[n++]))||0!=a-144+(i<<28)>>30||128!=(192&(t=e[n++]))||128!=(192&(o=e[n++]))?(n--,s.push(65533)):(i=(7&i)<<18|(63&a)<<12|(63&t)<<6|63&o,i-=65536,s.push(55296+(i>>10&1023),56320+(1023&i))):s.push(65533),8192<=s.length&&(c=R(c,s),s.length=0);t=R(c,s)}return t}function ee(){this.h=[],this.i=0,this.g=new G}function te(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function re(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var r=e.h,n=r.length,i=0,a=0;a<n;a++){var o=r[a];0!==o.length&&(t.set(o,i),i+=o.length)}return 0!==(n=(r=e.g).h)&&(t.set(r.g.subarray(0,n),i),r.h=0),e.h=[t],t}function ne(e,t,r){if(null!=r){Z(e.g,8*t+5),e=e.g;var n=r;0===(n=(r=0>n?1:0)?-n:n)?0<1/n?U=0:(0,U=2147483648):isNaN(n)?(0,U=2147483647):34028234663852886e22<n?(0,U=(r<<31|2139095040)>>>0):11754943508222875e-54>n?(n=Math.round(n/Math.pow(2,-149)),0,U=(r<<31|n)>>>0):(t=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-t),n=8388607&Math.round(8388608*n),0,U=(r<<31|t+127<<23|n)>>>0),r=U,e.push(r>>>0&255),e.push(r>>>8&255),e.push(r>>>16&255),e.push(r>>>24&255)}}G.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},G.prototype.length=function(){return this.h},G.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,z(e,0,t)},K.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var ie="function"==typeof Uint8Array;function ae(e,t,r){if(null!=e)return"object"==typeof e?ie&&e instanceof Uint8Array?r(e):oe(e,t,r):t(e)}function oe(e,t,r){if(Array.isArray(e)){for(var n=Array(e.length),i=0;i<e.length;i++)n[i]=ae(e[i],t,r);return Array.isArray(e)&&e.W&&de(n),n}for(i in n={},e)n[i]=ae(e[i],t,r);return n}function se(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var ce,le={W:{value:!0,configurable:!0}};function de(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,le),e}function ue(e,t,r){var n=ce;if(ce=null,e||(e=n),n=this.constructor.ca,e||(e=n?[n]:[]),this.j=n?0:-1,this.i=null,this.g=e,e=(n=this.g.length)-1,n&&null!==(n=this.g[e])&&"object"==typeof n&&n.constructor===Object?(this.l=e-this.j,this.h=n):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,r)for(t=0;t<r.length;t++)(e=r[t])<this.l?(e+=this.j,(n=this.g[e])?de(n):this.g[e]=pe):(he(this),(n=this.h[e])?de(n):this.h[e]=pe)}var pe=Object.freeze(de([]));function he(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function fe(e,t,r){return-1===t?null:void 0!==r&&r||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function me(e){var t=void 0!==t&&t,r=fe(e,1,t);return null==r&&(r=pe),r===pe&&ve(e,1,r=de([]),t),r}function ge(e,t,r){return null==(e=null==(e=fe(e,t))?e:+e)?void 0===r?0:r:e}function ve(e,t,r,n){void 0!==n&&n||t>=e.l?(he(e),e.h[t]=r):e.g[t+e.j]=r}function ye(e,t){e.i||(e.i={});var r=e.i[1];if(!r){var n=me(e);r=[];for(var i=0;i<n.length;i++)r[i]=new t(n[i]);e.i[1]=r}return r}function be(e,t,r,n){var i=ye(e,r);t=t||new r,e=me(e),null!=n?(i.splice(n,0,t),e.splice(n,0,we(t,!1))):(i.push(t),e.push(we(t,!1)))}function we(e,t){if(e.i)for(var r in e.i){var n=e.i[r];if(Array.isArray(n))for(var i=0;i<n.length;i++)n[i]&&we(n[i],t);else n&&we(n,t)}return e.g}function xe(e,t){return null==(e=fe(e,t))?0:e}function _e(e,t){return null==(e=fe(e,t))?"":e}function Se(e,t){if(e=e.m){te(t,t.g.end());for(var r=0;r<e.length;r++)te(t,e[r])}}function ke(e,t){if(4==t.h)return!1;var r=t.m;return Q(t),t.N||(t=z(t.g.h,r,t.g.g),(r=e.m)?r.push(t):e.m=[t]),!0}function Ce(e,t){var r=void 0;return new(r||(r=Promise))((function(n,i){function a(e){try{s(t.next(e))}catch(e){i(e)}}function o(e){try{s(t.throw(e))}catch(e){i(e)}}function s(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(a,o)}s((t=t.apply(e,void 0)).next())}))}function Ee(e){ue.call(this,e)}function Re(e,t){for(;Y(t);)switch(t.i){case 8:var r=$(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 26:ve(e,3,r=X(t));break;case 34:ve(e,4,r=X(t));break;default:if(!ke(e,t))return e}return e}function Pe(e){ue.call(this,e,-1,Te)}ue.prototype.toJSON=function(){return oe(we(this,!1),se,D)},ue.prototype.toString=function(){return we(this,!1).toString()},f(Ee,ue),f(Pe,ue),Pe.prototype.addClassification=function(e,t){be(this,e,Ee,t)};var Te=[1];function je(e){ue.call(this,e)}function Oe(e,t){for(;Y(t);)switch(t.i){case 13:var r=W(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 29:ve(e,3,r=W(t.g));break;case 37:ve(e,4,r=W(t.g));break;case 45:ve(e,5,r=W(t.g));break;default:if(!ke(e,t))return e}return e}function Me(e){ue.call(this,e,-1,Ie)}f(je,ue),f(Me,ue);var Ie=[1];function Le(e){ue.call(this,e)}function De(e,t,r){if(r=e.createShader(0===r?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(r));return r}function Ae(e){return ye(e,Ee).map((function(e){return{index:xe(e,1),Y:ge(e,2),label:null!=fe(e,3)?_e(e,3):void 0,displayName:null!=fe(e,4)?_e(e,4):void 0}}))}function Ne(e){return{x:ge(e,1),y:ge(e,2),z:ge(e,3),visibility:null!=fe(e,4)?ge(e,4):void 0}}function Be(e,t){this.h=e,this.g=t,this.l=0}function Fe(e,t,r){return function(e,t){var r=e.g;if(void 0===e.m){var n=De(r,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=De(r,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),a=r.createProgram();if(r.attachShader(a,n),r.attachShader(a,i),r.linkProgram(a),!r.getProgramParameter(a,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(a));n=e.m=a,r.useProgram(n),i=r.getUniformLocation(n,"sampler0"),e.j={I:r.getAttribLocation(n,"aVertex"),H:r.getAttribLocation(n,"aTex"),da:i},e.s=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.enableVertexAttribArray(e.j.I),r.vertexAttribPointer(e.j.I,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),e.o=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.enableVertexAttribArray(e.j.H),r.vertexAttribPointer(e.j.H,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.uniform1i(i,0)}n=e.j,r.useProgram(e.m),r.canvas.width=t.width,r.canvas.height=t.height,r.viewport(0,0,t.width,t.height),r.activeTexture(r.TEXTURE0),e.h.bindTexture2d(t.glName),r.enableVertexAttribArray(n.I),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.vertexAttribPointer(n.I,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.vertexAttribPointer(n.H,2,r.FLOAT,!1,0,0),r.bindFramebuffer(r.DRAW_FRAMEBUFFER?r.DRAW_FRAMEBUFFER:r.FRAMEBUFFER,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.colorMask(!0,!0,!0,!0),r.drawArrays(r.TRIANGLE_FAN,0,4),r.disableVertexAttribArray(n.I),r.disableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):r?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function ze(e){this.g=e}f(Le,ue);var Ue=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Ve(e,t){return t+e}function He(e,t){window[e]=t}function $e(e){if(this.g=e,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=e&&e.locateFile||Ve,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=t,e.options)for(var r=(t=s(Object.keys(e.options))).next();!r.done;r=t.next()){r=r.value;var n=e.options[r].default;void 0!==n&&(this.j[r]="function"==typeof n?n():n)}}function We(e){return Ce(e,(function e(){var t,r,n,i,a,o,s,l,d,u,p,h=this;return S(e,(function(e){switch(e.g){case 1:return t=h,h.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(h,h.j),y(e,function(){return Ce(this,(function e(){return S(e,(function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(Ue),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):e.return();case 2:if(n=e.h,"object"==typeof window)return He("createMediapipeSolutionsWasm",{locateFile:h.locateFile}),He("createMediapipeSolutionsPackedAssets",{locateFile:h.locateFile}),o=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),l=Promise.all(o.map((function(e){var r=qe(t,e.url);if(void 0!==e.path){var n=e.path;r=r.then((function(e){return t.overrideFile(n,e),Promise.resolve(e)}))}return r}))),d=Promise.all(s.map((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(t.locateFile(e.url,t.S)):Promise.resolve()}))).then((function(){return Ce(t,(function e(){var t,r,n=this;return S(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,r=window.createMediapipeSolutionsPackedAssets,y(e,t(r),2);n.h=e.h,e.g=0}))}))})),u=Ce(t,(function e(){var t=this;return S(e,(function(e){return t.g.graph&&t.g.graph.url?e=y(e,qe(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),y(e,Promise.all([d,l,u]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=r.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),y(e,createMediapipeSolutionsWasm(Module),6);case 6:h.h=e.h,h.l=new OffscreenCanvas(1,1),h.h.canvas=h.l,a=h.h.GL.createContext(h.l,{antialias:!1,alpha:!1,ba:"undefined"!=typeof WebGL2RenderingContext?2:1}),h.h.GL.makeContextCurrent(a),e.g=4;break;case 7:if(h.l=document.createElement("canvas"),!(p=h.l.getContext("webgl2",{}))&&!(p=h.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();h.D=p,h.h.canvas=h.l,h.h.createContext(h.l,!0,!0,{});case 4:h.i=new h.h.SolutionWasm,h.R=!1,e.g=0}}))}))}function qe(e,t){return Ce(e,(function e(){var r,n,i=this;return S(e,(function(e){return t in i.F?e.return(i.F[t]):(r=i.locateFile(t,""),n=fetch(r).then((function(e){return e.arrayBuffer()})),i.F[t]=n,e.return(n))}))}))}function Ge(e,t,r){return Ce(e,(function e(){var n,i,a,o,c,l,d,u,p,h,f,m,g,v,b=this;return S(e,(function(e){switch(e.g){case 1:if(!r)return e.return(t);for(n={},i=0,a=s(Object.keys(r)),o=a.next();!o.done;o=a.next())c=o.value,"string"!=typeof(l=r[c])&&"texture"===l.type&&void 0!==t[l.stream]&&++i;1<i&&(b.G=!1),d=s(Object.keys(r)),o=d.next();case 2:if(o.done){e.g=4;break}if(u=o.value,"string"==typeof(p=r[u]))return g=n,v=u,y(e,function(e,t,r){return Ce(e,(function e(){var n,i=this;return S(e,(function(e){return"number"==typeof r||r instanceof Uint8Array||r instanceof i.h.Uint8BlobList?e.return(r):r instanceof i.h.Texture2dDataOut?((n=i.s[t])||(n=new Be(i.h,i.D),i.s[t]=n),e.return(Fe(n,r,i.G))):e.return(void 0)}))}))}(b,u,t[p]),14);if(h=t[p.stream],"detection_list"===p.type){if(h){for(var w=h.getRectList(),x=h.getLandmarksList(),_=h.getClassificationsList(),k=[],C=0;C<w.size();++C){var E=w.get(C);e:{var R=new Le;for(E=new K(E);Y(E);)switch(E.i){case 13:var P=W(E.g);ve(R,1,P);break;case 21:ve(R,2,P=W(E.g));break;case 29:ve(R,3,P=W(E.g));break;case 37:ve(R,4,P=W(E.g));break;case 45:ve(R,5,P=W(E.g));break;case 48:for(var T=E.g,j=128,O=0,M=P=0;4>M&&128<=j;M++)O|=(127&(j=T.h[T.g++]))<<7*M;if(128<=j&&(O|=(127&(j=T.h[T.g++]))<<28,P|=(127&j)>>4),128<=j)for(M=0;5>M&&128<=j;M++)P|=(127&(j=T.h[T.g++]))<<7*M+3;128>j?(T=O>>>0,(P=2147483648&(j=P>>>0))&&(j=~j>>>0,0==(T=1+~T>>>0)&&(j=j+1>>>0)),T=4294967296*j+(T>>>0),P=P?-T:T):(T.l=!0,P=void 0),ve(R,6,P);break;default:if(!ke(R,E))break e}}R={Z:ge(R,1),$:ge(R,2),height:ge(R,3),width:ge(R,4),rotation:ge(R,5,0),X:xe(R,6)},P=x.get(C);e:for(E=new Me,P=new K(P);Y(P);)if(10===P.i)be(E,T=J(P,new je,Oe),je,void 0);else if(!ke(E,P))break e;E=ye(E,je).map(Ne),T=_.get(C);e:for(P=new Pe,T=new K(T);Y(T);)if(10===T.i)P.addClassification(J(T,new Ee,Re));else if(!ke(P,T))break e;R={T:R,O:E,M:Ae(P)},k.push(R)}w=k}else w=[];n[u]=w,e.g=7;break}if("proto_list"===p.type){if(h){for(w=Array(h.size()),x=0;x<h.size();x++)w[x]=h.get(x);h.delete()}else w=[];n[u]=w,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===p.type){n[u]=h,e.g=7;break}if("proto"===p.type){n[u]=h,e.g=7;break}if("texture"!==p.type)throw Error("Unknown output config type: '"+p.type+"'");return(f=b.s[u])||(f=new Be(b.h,b.D),b.s[u]=f),y(e,Fe(f,h,b.G),13);case 13:m=e.h,n[u]=m;case 7:p.transform&&n[u]&&(n[u]=p.transform(n[u])),e.g=3;break;case 14:g[v]=e.h;case 3:o=d.next(),e.g=2;break;case 4:return e.return(n)}}))}))}function Ze(e,t){for(var r=t.name||"$",n=[].concat(c(t.wants)),i=new e.h.StringList,a=s(t.wants),o=a.next();!o.done;o=a.next())i.push_back(o.value);a=e.h.PacketListener.implement({onResults:function(i){for(var a={},o=0;o<t.wants.length;++o)a[n[o]]=i.get(o);var s=e.listeners[r];s&&(e.C=Ge(e,a,t.outs).then((function(r){r=s(r);for(var i=0;i<t.wants.length;++i){var o=a[n[i]];"object"==typeof o&&o.hasOwnProperty&&o.hasOwnProperty("delete")&&o.delete()}r&&(e.C=r)})))}}),e.i.attachMultiListener(i,a),i.delete()}function Ke(e){return void 0===e&&(e=0),1===e?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function Ye(e){var t=this;e=e||{},this.g=new $e({locateFile:e.locateFile,files:function(e){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:Ke(e.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(e){return Ce(t,(function t(){var r,n,i,a=this;return S(t,(function(t){return 1==t.g?(r=Ke(e),n="third_party/mediapipe/modules/selfie_segmentation/"+r,y(t,qe(a.g,r),2)):(i=t.h,a.g.overrideFile(n,i),t.return(!0))}))}))}}}})}(e=$e.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){return Ce(this,(function e(){var t=this;return S(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},e.setOptions=function(e,t){var r=this;if(t=t||this.g.options){for(var n=[],i=[],a={},o=s(Object.keys(e)),c=o.next();!c.done;a={K:a.K,L:a.L},c=o.next()){var l=c.value;l in this.j&&this.j[l]===e[l]||(this.j[l]=e[l],void 0!==(c=t[l])&&(c.onChange&&(a.K=c.onChange,a.L=e[l],n.push(function(e){return function(){return Ce(r,(function t(){var r=this;return S(t,(function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(r.o=!0),t.g=0}))}))}}(a))),c.graphOptionXref&&(l={valueNumber:1===c.type?e[l]:0,valueBoolean:0===c.type&&e[l],valueString:2===c.type?e[l]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),l),i.push(c))))}0===n.length&&0===i.length||(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(n))}},e.initialize=function(){return Ce(this,(function e(){var t=this;return S(e,(function(e){return 1==e.g?y(e,We(t),2):3!=e.g?y(e,Ce(t,(function e(){var t,r,n,i,a,o,c,l,d=this;return S(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,y(e,qe(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),r=s(Object.keys(d.B)),n=r.next();!n.done;n=r.next())i=n.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(a=s(d.g.listeners),o=a.next();!o.done;o=a.next())c=o.value,Ze(d,c);l=d.j,d.j={},d.setOptions(l),e.g=0}))})),3):y(e,function(e){return Ce(e,(function e(){var t,r,n,i,a,o,c=this;return S(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=s(c.u),r=t.next();case 3:if(r.done){e.g=5;break}return y(e,(0,r.value)(),4);case 4:r=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(n=new c.h.GraphOptionChangeRequestList,i=s(c.A),a=i.next();!a.done;a=i.next())o=a.value,n.push_back(o);c.i.changeOptions(n),n.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},e.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){return Ce(this,(function r(){var n,i,a,o,c,l,d,u,p,h=this;return S(r,(function(r){switch(r.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(r,h.C,2)):r.return();case 2:return y(r,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,a=s(Object.keys(e)),o=a.next();!o.done;o=a.next())if(c=o.value,l=h.g.inputs[c]){e:{var f=h,m=e[c];switch(l.type){case"video":var g=f.m[l.stream];if(g||(g=new Be(f.h,f.D),f.m[l.stream]=g),0===(f=g).l&&(f.l=f.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&m instanceof HTMLVideoElement){var v=m.videoWidth;g=m.videoHeight}else"undefined"!=typeof HTMLImageElement&&m instanceof HTMLImageElement?(v=m.naturalWidth,g=m.naturalHeight):(v=m.width,g=m.height);g={glName:f.l,width:v,height:g},(v=f.g).canvas.width=g.width,v.canvas.height=g.height,v.activeTexture(v.TEXTURE0),f.h.bindTexture2d(f.l),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,m),f.h.bindTexture2d(0),f=g;break e;case"detections":for((g=f.m[l.stream])||(g=new ze(f.h),f.m[l.stream]=g),(f=g).data||(f.data=new f.g.DetectionListData),f.data.reset(m.length),g=0;g<m.length;++g){v=m[g];var b=f.data,w=b.setBoundingBox,x=g,_=v.T,S=new Le;ve(S,1,_.Z),ve(S,2,_.$),ve(S,3,_.height),ve(S,4,_.width),ve(S,5,_.rotation),ve(S,6,_.X);var k=_=new ee;ne(k,1,fe(S,1)),ne(k,2,fe(S,2)),ne(k,3,fe(S,3)),ne(k,4,fe(S,4)),ne(k,5,fe(S,5));var C=fe(S,6);if(null!=C&&null!=C){Z(k.g,48);var E=k.g,R=C;C=0>R;var P=(R=Math.abs(R))>>>0;for(R=Math.floor((R-P)/4294967296),R>>>=0,C&&(R=~R>>>0,4294967295<(P=1+(~P>>>0))&&(P=0,4294967295<++R&&(R=0))),C=U=P,P=R;0<P||127<C;)E.push(127&C|128),C=(C>>>7|P<<25)>>>0,P>>>=7;E.push(C)}if(Se(S,k),_=re(_),w.call(b,x,_),v.O)for(b=0;b<v.O.length;++b)k=!!(S=v.O[b]).visibility,x=(w=f.data).addNormalizedLandmark,_=g,S=Object.assign(Object.assign({},S),{visibility:k?S.visibility:0}),ve(k=new je,1,S.x),ve(k,2,S.y),ve(k,3,S.z),S.visibility&&ve(k,4,S.visibility),ne(E=S=new ee,1,fe(k,1)),ne(E,2,fe(k,2)),ne(E,3,fe(k,3)),ne(E,4,fe(k,4)),ne(E,5,fe(k,5)),Se(k,E),S=re(S),x.call(w,_,S);if(v.M)for(b=0;b<v.M.length;++b){if(x=(w=f.data).addClassification,_=g,S=v.M[b],ve(k=new Ee,2,S.Y),S.index&&ve(k,1,S.index),S.label&&ve(k,3,S.label),S.displayName&&ve(k,4,S.displayName),E=S=new ee,null!=(P=fe(k,1))&&null!=P)if(Z(E.g,8),C=E.g,0<=P)Z(C,P);else{for(R=0;9>R;R++)C.push(127&P|128),P>>=7;C.push(1)}ne(E,2,fe(k,2)),null!=(C=fe(k,3))&&(C=M(C),Z(E.g,26),Z(E.g,C.length),te(E,E.g.end()),te(E,C)),null!=(C=fe(k,4))&&(C=M(C),Z(E.g,34),Z(E.g,C.length),te(E,E.g.end()),te(E,C)),Se(k,E),S=re(S),x.call(w,_,S)}}f=f.data;break e;default:f={}}}switch(d=f,u=l.stream,l.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:n}));break;case"detections":(p=d).stream=u,p.timestamp=n,i.pushDetectionList(p);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return h.i.send(i),y(r,h.C,4);case 4:i.delete(),r.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},E("Solution",$e),E("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=Ye.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Ce(this,(function e(){var t=this;return S(e,(function(e){return y(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Ce(this,(function t(){var r=this;return S(t,(function(t){return y(t,r.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},E("SelfieSegmentation",Ye),E("VERSION","0.1.1632777926")}).call(Lo);const Do=new po("MediaPipe"),Ao="https://stream-assets.snapcall.io/v1.8.0";let No=!1;const Bo=new Lo.SelfieSegmentation({locateFile:(e,t)=>(Do.debug("selfieSegmentation",e,t),`${Ao}/mediapipe/${e}`)});var Fo,zo,Uo,Vo;zo=function(e,t,r){if(t===self.location.origin)return e;var n=r?"import "+JSON.stringify(e)+";":"importScripts("+JSON.stringify(e)+");";return URL.createObjectURL(new Blob([n],{type:"application/javascript"}))};var Ho={};function $o(e){return(""+e).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/.+)\/[^/]+$/,"$1")+"/"}Uo=function(e){var t=Ho[e];return t||(t=function(){try{throw new Error}catch(t){var e=(""+t.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^)\n]+/g);if(e)return $o(e[2])}return"/"}(),Ho[e]=t),t},Vo=function(e){var t=(""+e).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^/]+/);if(!t)throw new Error("Origin not found");return t[0]};let Wo=Uo("adfgW")+a("juxiN").resolve("5WDBY");Fo=zo(Wo,Vo(Wo),!1);class qo{fillColor="#000000";type="blur";live=!1;fps=24;blurLevel=10;timerWorker=new Worker(Fo,{name:"VirtualBackgroundTimerWorker"});constructor(e,t){this.stream=e,this.image=document.createElement("video"),this.image.style.display="none",this.image.setAttribute("autoplay",""),this.image.setAttribute("playsinline",""),this.image.setAttribute("muted",""),this.canvas=document.createElement("canvas"),this.canvas.style.display="none",t&&this.setOptions(t)}setOptions(e){this.setType(e.type),this.setFillColor(e.fillColor||this.fillColor),this.setVideoBackground(e.background),this.setBlurLevel(e.blurLevel||this.blurLevel)}setType(e){this.type=e}setBlurLevel(e){this.blurLevel=e}setVideoBackground(e){this.background=e}setFillColor(e){this.fillColor=e}drawWithBlur(e,t){e.save(),e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.filter=`blur(${this.blurLevel}px)`,e.globalCompositeOperation="destination-over",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}drawWithBackground(e,t){e.clearRect(0,0,this.canvas.width,this.canvas.height),e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="source-out",e.fillStyle=this.fillColor,this.background?e.drawImage(this.background,0,0,this.canvas.width,this.canvas.height):e.fillRect(0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}onFrame(e){this.canvas.width=e.image.width,this.canvas.height=e.image.height;const t=this.canvas.getContext("2d");if(t)switch(this.type){case"blur":default:this.drawWithBlur(t,e);break;case"background":this.drawWithBackground(t,e)}}runWithFrameCallback(){this.live&&this.image.requestVideoFrameCallback((()=>{Bo.send({image:this.image}),this.runWithFrameCallback()}))}async createStream(){try{const e={selfieMode:!1,modelSelection:0};Bo.setOptions(e),Do.log("selfie segmentation initialized"),No||(await Bo.initialize(),No=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{Bo.onResults((e=>{this.onFrame(e)})),this.timerWorker.onmessage=()=>{Bo.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){Do.error("createStream:play",e)}}}catch(e){console.error("createStream",e)}return this.canvas.captureStream()}clean(){return new Promise((e=>{this.live=!1,clearInterval(this.runInterval),this.image.srcObject=null,this.stream.getTracks().forEach((e=>{e.stop(),this.stream.removeTrack(e)})),this.timerWorker.terminate(),e()}))}}const Go=new po("StreamerClient"),Zo="WRTC1",Ko="WRTC2",Yo="TRANS1",Qo="CONS1",Jo="SOCK1",Xo="USERLIMIT",es={qvga:{width:{ideal:320},height:{ideal:240},qualityIndex:3},vga:{width:{ideal:640},height:{ideal:480},qualityIndex:2},hd:{width:{ideal:1280},height:{ideal:720},qualityIndex:1}};class ts extends CustomEvent{constructor(e,t){super(e,t)}}const rs=EventTarget,ns={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10};const is=new class extends rs{mediasoupTransport={};mediaPipeOption=ns;useVideoBackground=!1;pendingDeviceRequest={};joinOptions={};devicesList=[];constructor(){super(),navigator.mediaDevices.addEventListener("devicechange",(()=>this.onDeviceChange())),this.config={apiUrl:String("https://api.snapcall.io/v2"),streamerServer:String("wss://g.snapcall.io/stream"),streamerApi:String("https://g.snapcall.io/stream"),iceServers:[{urls:"turns:t.snapcall.io:443?transport=tcp,turns:t2.snapcall.io:443?transport=tcp,turn:t.snapcall.io:80?transport=tcp,turn:t2.snapcall.io:80?transport=tcp,turn:t.snapcall.io:80?transport=udp,turn:t2.snapcall.io:80?transport=udp"?.split(",")||[],username:"test",credential:"test",credentialType:"password"}]},this.peers=new Map,this.consumers=new Map,this.webcams=new Map,this.webcam={device:null,resolution:"hd"},this.webcamTrack=null,this.webcamZoom={available:!1,min:0,max:0},this.muted=!1,this.roomId="",this.peerId="",this.webcamProducer=null,this.screenshareProducer=null,this.customMessages=new Map,this.audioRenderers={},this.profile={}}getState(){const e=[];return this.peers.forEach(((t,r)=>{const n={microphone:{enabled:!1,muted:!1},camera:{enabled:!1},screenshare:{enabled:!1}};t.producersData.forEach((e=>{"microphone"===e.deviceType?(n.microphone.enabled=!0,n.microphone.muted=e.paused):"screen"===e.deviceType?n.screenshare.enabled=!0:"webcam"===e.deviceType&&(n.camera.enabled=!0)})),e.push({peerId:r,profile:t.profile,deviceState:n})})),{roomId:this.roomId,peerId:this.peerId,profile:this.profile,callId:void 0,deviceState:this.getDevicesState(),peers:e}}onStartSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new ts("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e),this.protoo.notify("startSpeak")}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new ts("localStopSpeak",{detail:{}});this.dispatchEvent(e),this.protoo.notify("stopSpeak")}}onCriticalError(e){const t=new ts("criticalError",{detail:{code:e}});this.dispatchEvent(t)}async generateToken(e){const t=this.config.streamerApi,{token:r}=await fetch(`${t}/stream`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({bid:e})}).then((e=>e.json()));return r}async init(e=this.roomId,t=this.joinOptions){if(this.roomId=e,this.joinOptions=t,!this.roomId)throw new Error("Missing room ID");let r;this.peerId||(this.peerId=Yi());try{const{instanceId:t}=await fetch(`${this.config.streamerApi}/instance/${this.roomId}`,{method:"get",headers:{"Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid room ID")}));r=`${this.config.streamerServer}/${t}/?roomId=${e}&peerId=${this.peerId}`}catch(e){const t=new ts("invalidRoom",{detail:{}});this.dispatchEvent(t)}if(!r)throw new Error("Invalid socket URL");this.protooTransport=new Zi(r,{retry:{retries:0}}),this.protoo=new Gi(this.protooTransport),this.protoo.on("open",(()=>{this.joinRoom()})),this.protoo.on("failed",(()=>{Go.error("protoo.on","failed"),this.onCriticalError(Jo)})),this.protoo.on("disconnected",(()=>{Go.error("protoo.on","disconnected"),this.onCriticalError(Jo)})),this.protoo.on("close",(()=>Go.log("protoo.on","close :("))),this.protoo.on("notification",(async e=>{if(Go.log("notification",e),"error"===e.method)"reached user limit"===e.data?.reason&&this.onCriticalError(Xo);else if("newPeer"===e.method){const{id:t,profile:r}=e.data;this.peers.set(t,{id:t,peerId:t,profile:r,producersData:[]});const n=new ts("newPeer",{detail:{peerId:t,displayName:r.name,profile:r}});this.dispatchEvent(n)}else if("newProducer"===e.method){const{peerId:t,producerId:r,deviceType:n,paused:i}=e.data;await this.consumeProducer({peerId:t,producerId:r,deviceType:n,paused:i})}else if("peerClosed"===e.method){const{peerId:t,relatedConsumers:r}=e.data;this.peers.delete(t),r.forEach((e=>{this.onConsumerClose({consumerId:e.id})}));const n=new ts("peerClosed",{detail:{peerId:t}});this.dispatchEvent(n)}else if("consumerClosed"===e.method){const{consumerId:t}=e.data;this.onConsumerClose({consumerId:t})}else if("displayName"===e.method){const{peerId:t,displayName:r}=e.data,n=new ts("displayName",{detail:{peerId:t,displayName:r,profile:{}}});this.dispatchEvent(n)}else if("profile"===e.method){const{peerId:t,profile:r}=e.data,n=new CustomEvent("profileUpdate",{detail:{peerId:t,profile:r}});this.dispatchEvent(n)}else if("requestDevice"===e.method){this.pendingDeviceRequest[e.data.requestId]=e.data;const t=new ts("requestDevice",{detail:e.data});this.dispatchEvent(t)}else if("startSpeak"===e.method);else if("stopSpeak"===e.method);else if("producerPaused"===e.method||"producerResumed"===e.method){const{peerId:t,producerId:r,deviceType:n}=e.data;if("microphone"===e.data?.deviceType){const n=this.peers.get(t)?.producersData.find((e=>r===e.producerId));n&&(n.paused="producerPaused"===e.method)}let i=r;for(let[,e]of Array.from(this.consumers.entries()))if(e.mediaSoupConsumer.producerId===r){i=e.mediaSoupConsumer.id;break}const a="producerPaused"===e.method?"mediaPause":"mediaResume",o=new ts(a,{detail:{mediaId:i,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(o)}else if("requestDeviceResult"===e.method){const t=new ts(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();const t=new ts(e.method,{detail:e.data});this.dispatchEvent(t)}else if("customMessage"===e.method){const{messageId:t,chunk:r,chunkIndex:n,totalChunks:i}=e.data.event,a=this.customMessages.get(t);a?a.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:i});const o=this.customMessages.get(t);if(o&&o.totalChunks===o.chunks.length){const r=o.chunks.sort(((e,t)=>e.index-t.index)).reduce(((e,t)=>e+t.data),""),n=JSON.parse(r),i=new ts("customMessage",{detail:{...e.data,event:n}});this.dispatchEvent(i),this.customMessages.delete(t)}}}))}closeWebrtcTransport(e){const t=this.mediasoupTransport[e];t&&(t?.transport?.close(),clearTimeout(t?.disconnectTimeout),delete this.mediasoupTransport[e])}async getTransport(e,t){if(!this.streamerMediasoup)throw new Error("streamerMediasoup not initialized");let r=this.mediasoupTransport[`${e}-${t}`];if(r)return r&&r.transport?r.transport:r.createPromise;try{const n=this.streamerMediasoup.createTransport(this.protoo,t);r={disconnectTimeout:void 0,kind:e,createPromise:n},this.mediasoupTransport[`${e}-${t}`]=r,r.transport=await n,r.transport&&this.listenWebRTCTransportStates(r)}catch(e){throw this.onCriticalError(Yo),e}return r.transport}listenWebRTCTransportStates(e){if(!e.transport)throw new Error("can not listen states of undefined transport");e.transport.on("connectionstatechange",(t=>{if(e.transport&&!e.transport.closed)if(Go.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout((()=>{Go.log("listenWebRTCTransportStats",`trying to restart transport for ${e.kind}`),e.transport&&this.restartIce(e.transport)}),5e3);else if("connected"===t)clearTimeout(e.disconnectTimeout);else if("failed"===t){const t=new Error(`webRTC transport state failed for ${e.kind}`);to(t,{extra:{direction:e.transport?.direction,id:e.transport?.id,kind:e.kind}}),Go.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Zo)}}))}async joinRoom(){this.streamerMediasoup=await Io.create(this.protoo,this.config);const{apiKey:e,email:t}=this.joinOptions;if(e)try{let r=null;e&&t?r=await this.fetchAgentInfo({apiKey:e,email:t}):e&&(r=await this.fetchUserInfo({apiKey:e})),r&&this.dispatchEvent(new ts("agentIdentity",{detail:{success:!0,email:this.joinOptions.email}}))}catch(e){Go.warn("joinRoom",e),this.dispatchEvent(new ts("agentIdentity",{detail:{success:!1}}))}const{peers:r}=await this.protoo.request("getRoomPeers",{apiKey:e,email:t});this.peers=new Map(r.map((e=>[e.id||e.peerId,{...e,peerId:e.id||e.peerId}])));const n=await this.getCallId();this.dispatchEvent(new ts("enterRoom",{detail:{peerId:this.peerId,peers:r.map((e=>({...e,peerId:e.id||e.peerId}))),callId:n}})),Go.log("joinRoom","peers",r),this.joinOptions.displayName&&await this.setDisplayName(this.joinOptions.displayName),this.joinOptions.profile&&await this.setProfile(this.joinOptions.profile),r.forEach((e=>{this.consumePeer({peerId:e.id||e.peerId,producersData:e.producersData})}))}async switchMicrophone(e){try{Go.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.micProducer?.track?.stop(),Go.log("switchMicrophone","stopping previous track"));const t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new mo(t,this);const r=t.getAudioTracks()[0];await(this.micProducer?.replaceTrack({track:r})),Go.log("switchMicrophone","switched Microphone")}catch(e){Go.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){const e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;const t=new ts("microphoneMute",{detail:{}});this.dispatchEvent(t),await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){Go.log("onDeviceChange","detecting device change");const e=new ts("devicesListChange",{detail:{}});if(this.dispatchEvent(e),!this.protoo.closed&&this.micProducer){const e=await navigator.mediaDevices.enumerateDevices(),t=e.filter((e=>"audioinput"===e.kind));if(0===t.length)return Go.warn("onDeviceChange","no audio input device"),void await this.closeMicrophoneProducer();const r=t.find((e=>"default"===e.deviceId));if(r){const t=e.filter((e=>!Boolean(this.devicesList.find((t=>t.deviceId===e.deviceId&&t.label===e.label)))));Go.log("onDeviceChange",t),this.devicesList=e;const n=Boolean(t.find((e=>"audioinput"===e.kind)));if(0!==t.length&&!1===n)return void Go.warn("onDeviceChange","no audio input change");if(Go.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){const e=new ts("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),Go.log("onDeviceChange","new default audio input trying to switch new :",r.deviceId,r.label)}this.switchMicrophone("default")}else this.switchMicrophone()}}async enableMicrophone(){if(!this.micProducer||this.micProducer?.closed){const e=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{noiseSuppression:!0,echoCancellation:!0}}));this.devicesList=await navigator.mediaDevices.enumerateDevices();const t=await this.getTransport("audio","send");this.audioLevel=new mo(e,this);const r=e.getAudioTracks()[0],n="microphone",i=await t.produce({track:r,codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:n}});i.on("transportclose",(()=>{Go.log("enableMicrophone","micproducer transportclose")})),r.addEventListener("ended",(()=>{Go.log("enableMicrophone","track ended!")})),i.on("trackended",(async()=>{Go.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()})),this.micProducer=i,this.muted=!1;const a=new ts("microphoneEnabled",{detail:{}});this.dispatchEvent(a)}}async muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer?.pause(),await this.protoo.request("pauseProducer",{producerId:this.micProducer?.id}),this.muted=!0;const e=new ts("microphoneMute",{detail:{}});this.dispatchEvent(e)}}async unMuteMicrophone(){if(this.micProducer){this.micProducer.resume(),this.resolvePendingDeviceRequest("microphone",!0),await this.protoo.request("resumeProducer",{producerId:this.micProducer.id}),this.muted=!1;const e=new ts("microphoneUnmute",{detail:{}});this.dispatchEvent(e)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){Go.log("release");for(let e in this.mediasoupTransport)this.closeWebrtcTransport(e);this.mediaPipe&&(this.mediaPipe.clean(),this.mediaPipe=void 0),this.webcamTrack?.stop(),this.webcamTrack=null,this.protooTransport.close(),this.protoo.close(),this.micProducer?.close(),this.screenshareProducer?.close(),this.webcamProducer?.close(),this.consumers.forEach((e=>{e.mediaSoupConsumer.close()})),this.consumers.clear(),this.audioLevel?.release()}endCall(){this.release();const e=new ts("leaveRoom",{detail:{}});this.dispatchEvent(e);const t=new CustomEvent("snapcallEvent_callEnd");window.dispatchEvent(t)}terminateRoom(){this.protoo.request("terminateRoom")}async updateWebcams(){this.webcams=new Map;const e=await navigator.mediaDevices.enumerateDevices();for(const t of e)"videoinput"===t.kind&&this.webcams.set(t.deviceId,t);0===this.webcams.size?this.webcam.device=null:this.webcam.device||(this.webcam.device=this.webcams.values().next().value);const t=new ts("webcamsUpdate",{detail:{numberOfAvailableWebcams:this.webcams.size}});this.dispatchEvent(t)}isVideoZoomAvailable(){return this.webcamZoom.available}resolvePendingDeviceRequest(e,t,r){Object.keys(this.pendingDeviceRequest).forEach((n=>{const i=this.pendingDeviceRequest[n];e===i.deviceType&&(delete this.pendingDeviceRequest[n],this.protoo.notify("requestDeviceResult",{result:Boolean(t),failure:r,...i}))}))}async handleGetUserMediaError(e,t){let r,n;try{r=await t}catch(e){n=e}finally{if(this.resolvePendingDeviceRequest(e,Boolean(r),n?.name),n)throw n;return r}}async restartIce(e){if(Go.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed)try{const t=await this.protoo.request("restartIce",{transportId:e.id});Go.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(t){this.onCriticalError(Ko),Go.log("restartIce","restartIceFailed",t),to(t,{extra:{direction:e.direction,id:e.id}})}}scaleVideoMediasConstraintsParameter(e){let t=es.hd;2===e?t=es.vga:e>2&&(t=es.qvga),(!this.webcam.resolution||es[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(Go.log("scaleVideoMediasConstraintsParameter",`scaling video by ${e}`,t),this.webcamProducer?.track?.applyConstraints(t))}scaleVideoEncodingsParameter(){if(!this.useVideoBackground)try{let e=0;this.consumers.forEach((t=>{"video"===t.mediaSoupConsumer.kind&&e++})),this.screenshareProducer&&!this.screenshareProducer.closed&&e++;let t={scaleResolutionDownBy:1};if(e>=3&&(t={scaleResolutionDownBy:2}),e>=9&&(t={scaleResolutionDownBy:4}),!xo.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(Go.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch((e=>{Go.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)})))}catch(e){Go.error("scaleVideoEncodingsParameter","scaleVideo error",e)}}setVideoBackground(e){this.mediaPipe?.setOptions(e),this.mediaPipeOption=e}async initVideoBackground(){!0!==this.useVideoBackground&&(this.useVideoBackground=!0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async stopVideoBackground(){!1!==this.useVideoBackground&&(this.useVideoBackground=!1,await(this.mediaPipe?.clean()),this.mediaPipe=void 0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async switchWebcam({device:e,resolution:t,rotate:r}){if(!this.webcam.device)throw new Error("no webcam devices");if(r){const e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknow";let r=e.indexOf(t);r<e.length-1?r++:r=0;const n=this.webcams.get(e[r]);if(!n)throw new Error("no webcam device");this.webcam.device=n,this.webcam.resolution="hd"}else e&&(this.webcam.device=e),t&&(this.webcam.resolution=t);let n=es[t||this.webcam.resolution];this.useVideoBackground&&(n={width:{ideal:560},height:{ideal:400},qualityIndex:2});const i=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{deviceId:{ideal:this.webcam.device.deviceId},...n}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new qo(i,this.mediaPipeOption));const a=await(this.mediaPipe?.createStream())||i;if(!await this.getTransport("video","send"))throw new Error("video transport not found, can not switch");const o=a.getVideoTracks()[0];await(this.webcamProducer?.replaceTrack?.({track:o}));const s=await(o.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(s?.zoom),min:s?.zoom?.min||0,max:s?.zoom?.max||0};const c=new ts("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(c)}async enableVideo(e){if(await this.updateWebcams(),e?.device&&(this.webcam.device=e.device),!this.webcam.device)throw new Error("no webcam devices");let t=es[e?.resolution||this.webcam.resolution];this.useVideoBackground&&(t={width:{ideal:560},height:{ideal:400},qualityIndex:2});const r=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{deviceId:{ideal:this.webcam.device.deviceId},...t}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new qo(r,this.mediaPipeOption));const n=await(this.mediaPipe?.createStream())||r;await this.updateWebcams();const i=await this.getTransport("video","send"),a=n.getVideoTracks()[0];this.webcamTrack=a;const o=await(a.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(o?.zoom),min:o?.zoom?.min||0,max:o?.zoom?.max||0};this.webcamProducer=await i.produce({track:a,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"webcam"}}),this.scaleVideoEncodingsParameter(),this.webcamProducer.on("transportclose",(()=>{this.webcamProducer=null})),this.webcamProducer.on("trackended",(()=>{this.disableVideo().catch((()=>{}))}));const s=new ts("localVideoAvailable",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(s)}async rotateVideo(){await this.switchWebcam({rotate:!0})}async zoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:2*this.webcamZoom.min}]})}async unzoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:this.webcamZoom.min}]})}async disableVideo(){if(!this.webcamProducer)return;this.webcamProducer.close(),await this.protoo.request("closeProducer",{producerId:this.webcamProducer.id}),this.webcamProducer=null;const e=new ts("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(){const e=await this.handleGetUserMediaError("screen",navigator.mediaDevices.getDisplayMedia({audio:!1,video:{displaySurface:"monitor",logicalSurface:!0,width:{max:1920},height:{max:1080},frameRate:{max:30}}}));if(!e)return;const t=await this.getTransport("video","send"),r=e.getVideoTracks()[0];this.screenshareProducer=await t.produce({track:r,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"screen",share:!0}}),this.screenshareProducer.on("transportclose",(()=>{this.screenshareProducer=null})),this.screenshareProducer.on("trackended",(()=>{this.disableScreenshare().catch((()=>{}))}));const n=new ts("screenshareEnabled",{detail:{}});this.dispatchEvent(n)}async disableScreenshare(){this.screenshareProducer&&(this.screenshareProducer.close(),await this.protoo.request("closeProducer",{producerId:this.screenshareProducer.id}),this.screenshareProducer=null);const e=new ts("screenshareDisabled",{detail:{}});this.dispatchEvent(e)}onConsumerClose({consumerId:e}){const t=this.consumers.get(e);if(t){const r=t.mediaSoupConsumer.producerId;this.peers.forEach((e=>{const t=e.producersData.findIndex((e=>e.producerId===r));-1!==t&&e.producersData.splice(t,1)})),t.mediaSoupConsumer.close(),this.consumers.delete(e),this.scaleVideoEncodingsParameter();const n=new ts("mediaStop",{detail:{mediaId:e,peerId:String(t.mediaSoupConsumer.appData.peerId),deviceType:t.deviceType,paused:!1}});"microphone"===t.deviceType&&this.deleteAudioRenderer(e),this.dispatchEvent(n)}}requestVideo({mediaId:e,element:t}){Go.info("requestVideo");const r=this.consumers.get(e);if(r){const e=new MediaStream;e.onremovetrack=()=>Go.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>Go.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else Go.error("requestVideo",`Video consumer ${r} not found`)}async captureVideo(e){let t;if(e)t=await bo(e);else{if(!this.webcamProducer||!this.webcamProducer.track)throw new Error("no video to capture");t=await wo(this.webcamProducer.track)}return t}requestLocalVideo(e){if(Go.info("requestLocalVideo"),this.webcamProducer){const t=new MediaStream;t.addTrack(this.webcamProducer.track),e.srcObject=t;const r=this.webcamProducer.track?.getSettings();return{facingMode:r?.facingMode||"user"}}throw new Error("webcam producer not available yet")}requestLocalScreenshare(e){if(this.screenshareProducer){const t=new MediaStream;t.addTrack(this.screenshareProducer.track),e.srcObject=t}else Go.log("requestLocalScreenshare","screenshare producer not available yet")}consumePeer({peerId:e,producersData:t}){t.forEach((t=>{this.consumeProducer({peerId:e,producerId:t.producerId,deviceType:t.deviceType,paused:t.paused})}))}async consumeProducer({peerId:e,producerId:t,deviceType:r,paused:n}){const i="microphone"===r?"audio":"video",a=await this.getTransport(i,"recv"),o=await this.protoo.request("consume",{peerId:e,producerId:t,transportId:a.id,rtpCapabilities:this.streamerMediasoup.getRtpCapabilities()}),s=this.peers.get(e);s&&s.producersData.push({producerId:t,deviceType:r,paused:n});const{producerId:c,id:l,kind:d,rtpParameters:u,appData:p}=o;Go.log("consumeProducer","Data: ",o);try{const t=await a.consume({id:l,producerId:c,kind:d,rtpParameters:u,appData:{...p,peerId:e}});Go.log("transport",a),Go.log("consumer",t),this.consumers.set(t.id,{mediaSoupConsumer:t,deviceType:r}),this.scaleVideoEncodingsParameter();const i=new ts("mediaStart",{detail:{peerId:e,mediaId:t.id,deviceType:r,paused:n}});if(this.dispatchEvent(i),"audio"===t.kind){const e=this.createAudioRenderer(t.id),r=new MediaStream;r.addTrack(t.track),e.setSource(r),e.play()}"video"===t.kind&&await this.protoo.request("resumeConsumer",{consumerId:t.id})}catch(e){throw this.onCriticalError(Qo),Go.error("consumeProducer","newConsumer request failed",e),e}}async setDisplayName(e){await this.setProfile({name:e});const t=new ts("selfDisplayName",{detail:{peerId:this.peerId,displayName:this.profile?.name,profile:this.profile}});this.dispatchEvent(t)}async setProfile(e){const t=await this.protoo.request("setProfile",e);this.profile={...t};const r=new ts("selfProfileUpdate",{detail:{peerId:this.peerId,profile:this.profile}});this.dispatchEvent(r)}async requestPeerDevice(e,t){return this.protoo.request("requestPeerDevice",{remotePeerId:e,deviceType:t})}denyDeviceRequest(e){this.resolvePendingDeviceRequest(e,!1,"user denied permission")}async getCallId(){try{const{callId:e}=await this.protoo.request("getCallId");return e}catch(e){throw Go.error("getCallId","Failed to get callId"),e}}getConsumers(){return this.consumers}getDevicesState(){const e=!!this.micProducer&&!this.micProducer.closed,t=!!this.webcamProducer&&!this.webcamProducer.closed,r=!!this.screenshareProducer&&!this.screenshareProducer.closed;return{microphone:{enabled:e,muted:this.muted},camera:{enabled:t},screenshare:{enabled:r}}}getCustomMessageEventChunks(e){const t=JSON.stringify(e),r=[];for(let e=0;e<t.length;e+=9e4)r.push(t.substring(e,e+9e4));return r}async sendCustomMessageToAll(e){const t=Yi(),r=this.getCustomMessageEventChunks(e),n=r.map(((e,n)=>this.protoo.notify("customMessageToAllPeers",{messageId:t,chunkIndex:n,chunk:e,totalChunks:r.length})));await Promise.all(n)}async sendCustomMessage(e,t){const r=Yi(),n=this.getCustomMessageEventChunks(t),i=n.map(((t,i)=>this.protoo.notify("customMessageToPeer",{peerId:e,event:{messageId:r,chunkIndex:i,chunk:t,totalChunks:n.length}})));await Promise.all(i)}async listAudioDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter((e=>"audioinput"===e.kind||"audiooutput"===e.kind))}async listVideoDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter((e=>"videoinput"===e.kind))}isListDevicesSupported(){return Boolean(navigator.mediaDevices?.enumerateDevices)}getCurrentWebcam(){return this.webcam}getCurrentMicrophoneId(){return this.micProducer?.track?.getSettings().deviceId}getCurrentSpeakerId(){const e=Object.keys(this.audioRenderers),t=this.audioRenderers[e[0]];if(t){const e=t.getSink();if(e)return e}return"default"}async setWebcamResolution(e){if(this.webcam.device)await this.switchWebcam({resolution:e});else{this.webcam.resolution=e;const t=new ts("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){const t=new vo({consumerId:e});return this.audioRenderers[e]=t,t}deleteAudioRenderer(e){this.audioRenderers[e]?.destroy(),delete this.audioRenderers[e]}async playAudioRenderer(e){await(this.audioRenderers[e]?.play())}async setAudioSink(e){const t=Object.keys(this.audioRenderers).map((t=>this.audioRenderers[t].setSink(e).catch((e=>Go.warn("setAudioSink","Failed to setSinkId on renderer (consumerId: %s): ",t,e)))));await Promise.allSettled(t)}dispatchEvent(e){const t=super.dispatchEvent(e);return window.dispatchEvent(e),t}async fetchAgentInfo({apiKey:e,email:t}){const r=this.config.apiUrl;return await fetch(`${r}/agents/${t}`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid agent info")}))}async fetchUserInfo({apiKey:e}){const t=this.config.apiUrl;return await fetch(`${t}/users/me`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid user info")}))}setConfig(e){this.config={...this.config,...e}}};var as=(0,(Ie=a("85Hg2")).createContext)({});Ie=a("85Hg2");let os;var ss;(ss=os||(os={}))[ss.SET_STREAMS=0]="SET_STREAMS",ss[ss.ADD_STREAM=1]="ADD_STREAM",ss[ss.REMOVE_STREAM=2]="REMOVE_STREAM",ss[ss.DEVICE_UPDATE=3]="DEVICE_UPDATE",ss[ss.MUTE=4]="MUTE",ss[ss.UNMUTE=5]="UNMUTE",ss[ss.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",ss[ss.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",ss[ss.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",ss[ss.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";const cs={streams:[],highlightedTile:null},ls=(e,t)=>{switch(t.type){case os.SET_STREAMS:return{...e,streams:t.payload};case os.ADD_STREAM:return e.streams.find((e=>e.id===t.payload.id))?e:{...e,streams:[...e.streams,t.payload]};case os.REMOVE_STREAM:return{...e,streams:[...e.streams.filter((e=>e.id!==t.payload.id))]};case os.DEVICE_UPDATE:{const{streamId:r,mediaId:n,device:i,available:a,paused:o}=t.payload;return{...e,streams:e.streams.map((e=>{if(e.id===r){let t=e.muted;return"microphone"===i&&(t=o),{...e,[i]:a?n:null,muted:t}}return e}))}}case os.MUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!0}:e))};case os.UNMUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!1}:e))};case os.SET_HIGHLIGHTED_TILE:return{...e,highlightedTile:t.payload};case os.UNSET_HIGHLIGHTED_TILE:return{...e,highlightedTile:null};case os.SET_STREAM_PROFILE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e))};case os.SET_STREAM_SPEAKING:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e))};default:return e}},ds=(0,Ie.createContext)(void 0),us=({children:e})=>{const[t,r]=(0,Ie.useReducer)(ls,cs),n={state:t,dispatch:r};return(0,o.jsx)(ds.Provider,{value:n,children:e})},ps=()=>{const e=(0,Ie.useContext)(ds);if(void 0===e)throw new Error("useStreams must be used within a StreamsProvider");return{streams:e.state.streams,highlightedTile:e.state.highlightedTile,dispatch:e.dispatch}};var hs=e=>navigator.clipboard?navigator.clipboard.writeText(e):new Promise(((t,r)=>{((e,t,r)=>{const n=document.createRange(),i=document.createElement("textarea");if(i.value=e,document.body.appendChild(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.readOnly=!1,i.contentEditable="true",n.selectNodeContents(i);const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n)),i.setSelectionRange(0,999999)}else i.focus(),i.select();try{document.execCommand("copy")?t():r(new Error("Copy to clipboard fallback failed"))}catch(e){e instanceof Error?r(e):console.error(e)}document.body.removeChild(i)})(e,t,r)}));const fs=yr.path`
|
|
305
|
+
!function(e){var t=0,r=!1,n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,i)}catch(e){}var a=function(e){var r=e.target,n=window.innerWidth/window.document.documentElement.clientWidth;if(!(e.touches.length>1||1!==n)){for(;r!==document.body&&r!==document;){var i=window.getComputedStyle(r);if(!i)break;if("INPUT"===r.nodeName&&"range"===r.getAttribute("type"))return;var a=i.getPropertyValue("-webkit-overflow-scrolling"),o=i.getPropertyValue("overflow-y"),s=parseInt(i.getPropertyValue("height"),10),c="touch"===a&&("auto"===o||"scroll"===o),l=r.scrollHeight>r.offsetHeight;if(c&&l){var d=e.touches?e.touches[0].screenY:e.screenY,u=t<=d&&0===r.scrollTop,p=t>=d&&r.scrollHeight-r.scrollTop===s;return void((u||p)&&e.preventDefault())}r=r.parentNode}e.preventDefault()}},o=function(e){t=e.touches?e.touches[0].screenY:e.screenY},s=function(){window.addEventListener("touchstart",o,!!n&&{passive:!1}),window.addEventListener("touchmove",a,!!n&&{passive:!1}),r=!0},c=document.createElement("div");document.documentElement.appendChild(c),c.style.WebkitOverflowScrolling="touch";var l="getComputedStyle"in window&&"touch"===window.getComputedStyle(c)["-webkit-overflow-scrolling"];document.documentElement.removeChild(c),l&&s();var d={enable:s,disable:function(){window.removeEventListener("touchstart",o,!1),window.removeEventListener("touchmove",a,!1),r=!1},isEnabled:function(){return r},isScrollSupported:l};Ar&&(Ar=d),"function"==typeof e.define?(0,e.define)("iNoBounce",[],(function(){return d})):e.iNoBounce=d}(Ar);var tn={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},rn=new(function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.init(t,r)}return zr(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||tn,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,r,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(r).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,en(en({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}()),nn=function(){function e(){Br(this,e),this.observers={}}return zr(e,[{key:"on",value:function(e,t){var r=this;return e.split(" ").forEach((function(e){r.observers[e]=r.observers[e]||[],r.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,r)}))}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach((function(t){t.apply(t,[e].concat(r))}))}}}]),e}();function an(){var e,t,r=new Promise((function(r,n){e=r,t=n}));return r.resolve=e,r.reject=t,r}function on(e){return null==e?"":""+e}function sn(e,t,r){e.forEach((function(e){t[e]&&(r[e]=t[e])}))}function cn(e,t,r){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var a="string"!=typeof t?[].concat(t):t.split(".");a.length>1;){if(i())return{};var o=n(a.shift());!e[o]&&r&&(e[o]=new r),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return i()?{}:{obj:e,k:n(a.shift())}}function ln(e,t,r){var n=cn(e,t,Object);n.obj[n.k]=r}function dn(e,t){var r=cn(e,t),n=r.obj,i=r.k;if(n)return n[i]}function un(e,t,r){var n=dn(e,r);return void 0!==n?n:dn(t,r)}function pn(e,t,r){for(var n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?r&&(e[n]=t[n]):pn(e[n],t[n],r):e[n]=t[n]);return e}function hn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var fn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function mn(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return fn[e]})):e}var gn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,vn=[" ",",","?","!",";"];function yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wn(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}function xn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(r),i=e,a=0;a<n.length;++a){if(!i)return;if("string"==typeof i[n[a]]&&a+1<n.length)return;if(void 0===i[n[a]]){for(var o=2,s=n.slice(a,a+o).join(r),c=i[s];void 0===c&&n.length>a+o;)o++,c=i[s=n.slice(a,a+o).join(r)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(s)){if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s]}var l=n.slice(a+o).join(r);return l?xn(c,l,r):void 0}i=i[n[a]]}return i}}var _n=function(e){Hr(r,e);var t=wn(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Br(this,r),n=t.call(this),gn&&nn.call(Ur(n)),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return zr(r,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,t];r&&"string"!=typeof r&&(o=o.concat(r)),r&&"string"==typeof r&&(o=o.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(o=e.split("."));var s=dn(this.data,o);return s||!a||"string"!=typeof r?s:xn(this.data&&this.data[e]&&this.data[e][t],r,i)}},{key:"addResource",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var o=[e,t];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(n=t,t=(o=e.split("."))[1]),this.addNamespaces(t),ln(this.data,o,n),i.silent||this.emit("added",e,t,r,n)}},{key:"addResources",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in r)"string"!=typeof r[i]&&"[object Array]"!==Object.prototype.toString.apply(r[i])||this.addResource(e,t,i,r[i],{silent:!0});n.silent||this.emit("added",e,t,r)}},{key:"addResourceBundle",value:function(e,t,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(n=r,r=t,t=(o=e.split("."))[1]),this.addNamespaces(t);var s=dn(this.data,o)||{};n?pn(s,r,i):s=bn(bn({},s),r),ln(this.data,o,s),a.silent||this.emit("added",e,t,r)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?bn(bn({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),r}(nn),Sn={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,r,n,i){var a=this;return e.forEach((function(e){a.processors[e]&&(t=a.processors[e].process(t,r,n,i))})),t}};function kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Cn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function En(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}var Rn={},Pn=function(e){Hr(r,e);var t=En(r);function r(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Br(this,r),n=t.call(this),gn&&nn.call(Ur(n)),sn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,Ur(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=rn.create("translator"),n}return zr(r,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var r=this.resolve(e,t);return r&&void 0!==r.res}},{key:"extractFromKey",value:function(e,t){var r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],a=r&&e.indexOf(r)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,r){t=t||"",r=r||"";var n=vn.filter((function(e){return t.indexOf(e)<0&&r.indexOf(e)<0}));if(0===n.length)return!0;var i=new RegExp("(".concat(n.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),a=!i.test(e);if(!a){var o=e.indexOf(r);o>0&&!i.test(e.substring(0,o))&&(a=!0)}return a}(e,r,n));if(a&&!o){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};var c=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(n)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,n){var i=this;if("object"!==Nr(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),c=s.key,l=s.namespaces,d=l[l.length-1],u=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return a?(f.res="".concat(d).concat(h).concat(c),f):"".concat(d).concat(h).concat(c)}return a?(f.res=c,f):c}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||c,v=f&&f.exactUsedKey||c,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,_="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&_&&b.indexOf(y)<0&&("string"!=typeof w||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Cn(Cn({},t),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(f.res=S,f):S}if(o){var k="[object Array]"===y,C=k?[]:{},E=k?v:g;for(var R in m)if(Object.prototype.hasOwnProperty.call(m,R)){var P="".concat(E).concat(o).concat(R);C[R]=this.translate(P,Cn(Cn({},t),{joinArrays:!1,ns:l})),C[R]===P&&(C[R]=m[R])}m=C}}else if(x&&"string"==typeof w&&"[object Array]"===y)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,n));else{var T=!1,j=!1,O=void 0!==t.count&&"string"!=typeof t.count,M=r.hasDefaultValue(t),I=O?this.pluralResolver.getSuffix(u,t.count,t):"",L=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(m)&&M&&(T=!0,m=L),this.isValidLookup(m)||(j=!0,m=c);var D=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,A=D&&j?void 0:m,N=M&&L!==m&&this.options.updateMissing;if(j||T||N){if(this.logger.log(N?"updateKey":"missingKey",u,d,c,N?L:m),o){var B=this.resolve(c,Cn(Cn({},t),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var U=0;U<z.length;U++)F.push(z[U]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var V=function(e,r,n){var a=M&&n!==m?n:A;i.options.missingKeyHandler?i.options.missingKeyHandler(e,d,r,a,N,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,d,r,a,N,t),i.emit("missingKey",e,d,r,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(r){V([e],c+r,t["defaultValue".concat(r)]||L)}))})):V(F,c,L))}m=this.extendTranslation(m,e,t,f,n),j&&m===c&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(c)),(j||T)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(c):c,T?m:void 0):this.options.parseMissingKeyHandler(m))}return a?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,r,n,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Cn(Cn({},this.options.interpolation.defaultVariables),r),n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init(Cn(Cn({},r),{interpolation:Cn(Cn({},this.options.interpolation),r.interpolation)}));var o,s="string"==typeof e&&(r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var c=e.match(this.interpolator.nestingRegexp);o=c&&c.length}var l=r.replace&&"string"!=typeof r.replace?r.replace:r;if(this.options.interpolation.defaultVariables&&(l=Cn(Cn({},this.options.interpolation.defaultVariables),l)),e=this.interpolator.interpolate(e,l,r.lng||this.language,r),s){var d=e.match(this.interpolator.nestingRegexp);o<(d&&d.length)&&(r.nest=!1)}!1!==r.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return i&&i[0]===n[0]&&!r.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):a.translate.apply(a,n.concat([t]))}),r)),r.interpolation&&this.interpolator.reset()}var u=r.postProcess||this.options.postProcess,p="string"==typeof u?[u]:u;return null!=e&&p&&p.length&&!1!==r.applyPostProcessor&&(e=Sn.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Cn({i18nResolved:n},r):r,this)),e}},{key:"resolve",value:function(e){var t,r,n,i,a,o=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!o.isValidLookup(t)){var c=o.extractFromKey(e,s),l=c.key;r=l;var d=c.namespaces;o.options.fallbackNS&&(d=d.concat(o.options.fallbackNS));var u=void 0!==s.count&&"string"!=typeof s.count,p=u&&!s.ordinal&&0===s.count&&o.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,f=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);d.forEach((function(e){o.isValidLookup(t)||(a=e,!Rn["".concat(f[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(a)&&(Rn["".concat(f[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(r,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(r){if(!o.isValidLookup(t)){i=r;var a,c=[l];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(c,l,r,e,s);else{var d;u&&(d=o.pluralResolver.getSuffix(r,s.count,s));var f="".concat(o.options.pluralSeparator,"zero");if(u&&(c.push(l+d),p&&c.push(l+f)),h){var m="".concat(l).concat(o.options.contextSeparator).concat(s.context);c.push(m),u&&(c.push(m+d),p&&c.push(m+f))}}for(;a=c.pop();)o.isValidLookup(t)||(n=a,t=o.getResource(r,e,a,s))}})))}))}})),{res:t,usedKey:r,exactUsedKey:n,usedLng:i,usedNS:a}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}]),r}(nn);function Tn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var jn=function(){function e(t){Br(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=rn.create("languageUtils")}return zr(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],r=e.split("-");return this.options.lowerCaseLng?r=r.map((function(e){return e.toLowerCase()})):2===r.length?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tn(r[1].toLowerCase()))):3===r.length&&(r[0]=r[0].toLowerCase(),2===r[1].length&&(r[1]=r[1].toUpperCase()),"sgn"!==r[0]&&2===r[2].length&&(r[2]=r[2].toUpperCase()),t.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tn(r[1].toLowerCase())),t.indexOf(r[2].toLowerCase())>-1&&(r[2]=Tn(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,r=this;return e?(e.forEach((function(e){if(!t){var n=r.formatLanguageCode(e);r.options.supportedLngs&&!r.isSupportedCode(n)||(t=n)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var n=r.getLanguagePartFromCode(e);if(r.isSupportedCode(n))return t=n;t=r.options.supportedLngs.find((function(e){if(0===e.indexOf(n))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}},{key:"toResolveHierarchy",value:function(e,t){var r=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],a=function(e){e&&(r.isSupportedCode(e)?i.push(e):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):"string"==typeof e&&a(this.formatLanguageCode(e)),n.forEach((function(e){i.indexOf(e)<0&&a(r.formatLanguageCode(e))})),i}}]),e}(),On=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Mn={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},In=["v1","v2","v3"],Ln={zero:0,one:1,two:2,few:3,many:4,other:5};function Dn(){var e={};return On.forEach((function(t){t.lngs.forEach((function(r){e[r]={numbers:t.nr,plurals:Mn[t.fc]}}))})),e}var An=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Br(this,e),this.languageUtils=t,this.options=r,this.logger=rn.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Dn()}return zr(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,t);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,r).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((function(e,t){return Ln[e]-Ln[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):n.numbers.map((function(n){return t.getSuffix(e,n,r)})):[]}},{key:"getSuffix",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,r);return n?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(n.select(t)):this.getSuffixRetroCompatible(n,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var r=this,n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var a=function(){return r.options.prepend&&i.toString()?r.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?a():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}},{key:"shouldUseIntlApi",value:function(){return!In.includes(this.options.compatibilityJSON)}}]),e}();function Nn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=rn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return zr(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:mn,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?hn(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?hn(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?hn(t.nestingPrefix):t.nestingPrefixEscaped||hn("$t("),this.nestingSuffix=t.nestingSuffix?hn(t.nestingSuffix):t.nestingSuffixEscaped||hn(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(e,t,r,n){var i,a,o,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var d=function(e){if(e.indexOf(s.formatSeparator)<0){var i=un(t,c,e);return s.alwaysFormat?s.format(i,void 0,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:e})):i}var a=e.split(s.formatSeparator),o=a.shift().trim(),l=a.join(s.formatSeparator).trim();return s.format(un(t,c,o),l,r,Bn(Bn(Bn({},n),t),{},{interpolationkey:o}))};this.resetRegExp();var u=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?l(s.escape(e)):l(e)}}].forEach((function(t){for(o=0;i=t.regex.exec(e);){var r=i[1].trim();if(void 0===(a=d(r)))if("function"==typeof u){var c=u(e,i,n);a="string"==typeof c?c:""}else if(n&&n.hasOwnProperty(r))a="";else{if(p){a=i[0];continue}s.logger.warn("missed to pass in variable ".concat(r," for interpolating ").concat(e)),a=""}else"string"==typeof a||s.useRawValueToEscape||(a=on(a));var l=t.safeValue(a);if(e=e.replace(i[0],l),p?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++o>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var r,n,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Bn({},a);function s(e,t){var r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;var n=e.split(new RegExp("".concat(r,"[ ]*{"))),i="{".concat(n[1]);e=n[0],i=(i=this.interpolate(i,o)).replace(/'/g,'"');try{o=JSON.parse(i),t&&(o=Bn(Bn({},t),o))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(r).concat(i)}return delete o.defaultValue,e}for(o.applyPostProcessor=!1,delete o.defaultValue;r=this.nestingRegexp.exec(e);){var c=[],l=!1;if(-1!==r[0].indexOf(this.formatSeparator)&&!/{.*}/.test(r[1])){var d=r[1].split(this.formatSeparator).map((function(e){return e.trim()}));r[1]=d.shift(),c=d,l=!0}if((n=t(s.call(this,r[1].trim(),o),o))&&r[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=on(n)),n||(this.logger.warn("missed to resolve ".concat(r[1]," for nesting ").concat(e)),n=""),l&&(n=c.reduce((function(e,t){return i.format(e,t,a.lng,Bn(Bn({},a),{},{interpolationkey:r[1].trim()}))}),n.trim())),e=e.replace(r[0],n),this.regexp.lastIndex=0}return e}}]),e}();function zn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vn=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.logger=rn.create("formatter"),this.options=t,this.formats={number:function(e,t,r){return new Intl.NumberFormat(t,r).format(e)},currency:function(e,t,r){return new Intl.NumberFormat(t,Un(Un({},r),{},{style:"currency"})).format(e)},datetime:function(e,t,r){return new Intl.DateTimeFormat(t,Un({},r)).format(e)},relativetime:function(e,t,r){return new Intl.RelativeTimeFormat(t,Un({},r)).format(e,r.range||"day")},list:function(e,t,r){return new Intl.ListFormat(t,Un({},r)).format(e)}},this.init(t)}return zr(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},r=t.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"format",value:function(e,t,r,n){var i=this;return t.split(this.formatSeparator).reduce((function(e,t){var a=function(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var n=e.split("(");t=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=Jr(e.split(":")),n=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");r[n.trim()]||(r[n.trim()]=i),"false"===i&&(r[n.trim()]=!1),"true"===i&&(r[n.trim()]=!0),isNaN(i)||(r[n.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:r}}(t),o=a.formatName,s=a.formatOptions;if(i.formats[o]){var c=e;try{var l=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},d=l.locale||l.lng||n.locale||n.lng||r;c=i.formats[o](e,d,Un(Un(Un({},s),n),l))}catch(e){i.logger.warn(e)}return c}return i.logger.warn("there was no format function for ".concat(o)),e}),e)}}]),e}();function Hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $n(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Wn(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}var qn=function(e){Hr(r,e);var t=Wn(r);function r(e,n,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Br(this,r),a=t.call(this),gn&&nn.call(Ur(a)),a.backend=e,a.store=n,a.services=i,a.languageUtils=i.languageUtils,a.options=o,a.logger=rn.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=o.maxParallelReads||10,a.readingCalls=0,a.maxRetries=o.maxRetries>=0?o.maxRetries:5,a.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(i,o.backend,o),a}return zr(r,[{key:"queueLoad",value:function(e,t,r,n){var i=this,a={},o={},s={},c={};return e.forEach((function(e){var n=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!r.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?void 0===o[s]&&(o[s]=!0):(i.state[s]=1,n=!1,void 0===o[s]&&(o[s]=!0),void 0===a[s]&&(a[s]=!0),void 0===c[t]&&(c[t]=!0)))})),n||(s[e]=!0)})),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,r){var n=e.split("|"),i=n[0],a=n[1];t&&this.emit("failedLoading",i,a,t),r&&this.store.addResourceBundle(i,a,r),this.state[e]=t?-1:2;var o={};this.queue.forEach((function(r){var n,s,c,l,d,u;n=r.loaded,s=a,l=cn(n,[i],Object),d=l.obj,u=l.k,d[u]=d[u]||[],c&&(d[u]=d[u].concat(s)),c||d[u].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach((function(e){o[e]||(o[e]={});var t=r.loaded[e];t.length&&t.forEach((function(t){void 0===o[e][t]&&(o[e][t]=!0)}))})),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:i,wait:a,callback:o}):(this.readingCalls++,this.backend[r](e,t,(function(s,c){if(n.readingCalls--,n.waitingReads.length>0){var l=n.waitingReads.shift();n.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}s&&c&&i<n.maxRetries?setTimeout((function(){n.read.call(n,e,t,r,i+1,2*a,o)}),a):o(s,c)}))):o(null,{})}},{key:"prepareLoading",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var a=this.queueLoad(e,t,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach((function(e){r.loadOne(e)}))}},{key:"load",value:function(e,t,r){this.prepareLoading(e,t,{},r)}},{key:"reload",value:function(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}},{key:"loadOne",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),i=n[0],a=n[1];this.read(i,a,"read",void 0,void 0,(function(n,o){n&&t.logger.warn("".concat(r,"loading namespace ").concat(a," for language ").concat(i," failed"),n),!n&&o&&t.logger.log("".concat(r,"loaded namespace ").concat(a," for language ").concat(i),o),t.loaded(e,n,o)}))}},{key:"saveMissing",value:function(e,t,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(r,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=r&&""!==r&&(this.backend&&this.backend.create&&this.backend.create(e,t,r,n,null,$n($n({},a),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,r,n))}}]),r}(nn);function Gn(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Nr(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Nr(e[2])||"object"===Nr(e[3])){var r=e[3]||e[2];Object.keys(r).forEach((function(e){t[e]=r[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,r,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Zn(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(r),!0).forEach((function(t){qr(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Qn(e){var t=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}}();return function(){var r,n=Wr(e);if(t){var i=Wr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $r(this,r)}}function Jn(){}function Xn(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ei=function(e){Hr(r,e);var t=Qn(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Br(this,r),e=t.call(this),gn&&nn.call(Ur(e)),e.options=Zn(n),e.services={},e.logger=rn,e.modules={external:[]},Xn(Ur(e)),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),$r(e,Ur(e));setTimeout((function(){e.init(n,i)}),0)}return e}return zr(r,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(r=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var n=Gn();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=Yn(Yn(Yn({},n),this.options),Zn(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Yn(Yn({},n.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var a;this.modules.logger?rn.init(i(this.modules.logger),this.options):rn.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=Vn);var o=new jn(this.options);this.store=new _n(this.options.resources,this.options);var s=this.services;s.logger=rn,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new An(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!a||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(s.formatter=i(a),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new Fn(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new qn(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Pn(this.services,this.options),this.translator.on("*",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,r||(r=Jn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments)}}));var d=["addResource","addResources","addResourceBundle","removeResourceBundle"];d.forEach((function(t){e[t]=function(){var r;return(r=e.store)[t].apply(r,arguments),e}}));var u=an(),p=function(){var t=function(t,n){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(n),r(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),u}},{key:"loadResources",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jn,n=r,i="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return n();var a=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};if(i)o(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return o(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(a,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,r){var n=an();return e||(e=this.languages),t||(t=this.options.ns),r||(r=Jn),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),r(e)})),n}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Sn.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}},{key:"changeLanguage",value:function(e,t){var r=this;this.isLanguageChangingTo=e;var n=an();this.emit("languageChanging",e);var i=function(e){r.language=e,r.languages=r.services.languageUtils.toResolveHierarchy(e),r.resolvedLanguage=void 0,r.setResolvedLanguage(e)},a=function(a){e||a||!r.services.languageDetector||(a=[]);var o="string"==typeof a?a:r.services.languageUtils.getBestMatchFromCodes(a);o&&(r.language||i(o),r.translator.language||r.translator.changeLanguage(o),r.services.languageDetector&&r.services.languageDetector.cacheUserLanguage(o)),r.loadResources(o,(function(e){!function(e,a){a?(i(a),r.translator.changeLanguage(a),r.isLanguageChangingTo=void 0,r.emit("languageChanged",a),r.logger.log("languageChanged",a)):r.isLanguageChangingTo=void 0,n.resolve((function(){return r.t.apply(r,arguments)})),t&&t(e,(function(){return r.t.apply(r,arguments)}))}(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,r){var n=this,i=function e(t,i){var a;if("object"!==Nr(i)){for(var o=arguments.length,s=new Array(o>2?o-2:0),c=2;c<o;c++)s[c-2]=arguments[c];a=n.options.overloadTranslationOptionHandler([t,i].concat(s))}else a=Yn({},i);a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns,a.keyPrefix=a.keyPrefix||r||e.keyPrefix;var l=n.options.keySeparator||".",d=a.keyPrefix?"".concat(a.keyPrefix).concat(l).concat(t):t;return n.t(d,a)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=r,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};if(r.precheck){var s=r.precheck(this,o);if(void 0!==s)return s}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,e)))}},{key:"loadNamespaces",value:function(e,t){var r=this,n=an();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){r.options.ns.indexOf(e)<0&&r.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var r=an();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],i=e.filter((function(e){return n.indexOf(e)<0}));return i.length?(this.options.preload=n.concat(i),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jn,i=Yn(Yn(Yn({},this.options),t),{isClone:!0}),a=new r(i),o=["store","services","language"];return o.forEach((function(t){a[t]=e[t]})),a.services=Yn({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new Pn(a.services,a.options),a.translator.on("*",(function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];a.emit.apply(a,[e].concat(r))})),a.init(i,n),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(nn);qr(ei,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ei(e,t)}));var ti=ei.createInstance();ti.createInstance=ei.createInstance;ti.createInstance,ti.init,ti.loadResources,ti.reloadResources,ti.use,ti.changeLanguage,ti.getFixedT,ti.t,ti.exists,ti.setDefaultNamespace,ti.hasLoadedNamespace,ti.loadNamespaces,ti.loadLanguages;var ri=ti,ni={},ii={};(ii=function(e){if(Array.isArray(e))return e}).__esModule=!0,ii.default=ii;var ai={};(ai=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}).__esModule=!0,ai.default=ai;var oi={},si={};(si=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}).__esModule=!0,si.default=si,(oi=function(e,t){if(e){if("string"==typeof e)return si(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?si(e,t):void 0}}).__esModule=!0,oi.default=oi;var ci={};(ci=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,ci.default=ci,(ni=function(e,t){return ii(e)||ai(e,t)||oi(e,t)||ci()}).__esModule=!0,ni.default=ni;var li={};(li=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}).__esModule=!0,li.default=li;Ie=a("85Hg2");var di={};(di=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}).__esModule=!0,di.default=di;var ui={};function pi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(ui=function(e,t,r){return t&&pi(e.prototype,t),r&&pi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}).__esModule=!0,ui.default=ui;Ie=a("85Hg2");var hi=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,fi={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},mi=function(e){return fi[e]};function gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(n),!0).forEach((function(t){r(li)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yi,bi={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(hi,mi)}},wi=(0,Ie.createContext)();function xi(){return bi}var _i=function(){function e(){r(di)(this,e),this.usedNamespaces={}}return r(ui)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Si(){return yi}var ki={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};bi=vi(vi({},bi),e)}(e.options.react),function(e){yi=e}(e)}};function Ci(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];"string"==typeof r[0]&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var Ei={};function Ri(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];"string"==typeof t[0]&&Ei[t[0]]||("string"==typeof t[0]&&(Ei[t[0]]=new Date),Ci.apply(void 0,t))}function Pi(e,t,r){e.loadNamespaces(t,(function(){if(e.isInitialized)r();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),r()}))}}))}function Ti(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.languages[0],i=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===n.toLowerCase())return!0;var o=function(e,r){var n=t.services.backendConnector.state["".concat(e,"|").concat(r)];return-1===n||2===n};return!(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(n,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!o(n,e)||i&&!o(a,e))))}function ji(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return Ri("i18n.languages were undefined or empty",t.languages),!0;var n=void 0!==t.options.ignoreJSONStructure;return n?t.hasLoadedNamespace(e,{precheck:function(t,n){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):Ti(e,t,r)}function Oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oi(Object(n),!0).forEach((function(t){r(li)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ii=function(e,t){var r=(0,Ie.useRef)();return(0,Ie.useEffect)((function(){r.current=t?r.current:e}),[e,t]),r.current};function Li(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,i=(0,Ie.useContext)(wi)||{},a=i.i18n,o=i.defaultNS,s=n||a||Si();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new _i),!s){Ri("You will need to pass in an i18next instance by using initReactI18next");var c=function(e){return Array.isArray(e)?e[e.length-1]:e},l=[c,{},!1];return l.t=c,l.i18n={},l.ready=!1,l}s.options.react&&void 0!==s.options.react.wait&&Ri("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=Mi(Mi(Mi({},xi()),s.options.react),t),u=d.useSuspense,p=d.keyPrefix,h=e||o||s.options&&s.options.defaultNS;h="string"==typeof h?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var f=(s.isInitialized||s.initializedStoreOnce)&&h.every((function(e){return ji(e,s,d)}));function m(){return s.getFixedT(null,"fallback"===d.nsMode?h:h[0],p)}var g=(0,Ie.useState)(m),v=r(ni)(g,2),y=v[0],b=v[1],w=h.join(),x=Ii(w),_=(0,Ie.useRef)(!0);(0,Ie.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function r(){_.current&&b(m)}return _.current=!0,f||u||Pi(s,h,(function(){_.current&&b(m)})),f&&x&&x!==w&&_.current&&b(m),e&&s&&s.on(e,r),t&&s&&s.store.on(t,r),function(){_.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,r)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,r)}))}}),[s,w]);var S=(0,Ie.useRef)(!0);(0,Ie.useEffect)((function(){_.current&&!S.current&&b(m),S.current=!1}),[s,p]);var k=[y,s,f];if(k.t=y,k.i18n=s,k.ready=f,f)return k;if(!f&&!u)return k;throw new Promise((function(e){Pi(s,h,(function(){e()}))}))}const Di=()=>{try{const e=localStorage.getItem("stream_ui_language");return e||"en"}catch(e){return console.warn(e),"en"}},Ai={en:{name:"English",translation:{notifications:{screensharingError:"An error occured when trying to toggle screensharing",microphoneError:"An error occured when trying to toggle the microphone",cameraError:"An error occured when trying to toggle the camera",cameraRotateError:"An error occured when trying to rotate the camera",noCamera:"No camera available",blockedMicrophonePopupTitle:"Camera and microphone are blocked",blockedMicrophonePopup:"SnapCall requires access to your camera and microphone. Click the camera blocked icon in your browser's address bar.",reload:"Reload",criticalError:"A critical error has occurred (error {{code}}).",agentJoinError:"An error occured while trying to join the room as an agent",close:"Close",connectedTo:"Connected to {{name}}"},endView:{goBack:"Go back to call",tooLate:"You arrived too late",callIsOver:"The call is over or deleted",callEnded:"The call is now ended",callLeft:"You left the call",full:"You can't join this call",fullDescription:"The room is full. Please try to join the call later."},menu:{title:"Menu",new:"NEW",openNewTab:"Open new tab",quickConnect:"Quick Connect",pictureInPicture:"Picture-in-Picture",screenSharing:"Screen sharing"},copyLink:{title:"Copy link",description:"Copy link into clipboard",error:"An error occured when trying to copy to clipboard",copied:"Link copied to clipboard"},quickConnect:{title:"Quick Connect",scanTitle:"Scan QR Code",scan:"Scan this QR code with your phone camera to open the call."},settings:{title:"Settings",preferences:"Preferences",language:"Language",devices:"Devices",help:"Help",helpCenter:"Go to help center"},audioMenu:{title:"Audio",blockedMicrophone:"Microphone is blocked.",microphonePermissions:"Please accept microphone sharing before accessing these options."},videoMenu:{title:"Video",lowDef:"Low definition (240p)",standardDef:"Standard definition (480p)",highDef:"High definition (720p)",blockedCamera:"Camera is blocked.",cameraPermissions:"Please accept camera sharing before accessing these options.",sendResolution:"Send Resolution (maximum)"},shareLink:{title:"Share link",title2:"Share a link",invalid:"Invalid link",sentToUsers:"Link sent to users",sentToUser:"Link sent to {{user}}",failed:"Failed to send link",poweredBy:"Powered by",invoice:"{{user}} sent you an invoice.",pay:"Pay"},youtube:{title:"Watch Together",url:"YOUTUBE URL",invalid:"Invalid YouTube URL",share:"Watch now"},sharedHistory:{shared:"Shared with you"},snapshot:{title:"Snapshot",shared:"Snapshot shared.",sentToUsers:"Snapshot sent to users.",sentToUser:"Snapshot sent to {{user}}",save:"Save photo",error:"An error occured when trying to send the snapshot"},gdpr:{recordedWarning:"To improve the quality of our service, this call will be recorded."},requestDevice:{requestInput:"Request input devices",request:"{{user}} would like you to share your {{device}}",timedOut:"Your request has timed out.",declined:"Your request has been declined.",userDeclined:"{{user}} has declined your request."},leave:{title:"Leave",leaveCall:"Leave call",endCall:"End call for all"},virtualBackground:{title:"Virtual Background",setBackground:"Set Background"},misc:{someone:"Someone",camera:"Camera",microphone:"Microphone",screen:"Screen",speaker:"Speaker",user:"User",open:"Open",from:"From",accept:"Accept",decline:"Decline",you:"You"},invite:{title:"Share link to start a conversation",copy:"Copy",description:"You are currently the only participant. Invite people to start the conversation."},greeting:{mainTitle:"Welcome to SnapCall",sideTitle:"Are you ready to join?",sideDescription:"Before joining the room, enter your name. It will displayed to participants.",namePlaceholder:"Your name",nameSubmit:"Join Conversation",footerTitle:"Powered by SnapCall",footerDescription:"Meet SnapCall, the easiest way to add real-time video to platform, product or service."}}},fr:{name:"Français",translation:{notifications:{screensharingError:"Une erreur est survenue pendant l'activation du partage d'écran",microphoneError:"Une erreur est survenue pendant l'activation du micro",cameraError:"Une erreur est survenue pendant l'activation de la caméra",cameraRotateError:"Une erreur est survenue pendant la rotation de la caméra",noCamera:"Aucune caméra disponible",blockedMicrophonePopupTitle:"Votre caméra et micro sont bloqués",blockedMicrophonePopup:"SnapCall a besoin d'accéder à votre caméra et micro. Cliquez sur l'icône de caméra bloquée dans la barre d'adresse du navigateur.",reload:"Recharger",criticalError:"Une erreur critique est survenue (erreur {{code}}).",agentJoinError:"Une erreur est survenue en essayant de rejoindre la salle en tant qu'agent",close:"Fermer",connectedTo:"Connecté à {{name}}"},endView:{goBack:"Retourner dans l'appel",tooLate:"Vous êtes arrivez trop tard",callIsOver:"Cet appel est terminé ou supprimé",callEnded:"Cet appel est terminé",callLeft:"Vous avez quitté l'appel",full:"Impossible de rejoindre l'appel",fullDescription:"Limite d'utilisateurs atteinte. Merci de rejoindre l'appel ultérieurement."},menu:{title:"Menu",new:"NOUVEAU",openNewTab:"Ouvrir un nouvel onglet",quickConnect:"Quick Connect",pictureInPicture:"Picture-in-Picture",screenSharing:"Partage d'écran"},copyLink:{title:"Copier le lien",description:"Copier le lien dans le presse-papiers",error:"Une erreur est survenue pendant la copie du lien dans le presse-papier",copied:"Lien copié dans le presse-papier"},quickConnect:{title:"Quick Connect",scanTitle:"Scannez le QR Code",scan:"Scannez ce QR code avec votre téléphone pour ouvrir l'appel."},settings:{title:"Paramètres",preferences:"Préférences",language:"Langage",devices:"Appareils",help:"Aide",helpCenter:"Accéder au centre d'aide"},audioMenu:{title:"Audio",blockedMicrophone:"Votre micro est bloqué.",microphonePermissions:"Please accept microphone sharing before accessing these options."},videoMenu:{title:"Video",lowDef:"Basse définition (240p)",standardDef:"Définition standard (480p)",highDef:"Haute définition (720p)",blockedCamera:"Votre caméra est bloqué.",cameraPermissions:"Please accept camera sharing before accessing these options.",sendResolution:"Résolution envoyée (max)"},shareLink:{title:"Partager un lien",title2:"Partager un lien",invalid:"Lien invalide",sentToUsers:"Lien envoyé aux participants",sentToUser:"Lien envoyé à {{user}}",failed:"Une erreur est survenue pendant l'envoi du lien",poweredBy:"Proposé par",invoice:"{{user}} vous a envoyé une facture.",pay:"Payer"},youtube:{title:"Regardons Ensemble",url:"URL YOUTUBE",invalid:"URL YouTube invalide",share:"Regarder maintenant"},sharedHistory:{shared:"Partagé avec vous"},snapshot:{title:"Snapshot",shared:"Snapshot envoyé.",sentToUsers:"Snapshot envoyé aux participants.",sentToUser:"Snapshot envoyé à {{user}}",save:"Sauvegarder l'image",error:"Une erreur est survenue pendant l'envoi du snapshot"},gdpr:{recordedWarning:"Pour améliorer la qualité de notre service, cet appel va être enregistré."},requestDevice:{requestInput:"Demander l'activation",request:"{{user}} voudrait que vous partagiez votre {{device}}",timedOut:"Votre requête n'a pas eu de réponse",declined:"Votre requête a été refusé.",userDeclined:"{{user}} a décliné votre requête."},leave:{title:"Quitter",leaveCall:"Quitter l'appel",endCall:"Terminer l'appel"},virtualBackground:{title:"Arrière plan virtuel",setBackground:"Mettre l'arrière plan"},misc:{someone:"Quelqu'un",camera:"Caméra",microphone:"Micro",screen:"Écran",speaker:"Haut-parleur",user:"Utilisateur",open:"Ouvrir",from:"Depuis",accept:"Accepter",decline:"Décliner",you:"Vous"},invite:{title:"Partagez le lien pour commencer une conversation",copy:"Copier",description:"Vous êtes actuellement le seul participant. Inviter des personnes pour commencer la conversation."},greeting:{mainTitle:"Bienvenue sur SnapCall",sideTitle:"Prêt à rejoindre ?",sideDescription:"Avant de rejoindre la salle, veuillez entrer votre nom.",namePlaceholder:"Nom",nameSubmit:"Rejoindre la conversation",footerTitle:"Propulsé par SnapCall",footerDescription:"Découvrez SnapCall, ajoutez de la vidéo en temps réel à n'importe quelle plateforme, produit ou service."}}},it:{name:"Italiano",translation:{notifications:{screensharingError:"Si è verificato un errore durante l'attivazione della condivisione dello schermo",microphoneError:"Si è verificato un errore durante l'attivazione del microfono",cameraError:"Si è verificato un errore durante l'attivazione della fotocamera",cameraRotateError:"Si è verificato un errore durante la rotazione della fotocamera",noCamera:"Nessuna fotocamera disponibile",blockedMicrophonePopupTitle:"La tua fotocamera e il tuo microfono sono bloccati",blockedMicrophonePopup:"SnapCall ha bisogno di accedere alla fotocamera e al microfono. Fare clic sull'icona della fotocamera bloccata nella barra degli indirizzi del browser.",reload:"Ricaricare",criticalError:"Si è verificato un errore critico (errore {{code}}).",agentJoinError:"Si è verificato un errore cercando di entrare nella conversazione come agente",close:"Chiudere",connectedTo:"Connesso a {{name}}"},endView:{goBack:"Torna alla chiamata",tooLate:"Sei arrivato troppo tardi",callIsOver:"Questa chiamata è finita o è stata eliminata",callEnded:"Questa chiamata è finita",callLeft:"Hai lasciato la chiamata",full:"Impossibile partecipare alla chiamata",fullDescription:"Limite d'uso attenente."},menu:{title:"Menù",new:"NUOVO",openNewTab:"Apri una nuova scheda",quickConnect:"Connessione Rapida",pictureInPicture:"Immagine nell'immagine",screenSharing:"Condivisione dello schermo"},copyLink:{title:"Copia il link",description:"Copia il link negli appunti",error:"Si è verificato un errore durante la copia negli Appunti",copied:"Link copiato negli Appunti"},quickConnect:{title:"Connessione Rapida",scanTitle:"Scansiona il codice QR",scan:"Scansiona questo codice QR con il telefono per aprire la chiamata."},settings:{title:"Impostazioni",preferences:"Preferenze",language:"Linguaggio",devices:"Dispositivi",help:"Aiuto",helpCenter:"Accedi all'Assistenza"},audioMenu:{title:"Audio",blockedMicrophone:"Il tuo microfono è bloccato.",microphonePermissions:"Si prega di accettare la condivisione del microfono prima di accedere a queste opzioni."},videoMenu:{title:"Video",lowDef:"Definizione bassa (240p)",standardDef:"Definizione standard (480p)",highDef:"Alta definizione (720p)",blockedCamera:"La fotocamera è bloccata.",cameraPermissions:"Si prega di accettare la condivisione della fotocamera prima di accedere a queste opzioni.",sendResolution:"Risoluzione inviata (max)"},shareLink:{title:"Condividi un link",title2:"Condividi un link",invalid:"Collegamento non valido",sentToUsers:"Link inviato ai partecipanti",sentToUser:"Link inviato a {{user}}",failed:"Si è verificato un errore durante l'invio del link",poweredBy:"Proposto da",invoice:"{{User}} ti ha inviato una fattura.",pay:"Paga"},youtube:{title:"Vedere Assieme",url:"URL YOUTUBE",invalid:"URL YouTube non valido",share:"Guarda ora"},sharedHistory:{shared:"Condiviso con te"},snapshot:{title:"Schermata",shared:"Schermata inviata",sentToUsers:"Schermanta inviata ai partecipanti",sentToUser:"Schermata inviata a {{user}}",save:"Salva l'immagine",error:"Si è verificato un errore durante l'invio della schermata"},gdpr:{recordedWarning:"Per migliorare la qualità del nostro servizio, questa chiamata verrà registrata."},requestDevice:{requestInput:"Richiesta di attivazione",request:"{{user}} vorrebbe condividere il tuo {{device}}",timedOut:"La tua richiesta non ha ricevuto risposta",declined:"La tua richiesta è stata rifiutata.",userDeclined:"{{user}} ha rifiutato la tua richiesta"},leave:{title:"Lasciare",leaveCall:"Lascia la chiamata",endCall:"Termina la chiamata per tutti"},virtualBackground:{title:"Sfondo virtuale",setBackground:"Imposta sfondo"},virtualbackground:{title:"Virtual Background",setBackground:"Set Background"},misc:{someone:"Qualcuno",camera:"Telecamera",microphone:"Microfono",screen:"Schermo",speaker:"Altoparlante",user:"Utente",open:"Aprire",from:"Da",accept:"Accettare",decline:"Declinare",you:"Voi"},invite:{title:"Condividi link per avviare una conversazione",copy:"Copiare",description:"Attualmente sei l'unico partecipante. Invita le persone ad iniziare la conversazione."},greeting:{mainTitle:"Benvenuto a SnapCall",sideTitle:"Sei pronto per unirti?",sideDescription:"Prima di entrare nella stanza, inserisci il tuo nome. Verrà visualizzato ai partecipanti.",namePlaceholder:"Il tuo nome",nameSubmit:"Partecipa alla conversazione",footerTitle:"Offerto da SnapCall",footerDescription:"Incontrare SnapCall, il modo più semplice per aggiungere video in tempo reale a piattaforma, prodotto o servizio."}}}};ri.use(ki).init({lng:Di(),fallbackLng:"en",resources:Ai,interpolation:{escapeValue:!1}});var Ni,Bi=ri,Fi=(Ie=a("85Hg2"),a("4Fy4N")),zi=new Uint8Array(16);function Ui(){if(!Ni&&!(Ni="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 Ni(zi)}var Vi=/^(?:[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;for(var Hi=function(e){return"string"==typeof e&&Vi.test(e)},$i=[],Wi=0;Wi<256;++Wi)$i.push((Wi+256).toString(16).substr(1));var qi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=($i[e[t+0]]+$i[e[t+1]]+$i[e[t+2]]+$i[e[t+3]]+"-"+$i[e[t+4]]+$i[e[t+5]]+"-"+$i[e[t+6]]+$i[e[t+7]]+"-"+$i[e[t+8]]+$i[e[t+9]]+"-"+$i[e[t+10]]+$i[e[t+11]]+$i[e[t+12]]+$i[e[t+13]]+$i[e[t+14]]+$i[e[t+15]]).toLowerCase();if(!Hi(r))throw TypeError("Stringified UUID is invalid");return r};var Gi,Zi,Ki,Yi=function(e,t,r){var n=(e=e||{}).random||(e.rng||Ui)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return qi(n)},Qi=JSON.parse('{"name":"protoo-client","version":"4.0.6","description":"protoo JavaScript client module","author":"Iñaki Baz Castillo <ibc@aliax.net>","homepage":"https://protoo.versatica.com","license":"MIT","repository":{"type":"git","url":"https://github.com/ibc/protoo.git"},"main":"lib/index.js","keywords":["nodejs","browser","websocket"],"engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint -c .eslintrc.js lib"},"dependencies":{"debug":"^4.3.1","events":"^3.2.0","retry":"^0.12.0"},"devDependencies":{"eslint":"^5.16.0"},"optionalDependencies":{"websocket":"^1.0.33"}}').version,Ji={},Xi=a("hZG0u");const ea="protoo-client";Ji=class{constructor(e){e?(this._debug=Xi(`protoo-client:${e}`),this._warn=Xi(`protoo-client:WARN:${e}`),this._error=Xi(`protoo-client:ERROR:${e}`)):(this._debug=Xi(ea),this._warn=Xi("protoo-client:WARN"),this._error=Xi("protoo-client:ERROR")),this._debug.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}get debug(){return this._debug}get warn(){return this._warn}get error(){return this._error}};var ta,ra=a("3oV8N").EventEmitter;ta=class extends ra{constructor(e){super(),this.setMaxListeners(1/0),this._logger=e||new Ji("EnhancedEventEmitter")}safeEmit(e,...t){try{this.emit(e,...t)}catch(t){this._logger.error("safeEmit() | event listener threw an error [event:%s]:%o",e,t)}}async safeEmitAsPromise(e,...t){return new Promise(((r,n)=>{this.safeEmit(e,...t,r,n)}))}};var na={},ia=function(){return Math.round(1e7*Math.random())};const aa=new Ji("Message");na=class{static parse(e){let t;const r={};try{t=JSON.parse(e)}catch(e){return void aa.error("parse() | invalid JSON: %s",e)}if("object"==typeof t&&!Array.isArray(t)){if(t.request){if(r.request=!0,"string"!=typeof t.method)return void aa.error("parse() | missing/invalid method field");if("number"!=typeof t.id)return void aa.error("parse() | missing/invalid id field");r.id=t.id,r.method=t.method,r.data=t.data||{}}else if(t.response){if(r.response=!0,"number"!=typeof t.id)return void aa.error("parse() | missing/invalid id field");r.id=t.id,t.ok?(r.ok=!0,r.data=t.data||{}):(r.ok=!1,r.errorCode=t.errorCode,r.errorReason=t.errorReason)}else{if(!t.notification)return void aa.error("parse() | missing request/response field");if(r.notification=!0,"string"!=typeof t.method)return void aa.error("parse() | missing/invalid method field");r.method=t.method,r.data=t.data||{}}return r}aa.error("parse() | not an object")}static createRequest(e,t){return{request:!0,id:ia(),method:e,data:t||{}}}static createSuccessResponse(e,t){return{response:!0,id:e.id,ok:!0,data:t||{}}}static createErrorResponse(e,t,r){return{response:!0,id:e.id,ok:!1,errorCode:t,errorReason:r}}static createNotification(e,t){return{notification:!0,method:e,data:t||{}}}};const oa=new Ji("Peer");Ki=class extends ta{constructor(e){super(oa),oa.debug("constructor()"),this._closed=!1,this._transport=e,this._connected=!1,this._data={},this._sents=new Map,this._handleTransport()}get closed(){return this._closed}get connected(){return this._connected}get data(){return this._data}set data(e){throw new Error("cannot override data object")}close(){if(!this._closed){oa.debug("close()"),this._closed=!0,this._connected=!1,this._transport.close();for(const e of this._sents.values())e.close();this.safeEmit("close")}}async request(e,t){const r=na.createRequest(e,t);return this._logger.debug("request() [method:%s, id:%s]",e,r.id),await this._transport.send(r),new Promise(((e,t)=>{const n=1500*(15+.1*this._sents.size),i={id:r.id,method:r.method,resolve:t=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),e(t))},reject:e=>{this._sents.delete(r.id)&&(clearTimeout(i.timer),t(e))},timer:setTimeout((()=>{this._sents.delete(r.id)&&t(new Error("request timeout"))}),n),close:()=>{clearTimeout(i.timer),t(new Error("peer closed"))}};this._sents.set(r.id,i)}))}async notify(e,t){const r=na.createNotification(e,t);this._logger.debug("notify() [method:%s]",e),await this._transport.send(r)}_handleTransport(){if(this._transport.closed)return this._closed=!0,void setTimeout((()=>{this._closed||(this._connected=!1,this.safeEmit("close"))}));this._transport.on("open",(()=>{this._closed||(oa.debug('emit "open"'),this._connected=!0,this.safeEmit("open"))})),this._transport.on("disconnected",(()=>{this._closed||(oa.debug('emit "disconnected"'),this._connected=!1,this.safeEmit("disconnected"))})),this._transport.on("failed",(e=>{this._closed||(oa.debug('emit "failed" [currentAttempt:%s]',e),this._connected=!1,this.safeEmit("failed",e))})),this._transport.on("close",(()=>{this._closed||(this._closed=!0,oa.debug('emit "close"'),this._connected=!1,this.safeEmit("close"))})),this._transport.on("message",(e=>{e.request?this._handleRequest(e):e.response?this._handleResponse(e):e.notification&&this._handleNotification(e)}))}_handleRequest(e){try{this.emit("request",e,(t=>{const r=na.createSuccessResponse(e,t);this._transport.send(r).catch((()=>{}))}),((t,r)=>{t instanceof Error?(r=t.message,t=500):"number"==typeof t&&r instanceof Error&&(r=r.message);const n=na.createErrorResponse(e,t,r);this._transport.send(n).catch((()=>{}))}))}catch(t){const r=na.createErrorResponse(e,500,String(t));this._transport.send(r).catch((()=>{}))}}_handleResponse(e){const t=this._sents.get(e.id);if(t)if(e.ok)t.resolve(e.data);else{const r=new Error(e.errorReason);r.code=e.errorCode,t.reject(r)}else oa.error("received response does not match any sent request [id:%s]",e.id)}_handleNotification(e){this.safeEmit("notification",e)}};var sa;if("object"==typeof globalThis)sa=globalThis;else try{sa=a("jCEG4")}catch(e){}finally{if(sa||"undefined"==typeof window||(sa=window),!sa)throw new Error("Could not determine global this")}var ca,la=sa.WebSocket||sa.MozWebSocket;function da(e,t){return t?new la(e,t):new la(e)}ca=a("kUMHr").version,la&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(da,e,{get:function(){return la[e]}})}));var ua={w3cwebsocket:la?da:null,version:ca}.w3cwebsocket,pa={};pa=a("jxXWz");const ha={retries:10,factor:2,minTimeout:1e3,maxTimeout:8e3},fa=new Ji("WebSocketTransport");Gi=Ki,Zi=class extends ta{constructor(e,t){super(fa),fa.debug("constructor() [url:%s, options:%o]",e,t),this._closed=!1,this._url=e,this._options=t||{},this._ws=null,this._runWebSocket()}get closed(){return this._closed}close(){if(!this._closed){fa.debug("close()"),this._closed=!0,this.safeEmit("close");try{this._ws.onopen=null,this._ws.onclose=null,this._ws.onerror=null,this._ws.onmessage=null,this._ws.close()}catch(e){fa.error("close() | error closing the WebSocket: %o",e)}}}async send(e){if(this._closed)throw new Error("transport closed");try{this._ws.send(JSON.stringify(e))}catch(e){throw fa.warn("send() failed:%o",e),e}}_runWebSocket(){const e=pa.operation(this._options.retry||ha);let t=!1;e.attempt((r=>{this._closed?e.stop():(fa.debug("_runWebSocket() [currentAttempt:%s]",r),this._ws=new ua(this._url,"protoo",this._options.origin,this._options.headers,this._options.requestOptions,this._options.clientConfig),this._ws.onopen=()=>{this._closed||(t=!0,this.safeEmit("open"))},this._ws.onclose=n=>{if(!this._closed){if(fa.warn('WebSocket "close" event [wasClean:%s, code:%s, reason:"%s"]',n.wasClean,n.code,n.reason),4e3!==n.code){if(t){if(e.stop(),this.safeEmit("disconnected"),this._closed)return;return void this._runWebSocket()}if(this.safeEmit("failed",r),this._closed)return;if(e.retry(!0))return}this._closed=!0,this.safeEmit("close")}},this._ws.onerror=()=>{this._closed||fa.error('WebSocket "error" event')},this._ws.onmessage=e=>{if(this._closed)return;const t=na.parse(e.data);t&&(0!==this.listenerCount("message")?this.safeEmit("message",t):fa.error('no listeners for WebSocket "message" event, ignoring received message'))})}))}};var ma={};e(ma,"FunctionToString",(()=>Aa)),e(ma,"InboundFilters",(()=>Ba));var ga=Object.prototype.toString;function va(e,t){return ga.call(e)===`[object ${t}]`}function ya(e){return va(e,"String")}function ba(e){return va(e,"Object")}function wa(e){return Boolean(e&&e.then&&"function"==typeof e.then)}var xa=(0,(Ea=a("bWPEY")).getGlobalObject)(),_a=["debug","info","warn","error","log","assert","trace"];function Sa(e){var t=(0,Ea.getGlobalObject)();if(!("console"in t))return e();var r=t.console,n={};_a.forEach((e=>{var i=r[e]&&r[e].__sentry_original__;e in t.console&&i&&(n[e]=r[e],r[e]=i)}));try{return e()}finally{Object.keys(n).forEach((e=>{r[e]=n[e]}))}}function ka(){let e=!1;var t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?_a.forEach((r=>{t[r]=(...t)=>{e&&Sa((()=>{xa.console[r](`Sentry Logger [${r}]:`,...t)}))}})):_a.forEach((e=>{t[e]=()=>{}})),t}let Ca;Ca="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?(0,Ea.getGlobalSingleton)("logger",ka):ka();var Ea=a("bWPEY");Ea=a("bWPEY");function Ra(e,t){return!!ya(e)&&(va(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Pa(e){return Ta(e,new Map)}function Ta(e,t){if(ba(e)){if(void 0!==(i=t.get(e)))return i;var r={};for(var n of(t.set(e,r),Object.keys(e)))void 0!==e[n]&&(r[n]=Ta(e[n],t));return r}if(Array.isArray(e)){var i;if(void 0!==(i=t.get(e)))return i;r=[];return t.set(e,r),e.forEach((e=>{r.push(Ta(e,t))})),r}return e}function ja(){var e=(0,Ea.getGlobalObject)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var n=e=>{let t=e.toString(16);for(;t.length<4;)t=`0${t}`;return t};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(e=>{var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function Oa(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Ma(e){const{message:t,event_id:r}=e;if(t)return t;var n=Oa(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}var Ia;!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Ia||(Ia={}));class La{__init(){this._state=Ia.PENDING}__init2(){this._handlers=[]}constructor(e){La.prototype.__init.call(this),La.prototype.__init2.call(this),La.prototype.__init3.call(this),La.prototype.__init4.call(this),La.prototype.__init5.call(this),La.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new La(((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new La(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}__init3(){this._resolve=e=>{this._setResult(Ia.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Ia.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===Ia.PENDING&&(wa(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state!==Ia.PENDING){var e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Ia.RESOLVED&&e[1](this._value),this._state===Ia.REJECTED&&e[2](this._value),e[0]=!0)}))}}}}let Da;class Aa{constructor(){Aa.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=Aa.id}setupOnce(){Da=Function.prototype.toString,Function.prototype.toString=function(...e){var t=this.__sentry_original__||this;return Da.apply(t,e)}}}Aa.__initStatic();var Na=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class Ba{static __initStatic(){this.id="InboundFilters"}__init(){this.name=Ba.id}constructor(e={}){this._options=e,Ba.prototype.__init.call(this)}setupOnce(e,t){var r=e=>{var r=t();if(r){var n=r.getIntegration(Ba);if(n){var i=r.getClient(),a=i?i.getOptions():{},o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...Na],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(n._options,a);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Ma(e)}`),!0;if(function(e,t){return!(!t||!t.length)&&function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:r=""}=e.exception.values&&e.exception.values[0]||{};return[`${r}`,`${t}: ${r}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.error(`Cannot extract message for event ${Ma(e)}`),[]}return[]}(e).some((e=>t.some((t=>Ra(e,t)))))}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ma(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;var r=Fa(e);return!!r&&t.some((e=>Ra(r,e)))}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ma(e)}.\nUrl: ${Fa(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;var r=Fa(e);return!r||t.some((e=>Ra(r,e)))}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ma(e)}.\nUrl: ${Fa(e)}`),!0;return!1}(e,o)?null:e}}return e};r.id=this.name,e(r)}}function Fa(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let r=e.length-1;r>=0;r--){var t=e[r];if(t&&"<anonymous>"!==t.filename&&"[native code]"!==t.filename)return t.filename||null}return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.error(`Cannot extract url for event ${Ma(e)}`),null}}Ba.__initStatic();var za=a("gTODe"),Ua=(Ea=a("bWPEY"),a("hLvaX"));a("gTODe"),Ea=a("bWPEY"),za=a("gTODe");function Va(e){var t=(0,za.timestampInSeconds)(),r={sid:ja(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Pa({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&Ha(r,e),r}function Ha(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,za.timestampInSeconds)(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ja()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{var r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function $a(e,t){let r={};t?r={status:t}:"ok"===e.status&&(r={status:"exited"}),Ha(e,r)}class Wa{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){var t=new Wa;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Ha(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){var e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if("function"==typeof e){var t=e(this);return t instanceof Wa?t:this}return e instanceof Wa?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):ba(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this}addBreadcrumb(e,t){var r="number"==typeof t?Math.min(t,100):100;if(r<=0)return this;var n={timestamp:(0,za.dateTimestampInSeconds)(),...e};return this._breadcrumbs=[...this._breadcrumbs,n].slice(-r),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};var r=this._span.transaction&&this._span.transaction.name;r&&(e.tags={transaction:r,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...qa(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,r,n=0){return new La(((i,a)=>{var o=e[n];if(null===t||"function"!=typeof o)i(t);else{var s=o({...t},r);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&o.id&&null===s&&Ca.log(`Event processor "${o.id}" dropped event`),wa(s)?s.then((t=>this._notifyEventProcessors(e,t,r,n+1).then(i))).then(null,a):this._notifyEventProcessors(e,s,r,n+1).then(i).then(null,a)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function qa(){return(0,Ea.getGlobalSingleton)("globalEventProcessors",(()=>[]))}var Ga=100;class Za{__init(){this._stack=[{}]}constructor(e,t=new Wa,r=4){this._version=r,Za.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){var e=Wa.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){var r=this._lastEventId=t&&t.event_id?t.event_id:ja(),n=new Error("Sentry syntheticException");return this._withClient(((i,a)=>{i.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},a)})),r}captureMessage(e,t,r){var n=this._lastEventId=r&&r.event_id?r.event_id:ja(),i=new Error(e);return this._withClient(((a,o)=>{a.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},o)})),n}captureEvent(e,t){var r=t&&t.event_id?t.event_id:ja();return"transaction"!==e.type&&(this._lastEventId=r),this._withClient(((n,i)=>{n.captureEvent(e,{...t,event_id:r},i)})),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!r||!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Ga}=n.getOptions&&n.getOptions()||{};if(!(a<=0)){var o={timestamp:(0,za.dateTimestampInSeconds)(),...e},s=i?Sa((()=>i(o,t))):o;null!==s&&r.addBreadcrumb(s,a)}}setUser(e){var t=this.getScope();t&&t.setUser(e)}setTags(e){var t=this.getScope();t&&t.setTags(e)}setExtras(e){var t=this.getScope();t&&t.setExtras(e)}setTag(e,t){var r=this.getScope();r&&r.setTag(e,t)}setExtra(e,t){var r=this.getScope();r&&r.setExtra(e,t)}setContext(e,t){var r=this.getScope();r&&r.setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();t&&r&&e(t)}run(e){var t=Ya(this);try{e(this)}finally{Ya(t)}}getIntegration(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){var e=this.getStackTop(),t=e&&e.scope,r=t&&t.getSession();r&&$a(r),this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i}=r&&r.getOptions()||{};var a=(0,Ea.getGlobalObject)();const{userAgent:o}=a.navigator||{};var s=Va({release:n,environment:i,...t&&{user:t.getUser()},...o&&{userAgent:o},...e});if(t){var c=t.getSession&&t.getSession();c&&"ok"===c.status&&Ha(c,{status:"exited"}),this.endSession(),t.setSession(s)}return s}shouldSendDefaultPii(){var e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(e){var r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}}_withClient(e){const{scope:t,client:r}=this.getStackTop();r&&e(r,t)}_callExtensionMethod(e,...t){var r=Ka().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&Ca.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Ka(){var e=(0,Ea.getGlobalObject)();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ya(e){var t=Ka(),r=Xa(t);return eo(t,e),r}function Qa(){var e=Ka();return Ja(e)&&!Xa(e).isOlderThan(4)||eo(e,new Za),(0,Ua.isNodeEnv)()?function(e){try{var t=Ka().__SENTRY__,r=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!r)return Xa(e);if(!Ja(r)||Xa(r).isOlderThan(4)){var n=Xa(e).getStackTop();eo(r,new Za(n.client,Wa.clone(n.scope)))}return Xa(r)}catch(t){return Xa(e)}}(e):Xa(e)}function Ja(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function Xa(e){return(0,Ea.getGlobalSingleton)("hub",(()=>new Za),e)}function eo(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}function to(e,t){return Qa().captureException(e,{captureContext:t})}function ro(e){Qa().addBreadcrumb(e)}const no=1,io=2,ao=3,oo=4,so=5,co={1:"error",2:"warn",3:"info",4:"verbose",5:"debug"};let lo=Number(2);const uo=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",timeZone:"GMT"});class po{constructor(e,t){this.filename=e,this.customLogLevel=t}print(e,t,r,...n){const i=`[ ${uo.format(new Date)} ][ ${co[e]} ][ ${this.filename} - ${r} ]`;e<=(this.customLogLevel||lo)?t(i,...n):ro({type:"debug",level:co[e],category:"console",data:{head:i,arguments:n}})}debug(e,...t){this.print(so,console.debug,e,...t)}error(e,...t){this.print(no,console.error,e,...t)}info(e,...t){this.print(ao,console.info,e,...t)}log(e,...t){this.print(oo,console.log,e,...t)}warn(e,...t){this.print(io,console.warn,e,...t)}deprecated(...e){console.warn("[ DEPRECATED ]",...e)}static setLogLevel(e){lo=e}setLogLevel(e){this.customLogLevel=e}}const ho=new po("AudioLevels.ts"),fo=window.AudioContext||window.webkitAudioContext;class mo{speakStartEventTime=0;speakStopEventTime=0;speaking=!1;audioMedianInterval=-1;audioLevelInterval=-1;audioLevels=[];constructor(e,t){this.id=e.id,this.listener=t,this.stream=e,this.audioContext=new fo,this.analyser=this.audioContext.createAnalyser(),this.audioStreamSource=this.audioContext.createMediaStreamSource(this.stream),this.analyser.fftSize=32,this.analyser.minDecibels=-90,this.analyser.maxDecibels=-10,this.audioStreamSource.connect(this.analyser)}getAudioLevelMedian(){const{length:e}=this.audioLevels;return this.audioLevels.reduce(((e,t)=>e+t),0)/e}getCurrentAudioLevel(){const{length:e}=this.audioLevels;return e?this.audioLevels[e-1]:0}audioMuteDetection(){0===this.getAudioLevelMedian()&&this.audioLevels.length>0&&this.listener?.onMuteDetection?.(this.id)}detectSpeakingChange(e){e<20&&!this.speakStopEventTime&&(this.speakStartEventTime=0,this.speakStopEventTime=Date.now()),e>=20&&!this.speakStartEventTime&&(this.speakStartEventTime=Date.now(),this.speakStopEventTime=0);const t=this.speakStartEventTime||this.speakStopEventTime,r=Boolean(this.speakStartEventTime);(Date.now()-t>500&&r||Date.now()-t>300&&!r)&&this.speaking!==r&&(this.speaking=r,r?this.listener?.onStartSpeak():this.listener?.onStopSpeak())}computeRMS(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r]*e[r];return t/=e.length,Math.sqrt(t)}getInstantAudioLevel(){const e=new Uint8Array(this.analyser.frequencyBinCount);this.analyser.getByteFrequencyData(e);const t=this.computeRMS(e);return t>0?100*t/255:0}loopCalcul(){const e=this.getInstantAudioLevel();this.audioLevels=this.audioLevels.splice(-59),this.detectSpeakingChange(e),this.audioLevels.push(e),this.listener?.onAudioLevel?.(e,this.id)}analyse(){this.audioLevelInterval=window.setInterval((()=>this.loopCalcul()),1e3/60),this.audioMedianInterval=window.setInterval((()=>this.audioMuteDetection()),2e3)}release(){this.listener=void 0,clearInterval(this.audioLevelInterval),clearInterval(this.audioMedianInterval),this.stream.getTracks().forEach((e=>{this.stream.removeTrack(e)}));try{this.audioStreamSource.disconnect(this.analyser)}catch(e){ho.error("release","audioStreamSource failed to disconnect",e)}this.audioContext.close().catch((e=>{ho.error("release","audioContext failed to close",e)})),this.audioLevels=[]}static isAPIAvailable(){return!!fo}}const go=new po("AudioRenderer.ts");var vo=class{constructor({consumerId:e}){this.consumerId=e,this.audio=new Audio,this.audio.id=e,this.audio.autoplay=!0,document.body.appendChild(this.audio)}destroy(){this.audio.pause(),this.audio.srcObject=null,document.body.removeChild(this.audio)}setSource(e){this.audio.srcObject=e}async setSink(e){await(this.audio.setSinkId?.(e))}getSink(){return this.audio.sinkId}async play(){await this.audio.play().catch((e=>{go.warn("play","failed to play"),setTimeout((()=>{this.play()}),1e3)}))}};const yo=e=>new Promise((t=>{const r=window.devicePixelRatio||1,n=e.getContext("2d"),i=new Blob(['<svg width="103" height="36" fill="none" xmlns="http://www.w3.org/2000/svg"><g opacity=".8" fill="#fff"><path d="M10.994 33.06c.903 0 1.658-.734 1.392-1.581a5.249 5.249 0 0 0-1.279-2.124 5.171 5.171 0 0 0-3.673-1.535 5.171 5.171 0 0 0-3.673 1.535c-.595.6-1.03 1.33-1.28 2.124-.265.847.49 1.582 1.393 1.582h7.12ZM10.65 16.2c-.902 0-1.658.735-1.392 1.582.25.794.685 1.524 1.28 2.124a5.171 5.171 0 0 0 3.672 1.535 5.172 5.172 0 0 0 3.674-1.535 5.25 5.25 0 0 0 1.279-2.124c.266-.847-.49-1.582-1.393-1.582h-7.12ZM14.21 31.455c0 .887.75 1.63 1.606 1.35a5.187 5.187 0 0 0 2.067-1.279 5.264 5.264 0 0 0 1.521-3.706c0-1.39-.547-2.723-1.52-3.705a5.187 5.187 0 0 0-2.068-1.278c-.856-.281-1.606.462-1.606 1.349v7.27ZM7.434 17.806c0-.887-.75-1.63-1.607-1.35a5.186 5.186 0 0 0-2.066 1.279 5.264 5.264 0 0 0-1.522 3.706c0 1.39.548 2.723 1.522 3.705a5.186 5.186 0 0 0 2.066 1.278c.857.281 1.607-.462 1.607-1.349v-7.27Z"/><path d="M32.965 31.098c-1.442 0-2.601-.227-3.478-.68-.865-.465-1.517-1.043-1.955-1.734a.416.416 0 0 1-.052-.187c0-.125.057-.227.173-.306l.986-.731a.286.286 0 0 1 .208-.085c.103 0 .201.062.294.187.773 1.224 2.07 1.836 3.893 1.836.796 0 1.471-.142 2.025-.425.565-.284.848-.737.848-1.36 0-.465-.161-.827-.485-1.088-.311-.26-.796-.493-1.453-.697-.6-.181-.975-.289-1.125-.323-.992-.283-1.707-.504-2.146-.663-1.107-.408-1.84-.878-2.198-1.41-.357-.534-.536-1.089-.536-1.667 0-.476.15-.986.45-1.53.311-.555.796-1.025 1.453-1.41.67-.397 1.506-.595 2.51-.595 1.05 0 1.932.13 2.647.39.716.25 1.396.67 2.042 1.258.081.08.121.159.121.238 0 .114-.057.204-.173.272l-1.107.731a.469.469 0 0 1-.225.085c-.104 0-.202-.05-.294-.153-.692-.725-1.644-1.088-2.856-1.088-.692 0-1.228.102-1.609.306-.37.204-.617.431-.744.68-.115.25-.173.47-.173.663 0 .408.162.737.485.986.323.25.801.476 1.436.68.058.023.502.153 1.332.391.52.136 1.056.29 1.61.46 1.21.396 2.019.9 2.422 1.512.416.612.623 1.201.623 1.768 0 .612-.15 1.196-.45 1.75-.288.556-.801 1.02-1.54 1.395-.727.362-1.713.544-2.959.544ZM44.114 21.766c.865 0 1.667.249 2.405.748.739.487 1.108 1.388 1.108 2.702v5.321a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085H46.14a.423.423 0 0 1-.277-.085.407.407 0 0 1-.087-.272v-5.032c-.035-.646-.22-1.155-.554-1.53-.323-.373-.744-.56-1.263-.56-.37 0-.738.102-1.107.306-.358.192-.664.492-.918.9-.253.397-.403.896-.45 1.496v4.42a.365.365 0 0 1-.103.272c-.058.057-.145.085-.26.085h-1.125a.423.423 0 0 1-.276-.085.407.407 0 0 1-.087-.272v-8.193c0-.114.029-.199.087-.255a.378.378 0 0 1 .276-.102h1.125c.116 0 .202.034.26.102.069.056.103.141.103.255v.204c0 .079.012.141.035.187a.168.168 0 0 0 .121.05c.092 0 .214-.062.364-.186a4.02 4.02 0 0 1 1.038-.612c.38-.148.738-.221 1.073-.221ZM57.436 28.207c.023.34.081.607.173.8.093.18.289.322.589.424.184.068.277.165.277.29a.396.396 0 0 1-.052.17l-.485.951c-.092.204-.242.278-.45.221-.669-.147-1.13-.47-1.384-.969-.058-.124-.115-.187-.173-.187-.058 0-.121.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.056-1.02-.207-.408-.311-.799-.311-1.173 0-.612.19-1.161.571-1.648.392-.488.975-.828 1.748-1.02.53-.125 1.269-.221 2.215-.29.646-.045 1.113-.09 1.401-.135.231-.034.335-.17.312-.408-.058-.51-.23-.918-.52-1.224-.276-.318-.743-.476-1.4-.476-.428 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.104.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288 0-.034.011-.085.034-.153a3.292 3.292 0 0 1 1.367-1.564c.635-.397 1.46-.595 2.475-.595.992 0 1.834.255 2.526.765.693.498 1.062 1.224 1.108 2.176.011.453.017 1.06.017 1.819.012.759.017 1.308.017 1.648Zm-4.326 1.445c.312 0 .652-.073 1.021-.22.38-.148.715-.403 1.004-.766.3-.374.484-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.162-.09-.277-.067l-.675.067c-.75.069-1.361.148-1.834.238-.462.08-.86.227-1.194.442a.984.984 0 0 0-.485.884c0 .465.208.782.623.952.416.17.871.255 1.367.255ZM64.486 21.766c1.107 0 1.967.26 2.578.782.611.51 1.027 1.116 1.246 1.819a6.83 6.83 0 0 1 .329 2.073c0 .692-.11 1.389-.329 2.091-.22.692-.635 1.298-1.246 1.82-.611.509-1.47.764-2.578.764-.9 0-1.65-.238-2.25-.714-.08-.08-.161-.119-.242-.119-.116 0-.173.096-.173.29v3.569c0 .113-.035.198-.104.255-.058.068-.144.102-.26.102H60.42a.378.378 0 0 1-.277-.102c-.058-.057-.086-.142-.086-.255V22.344c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.038c.116 0 .202.034.26.102.069.056.104.141.104.255 0 .09.011.164.034.22.035.046.075.069.122.069.057 0 .109-.023.155-.068.612-.533 1.396-.8 2.354-.8Zm-.173 7.785c.888 0 1.54-.3 1.955-.9.427-.601.64-1.338.64-2.21 0-.873-.213-1.61-.64-2.21-.415-.601-1.067-.902-1.955-.902-.877 0-1.518.3-1.921.901-.393.59-.589 1.326-.589 2.21 0 .884.197 1.627.589 2.227.403.59 1.044.884 1.92.884ZM76.268 31.097c-1.316 0-2.452-.277-3.41-.833a5.531 5.531 0 0 1-2.163-2.277c-.484-.975-.726-2.08-.726-3.315 0-1.236.242-2.335.727-3.298a5.507 5.507 0 0 1 2.163-2.295c.957-.555 2.094-.833 3.409-.833 1.246 0 2.324.25 3.236.748a5.437 5.437 0 0 1 2.163 2.09c.034.069.052.131.052.188 0 .125-.087.215-.26.272l-1.298.323a.39.39 0 0 1-.12.017c-.151 0-.266-.074-.347-.221-.715-1.156-1.857-1.734-3.426-1.734-.97 0-1.771.221-2.406.663a3.907 3.907 0 0 0-1.401 1.75c-.3.715-.45 1.491-.45 2.33 0 .838.15 1.615.45 2.329.3.713.767 1.291 1.401 1.733.635.442 1.437.663 2.406.663.911 0 1.701-.21 2.37-.628.681-.42 1.165-1.06 1.454-1.921.08-.216.225-.306.433-.272l1.315.17c.196.034.294.124.294.272 0 .022-.012.079-.035.17-.507 1.303-1.246 2.283-2.215 2.94-.957.646-2.163.97-3.616.97ZM91.216 28.207c.023.34.08.607.173.8.092.18.288.322.588.424.185.068.277.165.277.29a.396.396 0 0 1-.052.17l-.484.951c-.093.204-.243.278-.45.221-.67-.147-1.13-.47-1.385-.969-.057-.124-.115-.187-.173-.187-.057 0-.12.046-.19.136-.6.714-1.575 1.071-2.925 1.071-.819 0-1.482-.141-1.99-.425-.496-.283-.848-.623-1.055-1.02-.208-.408-.312-.799-.312-1.173 0-.612.19-1.161.571-1.648.393-.488.975-.828 1.748-1.02.53-.125 1.27-.221 2.215-.29.646-.045 1.113-.09 1.402-.135.23-.034.334-.17.311-.408-.057-.51-.23-.918-.519-1.224-.277-.318-.744-.476-1.401-.476-.427 0-.837.09-1.23.272-.38.17-.674.47-.882.9-.103.216-.254.29-.45.222l-1.055-.29c-.185-.056-.277-.152-.277-.288a.53.53 0 0 1 .034-.153 3.293 3.293 0 0 1 1.368-1.564c.634-.397 1.459-.595 2.474-.595.992 0 1.834.255 2.527.765.692.498 1.06 1.224 1.107 2.176.012.453.017 1.06.017 1.819.012.759.018 1.308.018 1.648Zm-4.326 1.445c.311 0 .651-.073 1.02-.22.381-.148.716-.403 1.004-.766.3-.374.485-.872.554-1.495v-.034c0-.114-.035-.199-.104-.256-.07-.067-.161-.09-.277-.067l-.675.067c-.75.069-1.36.148-1.834.238-.461.08-.86.227-1.194.442a.984.984 0 0 0-.484.884c0 .465.207.782.622.952.416.17.871.255 1.368.255ZM95.687 30.536a.364.364 0 0 1-.104.272c-.058.057-.144.085-.26.085h-1.125a.424.424 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.029-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.116 0 .202.034.26.102.069.056.104.141.104.255v11.746ZM100.033 30.536a.364.364 0 0 1-.104.272c-.057.057-.144.085-.26.085h-1.124a.423.423 0 0 1-.277-.085.407.407 0 0 1-.086-.272V18.79c0-.114.028-.199.086-.255a.378.378 0 0 1 .277-.102h1.125c.115 0 .202.034.26.102.069.056.103.141.103.255v11.746Z" stroke="#fff" stroke-width=".5"/><path d="M43.151 8.686c.296 0 .554-.036.774-.108.22-.076.402-.182.546-.318.148-.14.258-.308.33-.504.072-.2.108-.422.108-.666a1.75 1.75 0 0 0-.108-.63 1.245 1.245 0 0 0-.324-.48 1.41 1.41 0 0 0-.546-.3 2.516 2.516 0 0 0-.78-.108h-1.206v3.114h1.206Zm0-4.362c.58 0 1.082.068 1.506.204.424.136.774.326 1.05.57.276.244.48.536.612.876.136.34.204.712.204 1.116 0 .42-.07.806-.21 1.158-.14.348-.35.648-.63.9s-.632.448-1.056.588c-.42.14-.912.21-1.476.21h-1.206V13h-1.614V4.324h2.82Zm6.819 2.424c.456 0 .87.074 1.242.222a2.692 2.692 0 0 1 1.578 1.626c.144.392.216.83.216 1.314 0 .488-.072.928-.216 1.32-.144.392-.35.726-.618 1.002a2.653 2.653 0 0 1-.96.636 3.333 3.333 0 0 1-1.242.222c-.46 0-.878-.074-1.254-.222a2.712 2.712 0 0 1-.966-.636 2.922 2.922 0 0 1-.618-1.002 3.807 3.807 0 0 1-.216-1.32c0-.484.072-.922.216-1.314.148-.392.354-.724.618-.996.268-.272.59-.482.966-.63a3.397 3.397 0 0 1 1.254-.222Zm0 5.202c.512 0 .89-.172 1.134-.516.248-.344.372-.848.372-1.512s-.124-1.17-.372-1.518c-.244-.348-.622-.522-1.134-.522-.52 0-.906.176-1.158.528-.248.348-.372.852-.372 1.512s.124 1.164.372 1.512c.252.344.638.516 1.158.516Zm12.85-5.106L60.866 13h-1.188c-.136 0-.23-.088-.282-.264L58.29 9.178c-.036-.12-.07-.238-.102-.354a5.729 5.729 0 0 1-.072-.36 6.81 6.81 0 0 1-.084.366c-.028.12-.06.24-.096.36l-1.122 3.546c-.048.176-.154.264-.318.264h-1.14l-1.95-6.156h1.182c.108 0 .2.026.276.078a.363.363 0 0 1 .15.198l.882 3.288c.044.18.082.356.114.528.036.172.066.344.09.516.044-.172.09-.344.138-.516l.162-.528 1.02-3.3a.382.382 0 0 1 .138-.198.429.429 0 0 1 .258-.078h.654c.104 0 .192.026.264.078a.363.363 0 0 1 .15.198l.99 3.3c.052.18.1.358.144.534.048.172.094.344.138.516.052-.34.126-.69.222-1.05l.906-3.288a.405.405 0 0 1 .15-.198.429.429 0 0 1 .258-.078h1.128Zm4.704 2.37c0-.192-.028-.372-.084-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.826.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm6.668-2.196c.192-.368.42-.656.684-.864a1.45 1.45 0 0 1 .936-.318c.284 0 .512.062.684.186l-.096 1.11a.294.294 0 0 1-.09.156.239.239 0 0 1-.15.042c-.06 0-.15-.01-.27-.03a2.01 2.01 0 0 0-.342-.03 1.11 1.11 0 0 0-.786.282c-.1.088-.19.196-.27.324a3.44 3.44 0 0 0-.216.438V13h-1.482V6.844h.87c.152 0 .258.028.318.084.06.052.1.148.12.288l.09.696Zm6.87 1.302c0-.192-.029-.372-.085-.54a1.25 1.25 0 0 0-.24-.45 1.096 1.096 0 0 0-.414-.3 1.358 1.358 0 0 0-.576-.114c-.428 0-.766.122-1.014.366-.244.244-.4.59-.468 1.038h2.796Zm-2.827.894c.024.316.08.59.168.822.088.228.204.418.348.57.144.148.314.26.51.336.2.072.42.108.66.108.24 0 .446-.028.618-.084a2.76 2.76 0 0 0 .456-.186 7.55 7.55 0 0 0 .342-.186.59.59 0 0 1 .288-.084c.124 0 .216.046.276.138l.426.54a2.536 2.536 0 0 1-.552.486 3.281 3.281 0 0 1-1.32.474 4.79 4.79 0 0 1-.666.048 3.33 3.33 0 0 1-1.194-.21 2.726 2.726 0 0 1-.96-.63 2.993 2.993 0 0 1-.642-1.032c-.156-.412-.234-.888-.234-1.428 0-.42.068-.814.204-1.182.136-.372.33-.694.582-.966.256-.276.566-.494.93-.654.368-.16.782-.24 1.242-.24.388 0 .746.062 1.074.186.328.124.61.306.846.546.236.236.42.528.552.876.136.344.204.738.204 1.182 0 .224-.024.376-.072.456-.048.076-.14.114-.276.114h-3.81Zm9.134-1.692a1.451 1.451 0 0 0-.552-.432 1.597 1.597 0 0 0-.636-.126c-.224 0-.426.042-.606.126a1.21 1.21 0 0 0-.462.384 1.8 1.8 0 0 0-.294.648c-.068.26-.102.568-.102.924 0 .36.028.666.084.918.06.248.144.452.252.612.108.156.24.27.396.342.156.068.33.102.522.102.308 0 .57-.064.786-.192.216-.128.42-.31.612-.546v-2.76Zm1.482-4.332V13h-.906c-.196 0-.32-.09-.372-.27l-.126-.594a3.09 3.09 0 0 1-.858.69c-.32.176-.694.264-1.122.264-.336 0-.644-.07-.924-.21a2.098 2.098 0 0 1-.726-.606 3.033 3.033 0 0 1-.468-.99 5.072 5.072 0 0 1-.162-1.344c0-.456.062-.88.186-1.272s.302-.732.534-1.02c.232-.288.51-.512.834-.672a2.384 2.384 0 0 1 1.092-.246c.344 0 .638.054.882.162.244.108.462.254.654.438V4.084h1.482Zm5.863 7.32c.168.204.35.348.546.432.2.084.41.126.63.126.228 0 .432-.04.612-.12.184-.084.34-.212.468-.384a1.93 1.93 0 0 0 .294-.666 4.05 4.05 0 0 0 .102-.972c0-.676-.112-1.164-.336-1.464-.224-.304-.546-.456-.966-.456-.284 0-.532.066-.744.198a2.38 2.38 0 0 0-.606.546v2.76Zm0-3.804a3.02 3.02 0 0 1 .822-.618c.304-.156.65-.234 1.038-.234.356 0 .676.07.96.21.288.14.532.342.732.606.204.26.36.576.468.948.108.372.162.79.162 1.254 0 .5-.062.954-.186 1.362a3.132 3.132 0 0 1-.534 1.05 2.4 2.4 0 0 1-.828.672c-.324.16-.684.24-1.08.24a2.103 2.103 0 0 1-.954-.216 1.891 1.891 0 0 1-.366-.246c-.108-.1-.212-.21-.312-.33l-.066.414c-.024.104-.066.178-.126.222a.37.37 0 0 1-.234.066h-.978V4.084h1.482V7.6Zm10.743-.756-3.354 7.848a.538.538 0 0 1-.174.234c-.068.056-.174.084-.318.084H97.68l1.152-2.472-2.49-5.694h1.302c.116 0 .206.028.27.084.068.056.118.12.15.192l1.308 3.192c.044.108.08.216.108.324.032.108.062.218.09.33a32.3 32.3 0 0 1 .108-.33c.036-.112.076-.222.12-.33l1.236-3.186a.437.437 0 0 1 .408-.276h1.188Z"/></g></svg>'],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(i),o=new Image;o.onload=()=>{const i=e.width/r-o.width-16,a=e.height/r-o.height-16;n?.drawImage(o,i,a),t(e)},o.src=a})),bo=async e=>{const{videoWidth:t,videoHeight:r}=e,n=t>r?"landscape":"portrait",i="portrait"===n?t:r,a="landscape"===n?r:t,o="landscape"===n?(t-i)/2:0,s="portrait"===n?(r-a)/2:0,c=document.createElement("canvas"),l=c.getContext("2d"),d=window.devicePixelRatio||1;c.width=i*d,c.height=a*d,l?.scale(d,d),l?.drawImage(e,o,s,i,a,0,0,c.width/d,c.height/d);return(await yo(c)).toDataURL("image/jpeg")},wo=async e=>{const t=document.createElement("video"),r=new MediaStream;r.addTrack(e),t.srcObject=r,t.setAttribute("muted","true");const n=e.getSettings();t.width=n.width||0,t.height=n.height||0,await t.play();const i=document.createElement("canvas"),a=i.getContext("2d");i.height=t.height,i.width=t.width,a?.drawImage(t,0,0);return(await yo(i)).toDataURL("image/jpeg")};var xo=a("eEB2e"),_o=(Fi=a("4Fy4N"),{}),So=_o&&_o.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),ko=_o&&_o.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Co=_o&&_o.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&So(t,e,r);return ko(t,e),t},Eo=_o&&_o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_o,"__esModule",{value:!0}),_o.debug=_o.parseScalabilityMode=_o.detectDevice=_o.Device=_o.version=_o.types=void 0;const Ro=Eo(a("hZG0u"));_o.debug=Ro.default;var Po=a("1ZHQC");Object.defineProperty(_o,"Device",{enumerable:!0,get:function(){return Po.Device}}),Object.defineProperty(_o,"detectDevice",{enumerable:!0,get:function(){return Po.detectDevice}});const To=Co(a("cQumC"));_o.types=To,_o.version="3.6.53";var jo=a("fT1lN");Object.defineProperty(_o,"parseScalabilityMode",{enumerable:!0,get:function(){return jo.parse}});const Oo=new po("StreamerMediasoup");function Mo(){try{const r=navigator.userAgent,n=Fi.getParser(r);e="DeviceDetectionForced",t=!0,Qa().setTag(e,t),ro({type:"debug",category:"browser",data:n.getResult()});const i=n.getOS();if("Safari"===n.getBrowserName()&&"iOS"===i.name&&Number(i.version)>=14.3)return new(0,_o.Device)({handlerName:"Safari12"});throw Error("failed to autoDetect browser, falling back to chrome 74")}catch(e){Oo.error("deviceAutoDetection",e),to(e)}var e,t;return new(0,_o.Device)({handlerName:"Chrome74"})}class Io{constructor(e,t){this.mediasoupDevice=e,this.config=t}static async create(e,t){const r=await e.request("getRouterRtpCapabilities");r.headerExtensions=r.headerExtensions?.filter((e=>"urn:3gpp:video-orientation"!==e.uri));const n=function(){try{return new(0,_o.Device)}catch(e){return Oo.error("failed to detects device from mediasoup, fallback on auto detection",e),Mo()}}();return n.load({routerRtpCapabilities:r}),new Io(n,t)}getRtpCapabilities(){return this.mediasoupDevice.rtpCapabilities}async createTransportConfig(e){const t=await e.request("createWebRtcTransport");return{id:t.id,iceParameters:t.iceParameters,iceCandidates:t.iceCandidates,dtlsParameters:{...t.dtlsParameters,role:"auto"},sctpParameters:t.sctpParameters,iceServers:this.config.iceServers,proprietaryConstraints:{optional:[{googDscp:!0}]},additionalSettings:{encodedInsertableStreams:!1}}}async createSendTransport(e){const t=this.mediasoupDevice.createSendTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{Oo.log("dtlsParameters",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),t.on("produce",(async({kind:r,rtpParameters:n,appData:i},a,o)=>{try{const{id:o}=await e.request("produce",{transportId:t.id,kind:r,rtpParameters:n,appData:i});a({id:o}),Oo.log("producerTransport: ",t)}catch(e){o(e)}})),t}async createRecvTransport(e){const t=this.mediasoupDevice.createRecvTransport(await this.createTransportConfig(e));return t.on("connect",(({dtlsParameters:r},n,i)=>{Oo.log("dtls",t.id,r),e.request("connectWebRtcTransport",{transportId:t.id,dtlsParameters:r}).then(n).catch(i)})),t}async createTransport(e,t){return"send"===t?await this.createSendTransport(e):await this.createRecvTransport(e)}}var Lo={};(function(){"use strict";var e;function r(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){return e==Array.prototype||e==Object.prototype||(e[t]=r.value),e};var i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t];for(var r=0;r<e.length;++r){var n=e[r];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function a(e,t){if(t)e:{var r=i;e=e.split(".");for(var a=0;a<e.length-1;a++){var o=e[a];if(!(o in r))break e;r=r[o]}(t=t(a=r[e=e[e.length-1]]))!=a&&null!=t&&n(r,e,{configurable:!0,writable:!0,value:t})}}function o(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function s(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:r(e)}}function c(e){if(!(e instanceof Array)){e=s(e);for(var t,r=[];!(t=e.next()).done;)r.push(t.value);e=r}return e}a("Symbol",(function(e){function t(e,t){this.g=e,n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(n||"")+"_"+i++,n)}})),a("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<t.length;a++){var s=i[t[a]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&n(s.prototype,e,{configurable:!0,writable:!0,value:function(){return o(r(this))}})}return e}));var l,d="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)l=Object.setPrototypeOf;else{var u;e:{var p={};try{p.__proto__={a:!0},u=p.a;break e}catch(e){}u=!1}l=u?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=l;function f(e,t){if(e.prototype=d(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var r in t)if("prototype"!=r)if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(t,r);n&&Object.defineProperty(e,r,n)}else e[r]=t[r];e.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function v(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function y(e,t,r){return e.g=r,{value:t}}function b(e){this.g=new m,this.h=e}function w(e,t,r,n){try{var i=t.call(e.g.i,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var a=i.value}catch(t){return e.g.i=null,v(e.g,t),x(e)}return e.g.i=null,n.call(e.g,a),x(e)}function x(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,v(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function _(e){this.next=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=x(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=w(e,e.g.i.throw,t,e.g.o):(v(e.g,t),t=x(e)),t},this.return=function(t){return function(e,t){g(e.g);var r=e.g.i;return r?w(e,"return"in r?r.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),x(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function S(e,t){return t=new _(new b(t)),h&&e.prototype&&h(t,e.prototype),t}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s};var k="function"==typeof Object.assign?Object.assign:function(e,t){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};a("Object.assign",(function(e){return e||k})),a("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function r(){this.g=null}function n(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;r.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var a=i.setTimeout;r.prototype.i=function(e){a(e,0)},r.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var r=e[t];e[t]=null;try{r()}catch(e){this.j(e)}}}this.g=null},r.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(n){r||(r=!0,e.call(t,n))}}var t=this,r=!1;return{resolve:e(this.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(e);else{e:switch(typeof e){case"object":var r=null!=e;break e;case"function":r=!0;break e;default:r=!1}r?this.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.D(),this.A()},t.prototype.D=function(){var e=this;a((function(){if(e.B()){var t=i.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,r=i.dispatchEvent;return void 0===r||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,r(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)o.h(this.g[e]);this.g=null}};var o=new r;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=function(e,t){var r=this.j();try{e.call(t,r.resolve,r.reject)}catch(e){r.reject(e)}},t.prototype.then=function(e,r){function n(e,t){return"function"==typeof e?function(t){try{i(e(t))}catch(e){a(e)}}:t}var i,a,o=new t((function(e,t){i=e,a=t}));return this.J(n(e,i),n(r,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=function(e,t){function r(){switch(n.h){case 1:e(n.i);break;case 2:t(n.i);break;default:throw Error("Unexpected state: "+n.h)}}var n=this;null==this.g?o.h(r):this.g.push(r),this.o=!0},t.resolve=n,t.reject=function(e){return new t((function(t,r){r(e)}))},t.race=function(e){return new t((function(t,r){for(var i=s(e),a=i.next();!a.done;a=i.next())n(a.value).J(t,r)}))},t.all=function(e){var r=s(e),i=r.next();return i.done?n([]):new t((function(e,t){function a(t){return function(r){o[t]=r,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,n(i.value).J(a(o.length-1),t),i=r.next()}while(!i.done)}))},t})),a("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),a("Array.prototype.includes",(function(e){return e||function(e,t){var r=this;r instanceof String&&(r=String(r));var n=r.length;for(0>(t=t||0)&&(t=Math.max(t+n,0));t<n;t++){var i=r[t];if(i===e||Object.is(i,e))return!0}return!1}})),a("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}})),a("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var r=0,n=!1,i={next:function(){if(!n&&r<e.length){var i=r++;return{value:t(i,e[i]),done:!1}}return n=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var C=this||self;function E(e,t){e=e.split(".");var r,n=C;e[0]in n||void 0===n.execScript||n.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===t?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=t}function R(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var P,T,j="undefined"!=typeof TextDecoder,O="undefined"!=typeof TextEncoder;function M(e){if(O)e=(T||(T=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var r=0,n=new Uint8Array(3*e.length),i=0;i<e.length;i++){var a=e.charCodeAt(i);if(128>a)n[r++]=a;else{if(2048>a)n[r++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&i<e.length){var o=e.charCodeAt(++i);if(56320<=o&&57343>=o){a=1024*(a-55296)+o-56320+65536,n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");a=65533}n[r++]=a>>12|224,n[r++]=a>>6&63|128}n[r++]=63&a|128}}e=n.subarray(0,r)}return e}var I={},L=null;function D(e,t){void 0===t&&(t=0),N(),t=I[t];for(var r=Array(Math.floor(e.length/3)),n=t[64]||"",i=0,a=0;i<e.length-2;i+=3){var o=e[i],s=e[i+1],c=e[i+2],l=t[o>>2];o=t[(3&o)<<4|s>>4],s=t[(15&s)<<2|c>>6],c=t[63&c],r[a++]=l+o+s+c}switch(l=0,c=n,e.length-i){case 2:c=t[(15&(l=e[i+1]))<<2]||n;case 1:e=e[i],r[a]=t[e>>2]+t[(3&e)<<4|l>>4]+c+n}return r.join("")}function A(e){var t=e.length,r=3*t/4;r%3?r=Math.floor(r):-1!="=.".indexOf(e[t-1])&&(r=-1!="=.".indexOf(e[t-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(e,t){function r(t){for(;n<e.length;){var r=e.charAt(n++),i=L[r];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return t}N();for(var n=0;;){var i=r(-1),a=r(0),o=r(64),s=r(64);if(64===s&&-1===i)break;t(i<<2|a>>4),64!=o&&(t(a<<4&240|o>>2),64!=s&&t(o<<6&192|s))}}(e,(function(e){n[i++]=e})),n.subarray(0,i)}function N(){if(!L){L={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=e.concat(t[r].split(""));I[r]=n;for(var i=0;i<n.length;i++){var a=n[i];void 0===L[a]&&(L[a]=i)}}}}var B,F="function"==typeof Uint8Array.prototype.slice;function z(e,t,r){return t===r?B||(B=new Uint8Array(0)):F?e.slice(t,r):new Uint8Array(e.subarray(t,r))}var U=0;function V(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.i=this.j=0,this.l=!1,this.v=t,e&&H(this,e)}function H(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?A(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.j=0,e.i=e.h.length,e.g=e.j}function $(e){var t=e.h,r=t[e.g],n=127&r;return 128>r?(e.g+=1,n):(n|=(127&(r=t[e.g+1]))<<7,128>r?(e.g+=2,n):(n|=(127&(r=t[e.g+2]))<<14,128>r?(e.g+=3,n):(n|=(127&(r=t[e.g+3]))<<21,128>r?(e.g+=4,n):(n|=(15&(r=t[e.g+4]))<<28,128>r?(e.g+=5,n>>>0):(e.g+=5,128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&128<=t[e.g++]&&e.g++,n)))))}function W(e){var t=e.h[e.g],r=e.h[e.g+1],n=e.h[e.g+2],i=e.h[e.g+3];return e.g+=4,e=2*((r=(t<<0|r<<8|n<<16|i<<24)>>>0)>>31)+1,t=r>>>23&255,r&=8388607,255==t?r?NaN:1/0*e:0==t?e*Math.pow(2,-149)*r:e*Math.pow(2,t-150)*(r+Math.pow(2,23))}V.prototype.reset=function(){this.g=this.j};var q=[];function G(){this.g=new Uint8Array(64),this.h=0}function Z(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function K(e){var t={},r=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=r,t=this.o,q.length?(r=q.pop(),t&&(r.v=t.v),e&&H(r,e),e=r):e=new V(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function Y(e){var t=e.g;if((t=t.g==t.i)||(t=e.j)||(t=(t=e.g).l||0>t.g||t.g>t.i),t)return!1;e.m=e.g.g;var r=7&(t=$(e.g));return 0!=r&&5!=r&&1!=r&&2!=r&&3!=r&&4!=r?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=r,!0)}function Q(e){switch(e.h){case 0:if(0!=e.h)Q(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?Q(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)Q(e);else{var t=$(e.g);(e=e.g).g+=t}break;case 5:5!=e.h?Q(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!Y(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}Q(e)}break;default:e.j=!0}}function J(e,t,r){var n=e.g.i,i=$(e.g);return i=e.g.g+i,e.g.i=i,r(t,e),e.g.g=i,e.g.i=n,t}function X(e){var t,r=$(e.g),n=(e=e.g).g;if(e.g+=r,e=e.h,j)(t=P)||(t=P=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(n,n+r));else{r=n+r;for(var i,a,o,s=[],c=null;n<r;)128>(i=e[n++])?s.push(i):224>i?n>=r?s.push(65533):(a=e[n++],194>i||128!=(192&a)?(n--,s.push(65533)):s.push((31&i)<<6|63&a)):240>i?n>=r-1?s.push(65533):128!=(192&(a=e[n++]))||224===i&&160>a||237===i&&160<=a||128!=(192&(t=e[n++]))?(n--,s.push(65533)):s.push((15&i)<<12|(63&a)<<6|63&t):244>=i?n>=r-2?s.push(65533):128!=(192&(a=e[n++]))||0!=a-144+(i<<28)>>30||128!=(192&(t=e[n++]))||128!=(192&(o=e[n++]))?(n--,s.push(65533)):(i=(7&i)<<18|(63&a)<<12|(63&t)<<6|63&o,i-=65536,s.push(55296+(i>>10&1023),56320+(1023&i))):s.push(65533),8192<=s.length&&(c=R(c,s),s.length=0);t=R(c,s)}return t}function ee(){this.h=[],this.i=0,this.g=new G}function te(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function re(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var r=e.h,n=r.length,i=0,a=0;a<n;a++){var o=r[a];0!==o.length&&(t.set(o,i),i+=o.length)}return 0!==(n=(r=e.g).h)&&(t.set(r.g.subarray(0,n),i),r.h=0),e.h=[t],t}function ne(e,t,r){if(null!=r){Z(e.g,8*t+5),e=e.g;var n=r;0===(n=(r=0>n?1:0)?-n:n)?0<1/n?U=0:(0,U=2147483648):isNaN(n)?(0,U=2147483647):34028234663852886e22<n?(0,U=(r<<31|2139095040)>>>0):11754943508222875e-54>n?(n=Math.round(n/Math.pow(2,-149)),0,U=(r<<31|n)>>>0):(t=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-t),n=8388607&Math.round(8388608*n),0,U=(r<<31|t+127<<23|n)>>>0),r=U,e.push(r>>>0&255),e.push(r>>>8&255),e.push(r>>>16&255),e.push(r>>>24&255)}}G.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},G.prototype.length=function(){return this.h},G.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,z(e,0,t)},K.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var ie="function"==typeof Uint8Array;function ae(e,t,r){if(null!=e)return"object"==typeof e?ie&&e instanceof Uint8Array?r(e):oe(e,t,r):t(e)}function oe(e,t,r){if(Array.isArray(e)){for(var n=Array(e.length),i=0;i<e.length;i++)n[i]=ae(e[i],t,r);return Array.isArray(e)&&e.W&&de(n),n}for(i in n={},e)n[i]=ae(e[i],t,r);return n}function se(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var ce,le={W:{value:!0,configurable:!0}};function de(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,le),e}function ue(e,t,r){var n=ce;if(ce=null,e||(e=n),n=this.constructor.ca,e||(e=n?[n]:[]),this.j=n?0:-1,this.i=null,this.g=e,e=(n=this.g.length)-1,n&&null!==(n=this.g[e])&&"object"==typeof n&&n.constructor===Object?(this.l=e-this.j,this.h=n):void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.h=null):this.l=Number.MAX_VALUE,r)for(t=0;t<r.length;t++)(e=r[t])<this.l?(e+=this.j,(n=this.g[e])?de(n):this.g[e]=pe):(he(this),(n=this.h[e])?de(n):this.h[e]=pe)}var pe=Object.freeze(de([]));function he(e){var t=e.l+e.j;e.g[t]||(e.h=e.g[t]={})}function fe(e,t,r){return-1===t?null:void 0!==r&&r||t>=e.l?e.h?e.h[t]:void 0:e.g[t+e.j]}function me(e){var t=void 0!==t&&t,r=fe(e,1,t);return null==r&&(r=pe),r===pe&&ve(e,1,r=de([]),t),r}function ge(e,t,r){return null==(e=null==(e=fe(e,t))?e:+e)?void 0===r?0:r:e}function ve(e,t,r,n){void 0!==n&&n||t>=e.l?(he(e),e.h[t]=r):e.g[t+e.j]=r}function ye(e,t){e.i||(e.i={});var r=e.i[1];if(!r){var n=me(e);r=[];for(var i=0;i<n.length;i++)r[i]=new t(n[i]);e.i[1]=r}return r}function be(e,t,r,n){var i=ye(e,r);t=t||new r,e=me(e),null!=n?(i.splice(n,0,t),e.splice(n,0,we(t,!1))):(i.push(t),e.push(we(t,!1)))}function we(e,t){if(e.i)for(var r in e.i){var n=e.i[r];if(Array.isArray(n))for(var i=0;i<n.length;i++)n[i]&&we(n[i],t);else n&&we(n,t)}return e.g}function xe(e,t){return null==(e=fe(e,t))?0:e}function _e(e,t){return null==(e=fe(e,t))?"":e}function Se(e,t){if(e=e.m){te(t,t.g.end());for(var r=0;r<e.length;r++)te(t,e[r])}}function ke(e,t){if(4==t.h)return!1;var r=t.m;return Q(t),t.N||(t=z(t.g.h,r,t.g.g),(r=e.m)?r.push(t):e.m=[t]),!0}function Ce(e,t){var r=void 0;return new(r||(r=Promise))((function(n,i){function a(e){try{s(t.next(e))}catch(e){i(e)}}function o(e){try{s(t.throw(e))}catch(e){i(e)}}function s(e){e.done?n(e.value):new r((function(t){t(e.value)})).then(a,o)}s((t=t.apply(e,void 0)).next())}))}function Ee(e){ue.call(this,e)}function Re(e,t){for(;Y(t);)switch(t.i){case 8:var r=$(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 26:ve(e,3,r=X(t));break;case 34:ve(e,4,r=X(t));break;default:if(!ke(e,t))return e}return e}function Pe(e){ue.call(this,e,-1,Te)}ue.prototype.toJSON=function(){return oe(we(this,!1),se,D)},ue.prototype.toString=function(){return we(this,!1).toString()},f(Ee,ue),f(Pe,ue),Pe.prototype.addClassification=function(e,t){be(this,e,Ee,t)};var Te=[1];function je(e){ue.call(this,e)}function Oe(e,t){for(;Y(t);)switch(t.i){case 13:var r=W(t.g);ve(e,1,r);break;case 21:ve(e,2,r=W(t.g));break;case 29:ve(e,3,r=W(t.g));break;case 37:ve(e,4,r=W(t.g));break;case 45:ve(e,5,r=W(t.g));break;default:if(!ke(e,t))return e}return e}function Me(e){ue.call(this,e,-1,Ie)}f(je,ue),f(Me,ue);var Ie=[1];function Le(e){ue.call(this,e)}function De(e,t,r){if(r=e.createShader(0===r?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(r));return r}function Ae(e){return ye(e,Ee).map((function(e){return{index:xe(e,1),Y:ge(e,2),label:null!=fe(e,3)?_e(e,3):void 0,displayName:null!=fe(e,4)?_e(e,4):void 0}}))}function Ne(e){return{x:ge(e,1),y:ge(e,2),z:ge(e,3),visibility:null!=fe(e,4)?ge(e,4):void 0}}function Be(e,t){this.h=e,this.g=t,this.l=0}function Fe(e,t,r){return function(e,t){var r=e.g;if(void 0===e.m){var n=De(r,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=De(r,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),a=r.createProgram();if(r.attachShader(a,n),r.attachShader(a,i),r.linkProgram(a),!r.getProgramParameter(a,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(a));n=e.m=a,r.useProgram(n),i=r.getUniformLocation(n,"sampler0"),e.j={I:r.getAttribLocation(n,"aVertex"),H:r.getAttribLocation(n,"aTex"),da:i},e.s=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.enableVertexAttribArray(e.j.I),r.vertexAttribPointer(e.j.I,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),e.o=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.enableVertexAttribArray(e.j.H),r.vertexAttribPointer(e.j.H,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.uniform1i(i,0)}n=e.j,r.useProgram(e.m),r.canvas.width=t.width,r.canvas.height=t.height,r.viewport(0,0,t.width,t.height),r.activeTexture(r.TEXTURE0),e.h.bindTexture2d(t.glName),r.enableVertexAttribArray(n.I),r.bindBuffer(r.ARRAY_BUFFER,e.s),r.vertexAttribPointer(n.I,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,e.o),r.vertexAttribPointer(n.H,2,r.FLOAT,!1,0,0),r.bindFramebuffer(r.DRAW_FRAMEBUFFER?r.DRAW_FRAMEBUFFER:r.FRAMEBUFFER,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.colorMask(!0,!0,!0,!0),r.drawArrays(r.TRIANGLE_FAN,0,4),r.disableVertexAttribArray(n.I),r.disableVertexAttribArray(n.H),r.bindBuffer(r.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):r?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function ze(e){this.g=e}f(Le,ue);var Ue=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Ve(e,t){return t+e}function He(e,t){window[e]=t}function $e(e){if(this.g=e,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=e&&e.locateFile||Ve,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.S=t,e.options)for(var r=(t=s(Object.keys(e.options))).next();!r.done;r=t.next()){r=r.value;var n=e.options[r].default;void 0!==n&&(this.j[r]="function"==typeof n?n():n)}}function We(e){return Ce(e,(function e(){var t,r,n,i,a,o,s,l,d,u,p,h=this;return S(e,(function(e){switch(e.g){case 1:return t=h,h.R?(r=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(h,h.j),y(e,function(){return Ce(this,(function e(){return S(e,(function(e){switch(e.g){case 1:return e.m=2,y(e,WebAssembly.instantiate(Ue),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):e.return();case 2:if(n=e.h,"object"==typeof window)return He("createMediapipeSolutionsWasm",{locateFile:h.locateFile}),He("createMediapipeSolutionsPackedAssets",{locateFile:h.locateFile}),o=r.filter((function(e){return void 0!==e.data})),s=r.filter((function(e){return void 0===e.data})),l=Promise.all(o.map((function(e){var r=qe(t,e.url);if(void 0!==e.path){var n=e.path;r=r.then((function(e){return t.overrideFile(n,e),Promise.resolve(e)}))}return r}))),d=Promise.all(s.map((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(t.locateFile(e.url,t.S)):Promise.resolve()}))).then((function(){return Ce(t,(function e(){var t,r,n=this;return S(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,r=window.createMediapipeSolutionsPackedAssets,y(e,t(r),2);n.h=e.h,e.g=0}))}))})),u=Ce(t,(function e(){var t=this;return S(e,(function(e){return t.g.graph&&t.g.graph.url?e=y(e,qe(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),y(e,Promise.all([d,l,u]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=r.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,c(i)),y(e,createMediapipeSolutionsWasm(Module),6);case 6:h.h=e.h,h.l=new OffscreenCanvas(1,1),h.h.canvas=h.l,a=h.h.GL.createContext(h.l,{antialias:!1,alpha:!1,ba:"undefined"!=typeof WebGL2RenderingContext?2:1}),h.h.GL.makeContextCurrent(a),e.g=4;break;case 7:if(h.l=document.createElement("canvas"),!(p=h.l.getContext("webgl2",{}))&&!(p=h.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();h.D=p,h.h.canvas=h.l,h.h.createContext(h.l,!0,!0,{});case 4:h.i=new h.h.SolutionWasm,h.R=!1,e.g=0}}))}))}function qe(e,t){return Ce(e,(function e(){var r,n,i=this;return S(e,(function(e){return t in i.F?e.return(i.F[t]):(r=i.locateFile(t,""),n=fetch(r).then((function(e){return e.arrayBuffer()})),i.F[t]=n,e.return(n))}))}))}function Ge(e,t,r){return Ce(e,(function e(){var n,i,a,o,c,l,d,u,p,h,f,m,g,v,b=this;return S(e,(function(e){switch(e.g){case 1:if(!r)return e.return(t);for(n={},i=0,a=s(Object.keys(r)),o=a.next();!o.done;o=a.next())c=o.value,"string"!=typeof(l=r[c])&&"texture"===l.type&&void 0!==t[l.stream]&&++i;1<i&&(b.G=!1),d=s(Object.keys(r)),o=d.next();case 2:if(o.done){e.g=4;break}if(u=o.value,"string"==typeof(p=r[u]))return g=n,v=u,y(e,function(e,t,r){return Ce(e,(function e(){var n,i=this;return S(e,(function(e){return"number"==typeof r||r instanceof Uint8Array||r instanceof i.h.Uint8BlobList?e.return(r):r instanceof i.h.Texture2dDataOut?((n=i.s[t])||(n=new Be(i.h,i.D),i.s[t]=n),e.return(Fe(n,r,i.G))):e.return(void 0)}))}))}(b,u,t[p]),14);if(h=t[p.stream],"detection_list"===p.type){if(h){for(var w=h.getRectList(),x=h.getLandmarksList(),_=h.getClassificationsList(),k=[],C=0;C<w.size();++C){var E=w.get(C);e:{var R=new Le;for(E=new K(E);Y(E);)switch(E.i){case 13:var P=W(E.g);ve(R,1,P);break;case 21:ve(R,2,P=W(E.g));break;case 29:ve(R,3,P=W(E.g));break;case 37:ve(R,4,P=W(E.g));break;case 45:ve(R,5,P=W(E.g));break;case 48:for(var T=E.g,j=128,O=0,M=P=0;4>M&&128<=j;M++)O|=(127&(j=T.h[T.g++]))<<7*M;if(128<=j&&(O|=(127&(j=T.h[T.g++]))<<28,P|=(127&j)>>4),128<=j)for(M=0;5>M&&128<=j;M++)P|=(127&(j=T.h[T.g++]))<<7*M+3;128>j?(T=O>>>0,(P=2147483648&(j=P>>>0))&&(j=~j>>>0,0==(T=1+~T>>>0)&&(j=j+1>>>0)),T=4294967296*j+(T>>>0),P=P?-T:T):(T.l=!0,P=void 0),ve(R,6,P);break;default:if(!ke(R,E))break e}}R={Z:ge(R,1),$:ge(R,2),height:ge(R,3),width:ge(R,4),rotation:ge(R,5,0),X:xe(R,6)},P=x.get(C);e:for(E=new Me,P=new K(P);Y(P);)if(10===P.i)be(E,T=J(P,new je,Oe),je,void 0);else if(!ke(E,P))break e;E=ye(E,je).map(Ne),T=_.get(C);e:for(P=new Pe,T=new K(T);Y(T);)if(10===T.i)P.addClassification(J(T,new Ee,Re));else if(!ke(P,T))break e;R={T:R,O:E,M:Ae(P)},k.push(R)}w=k}else w=[];n[u]=w,e.g=7;break}if("proto_list"===p.type){if(h){for(w=Array(h.size()),x=0;x<h.size();x++)w[x]=h.get(x);h.delete()}else w=[];n[u]=w,e.g=7;break}if(void 0===h){e.g=3;break}if("float_list"===p.type){n[u]=h,e.g=7;break}if("proto"===p.type){n[u]=h,e.g=7;break}if("texture"!==p.type)throw Error("Unknown output config type: '"+p.type+"'");return(f=b.s[u])||(f=new Be(b.h,b.D),b.s[u]=f),y(e,Fe(f,h,b.G),13);case 13:m=e.h,n[u]=m;case 7:p.transform&&n[u]&&(n[u]=p.transform(n[u])),e.g=3;break;case 14:g[v]=e.h;case 3:o=d.next(),e.g=2;break;case 4:return e.return(n)}}))}))}function Ze(e,t){for(var r=t.name||"$",n=[].concat(c(t.wants)),i=new e.h.StringList,a=s(t.wants),o=a.next();!o.done;o=a.next())i.push_back(o.value);a=e.h.PacketListener.implement({onResults:function(i){for(var a={},o=0;o<t.wants.length;++o)a[n[o]]=i.get(o);var s=e.listeners[r];s&&(e.C=Ge(e,a,t.outs).then((function(r){r=s(r);for(var i=0;i<t.wants.length;++i){var o=a[n[i]];"object"==typeof o&&o.hasOwnProperty&&o.hasOwnProperty("delete")&&o.delete()}r&&(e.C=r)})))}}),e.i.attachMultiListener(i,a),i.delete()}function Ke(e){return void 0===e&&(e=0),1===e?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function Ye(e){var t=this;e=e||{},this.g=new $e({locateFile:e.locateFile,files:function(e){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:Ke(e.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(e){return Ce(t,(function t(){var r,n,i,a=this;return S(t,(function(t){return 1==t.g?(r=Ke(e),n="third_party/mediapipe/modules/selfie_segmentation/"+r,y(t,qe(a.g,r),2)):(i=t.h,a.g.overrideFile(n,i),t.return(!0))}))}))}}}})}(e=$e.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){return Ce(this,(function e(){var t=this;return S(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},e.setOptions=function(e,t){var r=this;if(t=t||this.g.options){for(var n=[],i=[],a={},o=s(Object.keys(e)),c=o.next();!c.done;a={K:a.K,L:a.L},c=o.next()){var l=c.value;l in this.j&&this.j[l]===e[l]||(this.j[l]=e[l],void 0!==(c=t[l])&&(c.onChange&&(a.K=c.onChange,a.L=e[l],n.push(function(e){return function(){return Ce(r,(function t(){var r=this;return S(t,(function(t){if(1==t.g)return y(t,e.K(e.L),2);!0===t.h&&(r.o=!0),t.g=0}))}))}}(a))),c.graphOptionXref&&(l={valueNumber:1===c.type?e[l]:0,valueBoolean:0===c.type&&e[l],valueString:2===c.type?e[l]:""},c=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),c.graphOptionXref),l),i.push(c))))}0===n.length&&0===i.length||(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(n))}},e.initialize=function(){return Ce(this,(function e(){var t=this;return S(e,(function(e){return 1==e.g?y(e,We(t),2):3!=e.g?y(e,Ce(t,(function e(){var t,r,n,i,a,o,c,l,d=this;return S(e,(function(e){if(1==e.g)return d.g.graph&&d.g.graph.url&&d.P===d.g.graph.url?e.return():(d.o=!0,d.g.graph&&d.g.graph.url?(d.P=d.g.graph.url,y(e,qe(d,d.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,d.i.loadGraph(t)),r=s(Object.keys(d.B)),n=r.next();!n.done;n=r.next())i=n.value,d.i.overrideFile(i,d.B[i]);if(d.B={},d.g.listeners)for(a=s(d.g.listeners),o=a.next();!o.done;o=a.next())c=o.value,Ze(d,c);l=d.j,d.j={},d.setOptions(l),e.g=0}))})),3):y(e,function(e){return Ce(e,(function e(){var t,r,n,i,a,o,c=this;return S(e,(function(e){switch(e.g){case 1:if(!c.o)return e.return();if(!c.u){e.g=2;break}t=s(c.u),r=t.next();case 3:if(r.done){e.g=5;break}return y(e,(0,r.value)(),4);case 4:r=t.next(),e.g=3;break;case 5:c.u=void 0;case 2:if(c.A){for(n=new c.h.GraphOptionChangeRequestList,i=s(c.A),a=i.next();!a.done;a=i.next())o=a.value,n.push_back(o);c.i.changeOptions(n),n.delete(),c.A=void 0}c.o=!1,e.g=0}}))}))}(t),0)}))}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},e.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){return Ce(this,(function r(){var n,i,a,o,c,l,d,u,p,h=this;return S(r,(function(r){switch(r.g){case 1:return h.g.inputs?(n=1e3*(null==t?performance.now():t),y(r,h.C,2)):r.return();case 2:return y(r,h.initialize(),3);case 3:for(i=new h.h.PacketDataList,a=s(Object.keys(e)),o=a.next();!o.done;o=a.next())if(c=o.value,l=h.g.inputs[c]){e:{var f=h,m=e[c];switch(l.type){case"video":var g=f.m[l.stream];if(g||(g=new Be(f.h,f.D),f.m[l.stream]=g),0===(f=g).l&&(f.l=f.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&m instanceof HTMLVideoElement){var v=m.videoWidth;g=m.videoHeight}else"undefined"!=typeof HTMLImageElement&&m instanceof HTMLImageElement?(v=m.naturalWidth,g=m.naturalHeight):(v=m.width,g=m.height);g={glName:f.l,width:v,height:g},(v=f.g).canvas.width=g.width,v.canvas.height=g.height,v.activeTexture(v.TEXTURE0),f.h.bindTexture2d(f.l),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,m),f.h.bindTexture2d(0),f=g;break e;case"detections":for((g=f.m[l.stream])||(g=new ze(f.h),f.m[l.stream]=g),(f=g).data||(f.data=new f.g.DetectionListData),f.data.reset(m.length),g=0;g<m.length;++g){v=m[g];var b=f.data,w=b.setBoundingBox,x=g,_=v.T,S=new Le;ve(S,1,_.Z),ve(S,2,_.$),ve(S,3,_.height),ve(S,4,_.width),ve(S,5,_.rotation),ve(S,6,_.X);var k=_=new ee;ne(k,1,fe(S,1)),ne(k,2,fe(S,2)),ne(k,3,fe(S,3)),ne(k,4,fe(S,4)),ne(k,5,fe(S,5));var C=fe(S,6);if(null!=C&&null!=C){Z(k.g,48);var E=k.g,R=C;C=0>R;var P=(R=Math.abs(R))>>>0;for(R=Math.floor((R-P)/4294967296),R>>>=0,C&&(R=~R>>>0,4294967295<(P=1+(~P>>>0))&&(P=0,4294967295<++R&&(R=0))),C=U=P,P=R;0<P||127<C;)E.push(127&C|128),C=(C>>>7|P<<25)>>>0,P>>>=7;E.push(C)}if(Se(S,k),_=re(_),w.call(b,x,_),v.O)for(b=0;b<v.O.length;++b)k=!!(S=v.O[b]).visibility,x=(w=f.data).addNormalizedLandmark,_=g,S=Object.assign(Object.assign({},S),{visibility:k?S.visibility:0}),ve(k=new je,1,S.x),ve(k,2,S.y),ve(k,3,S.z),S.visibility&&ve(k,4,S.visibility),ne(E=S=new ee,1,fe(k,1)),ne(E,2,fe(k,2)),ne(E,3,fe(k,3)),ne(E,4,fe(k,4)),ne(E,5,fe(k,5)),Se(k,E),S=re(S),x.call(w,_,S);if(v.M)for(b=0;b<v.M.length;++b){if(x=(w=f.data).addClassification,_=g,S=v.M[b],ve(k=new Ee,2,S.Y),S.index&&ve(k,1,S.index),S.label&&ve(k,3,S.label),S.displayName&&ve(k,4,S.displayName),E=S=new ee,null!=(P=fe(k,1))&&null!=P)if(Z(E.g,8),C=E.g,0<=P)Z(C,P);else{for(R=0;9>R;R++)C.push(127&P|128),P>>=7;C.push(1)}ne(E,2,fe(k,2)),null!=(C=fe(k,3))&&(C=M(C),Z(E.g,26),Z(E.g,C.length),te(E,E.g.end()),te(E,C)),null!=(C=fe(k,4))&&(C=M(C),Z(E.g,34),Z(E.g,C.length),te(E,E.g.end()),te(E,C)),Se(k,E),S=re(S),x.call(w,_,S)}}f=f.data;break e;default:f={}}}switch(d=f,u=l.stream,l.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},d),{stream:u,timestamp:n}));break;case"detections":(p=d).stream=u,p.timestamp=n,i.pushDetectionList(p);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return h.i.send(i),y(r,h.C,4);case 4:i.delete(),r.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},E("Solution",$e),E("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(e=Ye.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Ce(this,(function e(){var t=this;return S(e,(function(e){return y(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Ce(this,(function t(){var r=this;return S(t,(function(t){return y(t,r.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},E("SelfieSegmentation",Ye),E("VERSION","0.1.1632777926")}).call(Lo);const Do=new po("MediaPipe");let Ao=!1;const No=new Lo.SelfieSegmentation({locateFile:(e,t)=>(Do.debug("selfieSegmentation",e,t),`https://stream-assets.snapcall.io/mediapipe/${e}`)});var Bo,Fo,zo,Uo;Fo=function(e,t,r){if(t===self.location.origin)return e;var n=r?"import "+JSON.stringify(e)+";":"importScripts("+JSON.stringify(e)+");";return URL.createObjectURL(new Blob([n],{type:"application/javascript"}))};var Vo={};function Ho(e){return(""+e).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/.+)\/[^/]+$/,"$1")+"/"}zo=function(e){var t=Vo[e];return t||(t=function(){try{throw new Error}catch(t){var e=(""+t.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^)\n]+/g);if(e)return Ho(e[2])}return"/"}(),Vo[e]=t),t},Uo=function(e){var t=(""+e).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\/\/[^/]+/);if(!t)throw new Error("Origin not found");return t[0]};let $o=zo("adfgW")+a("juxiN").resolve("5WDBY");Bo=Fo($o,Uo($o),!1);class Wo{fillColor="#000000";type="blur";live=!1;fps=24;blurLevel=10;timerWorker=new Worker(Bo,{name:"VirtualBackgroundTimerWorker"});constructor(e,t){this.stream=e,this.image=document.createElement("video"),this.image.style.display="none",this.image.setAttribute("autoplay",""),this.image.setAttribute("playsinline",""),this.image.setAttribute("muted",""),this.canvas=document.createElement("canvas"),this.canvas.style.display="none",t&&this.setOptions(t)}setOptions(e){this.setType(e.type),this.setFillColor(e.fillColor||this.fillColor),this.setVideoBackground(e.background),this.setBlurLevel(e.blurLevel||this.blurLevel)}setType(e){this.type=e}setBlurLevel(e){this.blurLevel=e}setVideoBackground(e){this.background=e}setFillColor(e){this.fillColor=e}drawWithBlur(e,t){e.save(),e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.filter=`blur(${this.blurLevel}px)`,e.globalCompositeOperation="destination-over",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}drawWithBackground(e,t){e.clearRect(0,0,this.canvas.width,this.canvas.height),e.drawImage(t.segmentationMask,0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="source-out",e.fillStyle=this.fillColor,this.background?e.drawImage(this.background,0,0,this.canvas.width,this.canvas.height):e.fillRect(0,0,this.canvas.width,this.canvas.height),e.globalCompositeOperation="destination-atop",e.drawImage(t.image,0,0,this.canvas.width,this.canvas.height),e.restore()}onFrame(e){this.canvas.width=e.image.width,this.canvas.height=e.image.height;const t=this.canvas.getContext("2d");if(t)switch(this.type){case"blur":default:this.drawWithBlur(t,e);break;case"background":this.drawWithBackground(t,e)}}runWithFrameCallback(){this.live&&this.image.requestVideoFrameCallback((()=>{No.send({image:this.image}),this.runWithFrameCallback()}))}async createStream(){try{const e={selfieMode:!1,modelSelection:0};No.setOptions(e),Do.log("selfie segmentation initialized"),Ao||(await No.initialize(),Ao=!0),this.image.srcObject=this.stream,this.image.onplay=async()=>{this.live=!0;try{No.onResults((e=>{this.onFrame(e)})),this.timerWorker.onmessage=()=>{No.send({image:this.image})},this.timerWorker.postMessage({action:"start",params:this.fps})}catch(e){Do.error("createStream:play",e)}}}catch(e){console.error("createStream",e)}return this.canvas.captureStream()}clean(){return new Promise((e=>{this.live=!1,clearInterval(this.runInterval),this.image.srcObject=null,this.stream.getTracks().forEach((e=>{e.stop(),this.stream.removeTrack(e)})),this.timerWorker.terminate(),e()}))}}const qo=new po("StreamerClient"),Go="WRTC1",Zo="WRTC2",Ko="TRANS1",Yo="CONS1",Qo="SOCK1",Jo="USERLIMIT",Xo={qvga:{width:{ideal:320},height:{ideal:240},qualityIndex:3},vga:{width:{ideal:640},height:{ideal:480},qualityIndex:2},hd:{width:{ideal:1280},height:{ideal:720},qualityIndex:1}};class es extends CustomEvent{constructor(e,t){super(e,t)}}const ts=EventTarget,rs={background:void 0,fillColor:"#ffffff",type:"blur",blurLevel:10};const ns=new class extends ts{mediasoupTransport={};mediaPipeOption=rs;useVideoBackground=!1;pendingDeviceRequest={};joinOptions={};devicesList=[];constructor(){super(),navigator.mediaDevices.addEventListener("devicechange",(()=>this.onDeviceChange())),this.config={apiUrl:String("https://api.snapcall.io/v2"),streamerServer:String("wss://g.snapcall.io/stream"),streamerApi:String("https://g.snapcall.io/stream"),iceServers:[{urls:"turns:t.snapcall.io:443?transport=tcp,turns:t2.snapcall.io:443?transport=tcp,turn:t.snapcall.io:80?transport=tcp,turn:t2.snapcall.io:80?transport=tcp,turn:t.snapcall.io:80?transport=udp,turn:t2.snapcall.io:80?transport=udp"?.split(",")||[],username:"test",credential:"test",credentialType:"password"}]},this.peers=new Map,this.consumers=new Map,this.webcams=new Map,this.webcam={device:null,resolution:"hd"},this.webcamTrack=null,this.webcamZoom={available:!1,min:0,max:0},this.muted=!1,this.roomId="",this.peerId="",this.webcamProducer=null,this.screenshareProducer=null,this.customMessages=new Map,this.audioRenderers={},this.profile={}}getState(){const e=[];return this.peers.forEach(((t,r)=>{const n={microphone:{enabled:!1,muted:!1},camera:{enabled:!1},screenshare:{enabled:!1}};t.producersData.forEach((e=>{"microphone"===e.deviceType?(n.microphone.enabled=!0,n.microphone.muted=e.paused):"screen"===e.deviceType?n.screenshare.enabled=!0:"webcam"===e.deviceType&&(n.camera.enabled=!0)})),e.push({peerId:r,profile:t.profile,deviceState:n})})),{roomId:this.roomId,peerId:this.peerId,profile:this.profile,callId:void 0,deviceState:this.getDevicesState(),peers:e}}onStartSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new es("localStartSpeak",{cancelable:!0,bubbles:!0,detail:{}});this.dispatchEvent(e),this.protoo.notify("startSpeak")}}onStopSpeak(){if(this.micProducer&&!this.micProducer.paused){const e=new es("localStopSpeak",{detail:{}});this.dispatchEvent(e),this.protoo.notify("stopSpeak")}}onCriticalError(e){const t=new es("criticalError",{detail:{code:e}});this.dispatchEvent(t)}async generateToken(e){const t=this.config.streamerApi,{token:r}=await fetch(`${t}/stream`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({bid:e})}).then((e=>e.json()));return r}async init(e=this.roomId,t=this.joinOptions){if(this.roomId=e,this.joinOptions=t,!this.roomId)throw new Error("Missing room ID");let r;this.peerId||(this.peerId=Yi());try{const{instanceId:t}=await fetch(`${this.config.streamerApi}/instance/${this.roomId}`,{method:"get",headers:{"Content-Type":"application/json"}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid room ID")}));r=`${this.config.streamerServer}/${t}/?roomId=${e}&peerId=${this.peerId}`}catch(e){const t=new es("invalidRoom",{detail:{}});this.dispatchEvent(t)}if(!r)throw new Error("Invalid socket URL");this.protooTransport=new Zi(r,{retry:{retries:0}}),this.protoo=new Gi(this.protooTransport),this.protoo.on("open",(()=>{this.joinRoom()})),this.protoo.on("failed",(()=>{qo.error("protoo.on","failed"),this.onCriticalError(Qo)})),this.protoo.on("disconnected",(()=>{qo.error("protoo.on","disconnected"),this.onCriticalError(Qo)})),this.protoo.on("close",(()=>qo.log("protoo.on","close :("))),this.protoo.on("notification",(async e=>{if(qo.log("notification",e),"error"===e.method)"reached user limit"===e.data?.reason&&this.onCriticalError(Jo);else if("newPeer"===e.method){const{id:t,profile:r}=e.data;this.peers.set(t,{id:t,peerId:t,profile:r,producersData:[]});const n=new es("newPeer",{detail:{peerId:t,displayName:r.name,profile:r}});this.dispatchEvent(n)}else if("newProducer"===e.method){const{peerId:t,producerId:r,deviceType:n,paused:i}=e.data;await this.consumeProducer({peerId:t,producerId:r,deviceType:n,paused:i})}else if("peerClosed"===e.method){const{peerId:t,relatedConsumers:r}=e.data;this.peers.delete(t),r.forEach((e=>{this.onConsumerClose({consumerId:e.id})}));const n=new es("peerClosed",{detail:{peerId:t}});this.dispatchEvent(n)}else if("consumerClosed"===e.method){const{consumerId:t}=e.data;this.onConsumerClose({consumerId:t})}else if("displayName"===e.method){const{peerId:t,displayName:r}=e.data,n=new es("displayName",{detail:{peerId:t,displayName:r,profile:{}}});this.dispatchEvent(n)}else if("profile"===e.method){const{peerId:t,profile:r}=e.data,n=new CustomEvent("profileUpdate",{detail:{peerId:t,profile:r}});this.dispatchEvent(n)}else if("requestDevice"===e.method){this.pendingDeviceRequest[e.data.requestId]=e.data;const t=new es("requestDevice",{detail:e.data});this.dispatchEvent(t)}else if("startSpeak"===e.method);else if("stopSpeak"===e.method);else if("producerPaused"===e.method||"producerResumed"===e.method){const{peerId:t,producerId:r,deviceType:n}=e.data;if("microphone"===e.data?.deviceType){const n=this.peers.get(t)?.producersData.find((e=>r===e.producerId));n&&(n.paused="producerPaused"===e.method)}let i=r;for(let[,e]of Array.from(this.consumers.entries()))if(e.mediaSoupConsumer.producerId===r){i=e.mediaSoupConsumer.id;break}const a="producerPaused"===e.method?"mediaPause":"mediaResume",o=new es(a,{detail:{mediaId:i,peerId:t,deviceType:n,paused:"producerPaused"===e.method}});this.dispatchEvent(o)}else if("requestDeviceResult"===e.method){const t=new es(e.method,{detail:e.data});this.dispatchEvent(t)}else if("terminateRoom"===e.method){this.release();const t=new es(e.method,{detail:e.data});this.dispatchEvent(t)}else if("customMessage"===e.method){const{messageId:t,chunk:r,chunkIndex:n,totalChunks:i}=e.data.event,a=this.customMessages.get(t);a?a.chunks.push({index:n,data:r}):this.customMessages.set(t,{chunks:[{index:n,data:r}],totalChunks:i});const o=this.customMessages.get(t);if(o&&o.totalChunks===o.chunks.length){const r=o.chunks.sort(((e,t)=>e.index-t.index)).reduce(((e,t)=>e+t.data),""),n=JSON.parse(r),i=new es("customMessage",{detail:{...e.data,event:n}});this.dispatchEvent(i),this.customMessages.delete(t)}}}))}closeWebrtcTransport(e){const t=this.mediasoupTransport[e];t&&(t?.transport?.close(),clearTimeout(t?.disconnectTimeout),delete this.mediasoupTransport[e])}async getTransport(e,t){if(!this.streamerMediasoup)throw new Error("streamerMediasoup not initialized");let r=this.mediasoupTransport[`${e}-${t}`];if(r)return r&&r.transport?r.transport:r.createPromise;try{const n=this.streamerMediasoup.createTransport(this.protoo,t);r={disconnectTimeout:void 0,kind:e,createPromise:n},this.mediasoupTransport[`${e}-${t}`]=r,r.transport=await n,r.transport&&this.listenWebRTCTransportStates(r)}catch(e){throw this.onCriticalError(Ko),e}return r.transport}listenWebRTCTransportStates(e){if(!e.transport)throw new Error("can not listen states of undefined transport");e.transport.on("connectionstatechange",(t=>{if(e.transport&&!e.transport.closed)if(qo.log("recv connectionstatechange: ",t),"disconnected"===t)e.disconnectTimeout=setTimeout((()=>{qo.log("listenWebRTCTransportStats",`trying to restart transport for ${e.kind}`),e.transport&&this.restartIce(e.transport)}),5e3);else if("connected"===t)clearTimeout(e.disconnectTimeout);else if("failed"===t){const t=new Error(`webRTC transport state failed for ${e.kind}`);to(t,{extra:{direction:e.transport?.direction,id:e.transport?.id,kind:e.kind}}),qo.error("listenWebRTCTransportStats","webrtc stat failed",t),this.onCriticalError(Go)}}))}async joinRoom(){this.streamerMediasoup=await Io.create(this.protoo,this.config);const{apiKey:e,email:t}=this.joinOptions;if(e)try{let r=null;e&&t?r=await this.fetchAgentInfo({apiKey:e,email:t}):e&&(r=await this.fetchUserInfo({apiKey:e})),r&&this.dispatchEvent(new es("agentIdentity",{detail:{success:!0,email:this.joinOptions.email}}))}catch(e){qo.warn("joinRoom",e),this.dispatchEvent(new es("agentIdentity",{detail:{success:!1}}))}const{peers:r}=await this.protoo.request("getRoomPeers",{apiKey:e,email:t});this.peers=new Map(r.map((e=>[e.id||e.peerId,{...e,peerId:e.id||e.peerId}])));const n=await this.getCallId();this.dispatchEvent(new es("enterRoom",{detail:{peerId:this.peerId,peers:r.map((e=>({...e,peerId:e.id||e.peerId}))),callId:n}})),qo.log("joinRoom","peers",r),this.joinOptions.displayName&&await this.setDisplayName(this.joinOptions.displayName),this.joinOptions.profile&&await this.setProfile(this.joinOptions.profile),r.forEach((e=>{this.consumePeer({peerId:e.id||e.peerId,producersData:e.producersData})}))}async switchMicrophone(e){try{qo.log("switchMicrophone","switching Microphone"),this.audioLevel?.release(),this.audioLevel=void 0,this.micProducer&&this.micProducer.track&&(this.micProducer?.track?.stop(),qo.log("switchMicrophone","stopping previous track"));const t=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{deviceId:e,noiseSuppression:!0,echoCancellation:!0}}));this.audioLevel=new mo(t,this);const r=t.getAudioTracks()[0];await(this.micProducer?.replaceTrack({track:r})),qo.log("switchMicrophone","switched Microphone")}catch(e){qo.error("switchMicrophone error",e),await this.closeMicrophoneProducer()}}async closeMicrophoneProducer(){const e=this.micProducer?.id;this.micProducer?.close(),this.micProducer=void 0;const t=new es("microphoneMute",{detail:{}});this.dispatchEvent(t),await this.protoo.request("closeProducer",{producerId:e})}async onDeviceChange(){qo.log("onDeviceChange","detecting device change");const e=new es("devicesListChange",{detail:{}});if(this.dispatchEvent(e),!this.protoo.closed&&this.micProducer){const e=await navigator.mediaDevices.enumerateDevices(),t=e.filter((e=>"audioinput"===e.kind));if(0===t.length)return qo.warn("onDeviceChange","no audio input device"),void await this.closeMicrophoneProducer();const r=t.find((e=>"default"===e.deviceId));if(r){const t=e.filter((e=>!Boolean(this.devicesList.find((t=>t.deviceId===e.deviceId&&t.label===e.label)))));qo.log("onDeviceChange",t),this.devicesList=e;const n=Boolean(t.find((e=>"audioinput"===e.kind)));if(0!==t.length&&!1===n)return void qo.warn("onDeviceChange","no audio input change");if(qo.log("onDeviceChange","detecting audio input change"),!this.audioInputDefaultDevice||this.audioInputDefaultDevice.label!==r.label){const e=new es("defaultAudioDeviceChange",{detail:r});this.audioInputDefaultDevice=r,this.dispatchEvent(e),qo.log("onDeviceChange","new default audio input trying to switch new :",r.deviceId,r.label)}this.switchMicrophone("default")}else this.switchMicrophone()}}async enableMicrophone(){if(!this.micProducer||this.micProducer?.closed){const e=await this.handleGetUserMediaError("microphone",navigator.mediaDevices.getUserMedia({audio:{noiseSuppression:!0,echoCancellation:!0}}));this.devicesList=await navigator.mediaDevices.enumerateDevices();const t=await this.getTransport("audio","send");this.audioLevel=new mo(e,this);const r=e.getAudioTracks()[0],n="microphone",i=await t.produce({track:r,codecOptions:{opusStereo:!0,opusDtx:!0},appData:{deviceType:n}});i.on("transportclose",(()=>{qo.log("enableMicrophone","micproducer transportclose")})),r.addEventListener("ended",(()=>{qo.log("enableMicrophone","track ended!")})),i.on("trackended",(async()=>{qo.log("enableMicrophone","microphone disconnected!"),void 0===navigator.mediaDevices.ondevicechange&&this.closeMicrophoneProducer()})),this.micProducer=i,this.muted=!1;const a=new es("microphoneEnabled",{detail:{}});this.dispatchEvent(a)}}async muteMicrophone(){if(this.micProducer){this.onStopSpeak(),this.micProducer?.pause(),await this.protoo.request("pauseProducer",{producerId:this.micProducer?.id}),this.muted=!0;const e=new es("microphoneMute",{detail:{}});this.dispatchEvent(e)}}async unMuteMicrophone(){if(this.micProducer){this.micProducer.resume(),this.resolvePendingDeviceRequest("microphone",!0),await this.protoo.request("resumeProducer",{producerId:this.micProducer.id}),this.muted=!1;const e=new es("microphoneUnmute",{detail:{}});this.dispatchEvent(e)}}async toggleMute(){return this.muted?(await this.unMuteMicrophone(),{muted:!1}):(await this.muteMicrophone(),{muted:!0})}release(){qo.log("release");for(let e in this.mediasoupTransport)this.closeWebrtcTransport(e);this.mediaPipe&&(this.mediaPipe.clean(),this.mediaPipe=void 0),this.webcamTrack?.stop(),this.webcamTrack=null,this.protooTransport.close(),this.protoo.close(),this.micProducer?.close(),this.screenshareProducer?.close(),this.webcamProducer?.close(),this.consumers.forEach((e=>{e.mediaSoupConsumer.close()})),this.consumers.clear(),this.audioLevel?.release()}endCall(){this.release();const e=new es("leaveRoom",{detail:{}});this.dispatchEvent(e);const t=new CustomEvent("snapcallEvent_callEnd");window.dispatchEvent(t)}terminateRoom(){this.protoo.request("terminateRoom")}async updateWebcams(){this.webcams=new Map;const e=await navigator.mediaDevices.enumerateDevices();for(const t of e)"videoinput"===t.kind&&this.webcams.set(t.deviceId,t);0===this.webcams.size?this.webcam.device=null:this.webcam.device||(this.webcam.device=this.webcams.values().next().value);const t=new es("webcamsUpdate",{detail:{numberOfAvailableWebcams:this.webcams.size}});this.dispatchEvent(t)}isVideoZoomAvailable(){return this.webcamZoom.available}resolvePendingDeviceRequest(e,t,r){Object.keys(this.pendingDeviceRequest).forEach((n=>{const i=this.pendingDeviceRequest[n];e===i.deviceType&&(delete this.pendingDeviceRequest[n],this.protoo.notify("requestDeviceResult",{result:Boolean(t),failure:r,...i}))}))}async handleGetUserMediaError(e,t){let r,n;try{r=await t}catch(e){n=e}finally{if(this.resolvePendingDeviceRequest(e,Boolean(r),n?.name),n)throw n;return r}}async restartIce(e){if(qo.log("restartIce",e.connectionState,e.closed),"disconnected"===e.connectionState&&!e.closed)try{const t=await this.protoo.request("restartIce",{transportId:e.id});qo.log("restartIce",t),await e.restartIce({iceParameters:t})}catch(t){this.onCriticalError(Zo),qo.log("restartIce","restartIceFailed",t),to(t,{extra:{direction:e.direction,id:e.id}})}}scaleVideoMediasConstraintsParameter(e){let t=Xo.hd;2===e?t=Xo.vga:e>2&&(t=Xo.qvga),(!this.webcam.resolution||Xo[this.webcam.resolution].qualityIndex>=t.qualityIndex)&&(qo.log("scaleVideoMediasConstraintsParameter",`scaling video by ${e}`,t),this.webcamProducer?.track?.applyConstraints(t))}scaleVideoEncodingsParameter(){if(!this.useVideoBackground)try{let e=0;this.consumers.forEach((t=>{"video"===t.mediaSoupConsumer.kind&&e++})),this.screenshareProducer&&!this.screenshareProducer.closed&&e++;let t={scaleResolutionDownBy:1};if(e>=3&&(t={scaleResolutionDownBy:2}),e>=9&&(t={scaleResolutionDownBy:4}),!xo.Producer.prototype.setRtpEncodingParameters)return this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy);this.webcamProducer&&!this.webcamProducer.closed&&(qo.log("scaleVideoEncodingsParameter",`scaling video by ${t.scaleResolutionDownBy}`),this.webcamProducer?.setRtpEncodingParameters?.(t).catch((e=>{qo.error("scaleVideoEncodingsParameter","scaleResolutionDownBy not supported",e),this.scaleVideoMediasConstraintsParameter(t.scaleResolutionDownBy)})))}catch(e){qo.error("scaleVideoEncodingsParameter","scaleVideo error",e)}}setVideoBackground(e){this.mediaPipe?.setOptions(e),this.mediaPipeOption=e}async initVideoBackground(){!0!==this.useVideoBackground&&(this.useVideoBackground=!0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async stopVideoBackground(){!1!==this.useVideoBackground&&(this.useVideoBackground=!1,await(this.mediaPipe?.clean()),this.mediaPipe=void 0,this.webcamProducer&&!this.webcamProducer.closed&&await this.switchWebcam({}))}async switchWebcam({device:e,resolution:t,rotate:r}){if(!this.webcam.device)throw new Error("no webcam devices");if(r){const e=Array.from(this.webcams.keys()),t=this.webcam?.device?.deviceId||"unknow";let r=e.indexOf(t);r<e.length-1?r++:r=0;const n=this.webcams.get(e[r]);if(!n)throw new Error("no webcam device");this.webcam.device=n,this.webcam.resolution="hd"}else e&&(this.webcam.device=e),t&&(this.webcam.resolution=t);let n=Xo[t||this.webcam.resolution];this.useVideoBackground&&(n={width:{ideal:560},height:{ideal:400},qualityIndex:2});const i=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{deviceId:{ideal:this.webcam.device.deviceId},...n}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Wo(i,this.mediaPipeOption));const a=await(this.mediaPipe?.createStream())||i;if(!await this.getTransport("video","send"))throw new Error("video transport not found, can not switch");const o=a.getVideoTracks()[0];await(this.webcamProducer?.replaceTrack?.({track:o}));const s=await(o.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(s?.zoom),min:s?.zoom?.min||0,max:s?.zoom?.max||0};const c=new es("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(c)}async enableVideo(e){if(await this.updateWebcams(),e?.device&&(this.webcam.device=e.device),!this.webcam.device)throw new Error("no webcam devices");let t=Xo[e?.resolution||this.webcam.resolution];this.useVideoBackground&&(t={width:{ideal:560},height:{ideal:400},qualityIndex:2});const r=await this.handleGetUserMediaError("webcam",navigator.mediaDevices.getUserMedia({video:{deviceId:{ideal:this.webcam.device.deviceId},...t}}));this.useVideoBackground&&(this.mediaPipe&&await this.mediaPipe.clean(),this.mediaPipe=new Wo(r,this.mediaPipeOption));const n=await(this.mediaPipe?.createStream())||r;await this.updateWebcams();const i=await this.getTransport("video","send"),a=n.getVideoTracks()[0];this.webcamTrack=a;const o=await(a.getCapabilities?.())||navigator.mediaDevices.getSupportedConstraints?.();this.webcamZoom={available:Boolean(o?.zoom),min:o?.zoom?.min||0,max:o?.zoom?.max||0};this.webcamProducer=await i.produce({track:a,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"webcam"}}),this.scaleVideoEncodingsParameter(),this.webcamProducer.on("transportclose",(()=>{this.webcamProducer=null})),this.webcamProducer.on("trackended",(()=>{this.disableVideo().catch((()=>{}))}));const s=new es("localVideoAvailable",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(s)}async rotateVideo(){await this.switchWebcam({rotate:!0})}async zoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:2*this.webcamZoom.min}]})}async unzoomVideo(){if(!this.webcamZoom.available)throw new Error("Webcam zoom is not available");if(!this.webcamTrack)throw new Error("No webcam track available");this.webcamTrack.applyConstraints({advanced:[{zoom:this.webcamZoom.min}]})}async disableVideo(){if(!this.webcamProducer)return;this.webcamProducer.close(),await this.protoo.request("closeProducer",{producerId:this.webcamProducer.id}),this.webcamProducer=null;const e=new es("localVideoUnavailable",{detail:{}});this.dispatchEvent(e)}async enableScreenshare(){const e=await this.handleGetUserMediaError("screen",navigator.mediaDevices.getDisplayMedia({audio:!1,video:{displaySurface:"monitor",logicalSurface:!0,width:{max:1920},height:{max:1080},frameRate:{max:30}}}));if(!e)return;const t=await this.getTransport("video","send"),r=e.getVideoTracks()[0];this.screenshareProducer=await t.produce({track:r,encodings:undefined,codecOptions:{videoGoogleStartBitrate:1e3},appData:{deviceType:"screen",share:!0}}),this.screenshareProducer.on("transportclose",(()=>{this.screenshareProducer=null})),this.screenshareProducer.on("trackended",(()=>{this.disableScreenshare().catch((()=>{}))}));const n=new es("screenshareEnabled",{detail:{}});this.dispatchEvent(n)}async disableScreenshare(){this.screenshareProducer&&(this.screenshareProducer.close(),await this.protoo.request("closeProducer",{producerId:this.screenshareProducer.id}),this.screenshareProducer=null);const e=new es("screenshareDisabled",{detail:{}});this.dispatchEvent(e)}onConsumerClose({consumerId:e}){const t=this.consumers.get(e);if(t){const r=t.mediaSoupConsumer.producerId;this.peers.forEach((e=>{const t=e.producersData.findIndex((e=>e.producerId===r));-1!==t&&e.producersData.splice(t,1)})),t.mediaSoupConsumer.close(),this.consumers.delete(e),this.scaleVideoEncodingsParameter();const n=new es("mediaStop",{detail:{mediaId:e,peerId:String(t.mediaSoupConsumer.appData.peerId),deviceType:t.deviceType,paused:!1}});"microphone"===t.deviceType&&this.deleteAudioRenderer(e),this.dispatchEvent(n)}}requestVideo({mediaId:e,element:t}){qo.info("requestVideo");const r=this.consumers.get(e);if(r){const e=new MediaStream;e.onremovetrack=()=>qo.log("requestVideo","Remove Track"),r.mediaSoupConsumer.track.onended=()=>qo.log("requestVideo","Track Ended"),e.addTrack(r.mediaSoupConsumer.track),t.srcObject=e}else qo.error("requestVideo",`Video consumer ${r} not found`)}async captureVideo(e){let t;if(e)t=await bo(e);else{if(!this.webcamProducer||!this.webcamProducer.track)throw new Error("no video to capture");t=await wo(this.webcamProducer.track)}return t}requestLocalVideo(e){if(qo.info("requestLocalVideo"),this.webcamProducer){const t=new MediaStream;t.addTrack(this.webcamProducer.track),e.srcObject=t;const r=this.webcamProducer.track?.getSettings();return{facingMode:r?.facingMode||"user"}}throw new Error("webcam producer not available yet")}requestLocalScreenshare(e){if(this.screenshareProducer){const t=new MediaStream;t.addTrack(this.screenshareProducer.track),e.srcObject=t}else qo.log("requestLocalScreenshare","screenshare producer not available yet")}consumePeer({peerId:e,producersData:t}){t.forEach((t=>{this.consumeProducer({peerId:e,producerId:t.producerId,deviceType:t.deviceType,paused:t.paused})}))}async consumeProducer({peerId:e,producerId:t,deviceType:r,paused:n}){const i="microphone"===r?"audio":"video",a=await this.getTransport(i,"recv"),o=await this.protoo.request("consume",{peerId:e,producerId:t,transportId:a.id,rtpCapabilities:this.streamerMediasoup.getRtpCapabilities()}),s=this.peers.get(e);s&&s.producersData.push({producerId:t,deviceType:r,paused:n});const{producerId:c,id:l,kind:d,rtpParameters:u,appData:p}=o;qo.log("consumeProducer","Data: ",o);try{const t=await a.consume({id:l,producerId:c,kind:d,rtpParameters:u,appData:{...p,peerId:e}});qo.log("transport",a),qo.log("consumer",t),this.consumers.set(t.id,{mediaSoupConsumer:t,deviceType:r}),this.scaleVideoEncodingsParameter();const i=new es("mediaStart",{detail:{peerId:e,mediaId:t.id,deviceType:r,paused:n}});if(this.dispatchEvent(i),"audio"===t.kind){const e=this.createAudioRenderer(t.id),r=new MediaStream;r.addTrack(t.track),e.setSource(r),e.play()}"video"===t.kind&&await this.protoo.request("resumeConsumer",{consumerId:t.id})}catch(e){throw this.onCriticalError(Yo),qo.error("consumeProducer","newConsumer request failed",e),e}}async setDisplayName(e){await this.setProfile({name:e});const t=new es("selfDisplayName",{detail:{peerId:this.peerId,displayName:this.profile?.name,profile:this.profile}});this.dispatchEvent(t)}async setProfile(e){const t=await this.protoo.request("setProfile",e);this.profile={...t};const r=new es("selfProfileUpdate",{detail:{peerId:this.peerId,profile:this.profile}});this.dispatchEvent(r)}async requestPeerDevice(e,t){return this.protoo.request("requestPeerDevice",{remotePeerId:e,deviceType:t})}denyDeviceRequest(e){this.resolvePendingDeviceRequest(e,!1,"user denied permission")}async getCallId(){try{const{callId:e}=await this.protoo.request("getCallId");return e}catch(e){throw qo.error("getCallId","Failed to get callId"),e}}getConsumers(){return this.consumers}getDevicesState(){const e=!!this.micProducer&&!this.micProducer.closed,t=!!this.webcamProducer&&!this.webcamProducer.closed,r=!!this.screenshareProducer&&!this.screenshareProducer.closed;return{microphone:{enabled:e,muted:this.muted},camera:{enabled:t},screenshare:{enabled:r}}}getCustomMessageEventChunks(e){const t=JSON.stringify(e),r=[];for(let e=0;e<t.length;e+=9e4)r.push(t.substring(e,e+9e4));return r}async sendCustomMessageToAll(e){const t=Yi(),r=this.getCustomMessageEventChunks(e),n=r.map(((e,n)=>this.protoo.notify("customMessageToAllPeers",{messageId:t,chunkIndex:n,chunk:e,totalChunks:r.length})));await Promise.all(n)}async sendCustomMessage(e,t){const r=Yi(),n=this.getCustomMessageEventChunks(t),i=n.map(((t,i)=>this.protoo.notify("customMessageToPeer",{peerId:e,event:{messageId:r,chunkIndex:i,chunk:t,totalChunks:n.length}})));await Promise.all(i)}async listAudioDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter((e=>"audioinput"===e.kind||"audiooutput"===e.kind))}async listVideoDevices(){return(await navigator.mediaDevices.enumerateDevices()).filter((e=>"videoinput"===e.kind))}isListDevicesSupported(){return Boolean(navigator.mediaDevices?.enumerateDevices)}getCurrentWebcam(){return this.webcam}getCurrentMicrophoneId(){return this.micProducer?.track?.getSettings().deviceId}getCurrentSpeakerId(){const e=Object.keys(this.audioRenderers),t=this.audioRenderers[e[0]];if(t){const e=t.getSink();if(e)return e}return"default"}async setWebcamResolution(e){if(this.webcam.device)await this.switchWebcam({resolution:e});else{this.webcam.resolution=e;const t=new es("localVideoChange",{detail:{camera:this.getCurrentWebcam()}});this.dispatchEvent(t)}}createAudioRenderer(e){const t=new vo({consumerId:e});return this.audioRenderers[e]=t,t}deleteAudioRenderer(e){this.audioRenderers[e]?.destroy(),delete this.audioRenderers[e]}async playAudioRenderer(e){await(this.audioRenderers[e]?.play())}async setAudioSink(e){const t=Object.keys(this.audioRenderers).map((t=>this.audioRenderers[t].setSink(e).catch((e=>qo.warn("setAudioSink","Failed to setSinkId on renderer (consumerId: %s): ",t,e)))));await Promise.allSettled(t)}dispatchEvent(e){const t=super.dispatchEvent(e);return window.dispatchEvent(e),t}async fetchAgentInfo({apiKey:e,email:t}){const r=this.config.apiUrl;return await fetch(`${r}/agents/${t}`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid agent info")}))}async fetchUserInfo({apiKey:e}){const t=this.config.apiUrl;return await fetch(`${t}/users/me`,{method:"get",headers:{Authorization:`Bearer ${e}`}}).then((e=>{if(e.ok)return e.json();throw new Error("Invalid user info")}))}setConfig(e){this.config={...this.config,...e}}};var is=(0,(Ie=a("85Hg2")).createContext)({});Ie=a("85Hg2");let as;var os;(os=as||(as={}))[os.SET_STREAMS=0]="SET_STREAMS",os[os.ADD_STREAM=1]="ADD_STREAM",os[os.REMOVE_STREAM=2]="REMOVE_STREAM",os[os.DEVICE_UPDATE=3]="DEVICE_UPDATE",os[os.MUTE=4]="MUTE",os[os.UNMUTE=5]="UNMUTE",os[os.SET_HIGHLIGHTED_TILE=6]="SET_HIGHLIGHTED_TILE",os[os.UNSET_HIGHLIGHTED_TILE=7]="UNSET_HIGHLIGHTED_TILE",os[os.SET_STREAM_PROFILE=8]="SET_STREAM_PROFILE",os[os.SET_STREAM_SPEAKING=9]="SET_STREAM_SPEAKING";const ss={streams:[],highlightedTile:null},cs=(e,t)=>{switch(t.type){case as.SET_STREAMS:return{...e,streams:t.payload};case as.ADD_STREAM:return e.streams.find((e=>e.id===t.payload.id))?e:{...e,streams:[...e.streams,t.payload]};case as.REMOVE_STREAM:return{...e,streams:[...e.streams.filter((e=>e.id!==t.payload.id))]};case as.DEVICE_UPDATE:{const{streamId:r,mediaId:n,device:i,available:a,paused:o}=t.payload;return{...e,streams:e.streams.map((e=>{if(e.id===r){let t=e.muted;return"microphone"===i&&(t=o),{...e,[i]:a?n:null,muted:t}}return e}))}}case as.MUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!0}:e))};case as.UNMUTE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,muted:!1}:e))};case as.SET_HIGHLIGHTED_TILE:return{...e,highlightedTile:t.payload};case as.UNSET_HIGHLIGHTED_TILE:return{...e,highlightedTile:null};case as.SET_STREAM_PROFILE:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,profile:t.payload.profile}:e))};case as.SET_STREAM_SPEAKING:return{...e,streams:e.streams.map((e=>e.id===t.payload.streamId?{...e,isSpeaking:t.payload.isSpeaking}:e))};default:return e}},ls=(0,Ie.createContext)(void 0),ds=({children:e})=>{const[t,r]=(0,Ie.useReducer)(cs,ss),n={state:t,dispatch:r};return(0,o.jsx)(ls.Provider,{value:n,children:e})},us=()=>{const e=(0,Ie.useContext)(ls);if(void 0===e)throw new Error("useStreams must be used within a StreamsProvider");return{streams:e.state.streams,highlightedTile:e.state.highlightedTile,dispatch:e.dispatch}};var ps=e=>navigator.clipboard?navigator.clipboard.writeText(e):new Promise(((t,r)=>{((e,t,r)=>{const n=document.createRange(),i=document.createElement("textarea");if(i.value=e,document.body.appendChild(i),navigator.userAgent.match(/ipad|ipod|iphone/i)){i.readOnly=!1,i.contentEditable="true",n.selectNodeContents(i);const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n)),i.setSelectionRange(0,999999)}else i.focus(),i.select();try{document.execCommand("copy")?t():r(new Error("Copy to clipboard fallback failed"))}catch(e){e instanceof Error?r(e):console.error(e)}document.body.removeChild(i)})(e,t,r)}));const hs=yr.path`
|
|
306
306
|
fill: ${e=>e.theme.logoColor};
|
|
307
307
|
stroke: ${e=>e.stroke?e.theme.logoColor:"unset"};
|
|
308
|
-
`,ms=()=>(0,o.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(fs,{d:"M7.82 15.328c.806 0 1.48-.668 1.243-1.438a4.788 4.788 0 0 0-1.143-1.93 4.579 4.579 0 0 0-3.28-1.396c-1.231 0-2.411.502-3.281 1.395a4.788 4.788 0 0 0-1.143 1.93c-.237.771.438 1.44 1.244 1.44h6.36ZM7.513 0C6.706 0 6.03.668 6.269 1.438a4.788 4.788 0 0 0 1.142 1.93 4.58 4.58 0 0 0 3.281 1.396c1.23 0 2.411-.502 3.281-1.395.531-.545.92-1.209 1.143-1.93C15.353.667 14.678 0 13.872 0h-6.36ZM10.692 13.868c0 .807.67 1.482 1.435 1.227a4.622 4.622 0 0 0 1.846-1.162 4.83 4.83 0 0 0 1.36-3.369 4.83 4.83 0 0 0-1.36-3.369 4.62 4.62 0 0 0-1.846-1.162c-.764-.255-1.435.42-1.435 1.227v6.608ZM4.64 1.46c0-.806-.67-1.482-1.435-1.226a4.62 4.62 0 0 0-1.846 1.161A4.83 4.83 0 0 0 0 4.765a4.83 4.83 0 0 0 1.359 3.368 4.62 4.62 0 0 0 1.846 1.162c.765.255 1.435-.42 1.435-1.226v-6.61Z"})}),gs=()=>(0,o.jsx)("svg",{width:"71",height:"17",viewBox:"17 0 71 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(fs,{d:"M27.445 13.543c-1.288 0-2.324-.206-3.107-.618-.773-.422-1.355-.948-1.747-1.576a.327.327 0 0 1 .108-.448l.882-.665a.253.253 0 0 1 .185-.077c.093 0 .18.056.263.17.69 1.112 1.85 1.669 3.477 1.669.712 0 1.314-.129 1.809-.387.505-.257.757-.67.757-1.236 0-.422-.144-.752-.432-.989-.279-.237-.712-.448-1.299-.634-.536-.164-.87-.262-1.005-.293a32.224 32.224 0 0 1-1.916-.603c-.99-.37-1.644-.798-1.963-1.282-.32-.485-.48-.99-.48-1.515 0-.433.135-.896.402-1.39.279-.506.712-.933 1.299-1.283.598-.361 1.345-.541 2.241-.541.938 0 1.726.118 2.365.355.639.227 1.247.608 1.824 1.144.072.072.108.144.108.216 0 .103-.051.186-.155.247l-.989.665a.414.414 0 0 1-.2.077c-.093 0-.181-.046-.263-.139-.619-.66-1.469-.989-2.55-.989-.619 0-1.098.093-1.438.278-.33.186-.551.392-.665.618a1.486 1.486 0 0 0-.154.603c0 .37.144.67.432.896.289.227.716.433 1.283.618.052.021.448.14 1.19.356.464.123.943.263 1.438.417 1.082.36 1.803.82 2.164 1.375.37.557.556 1.093.556 1.608 0 .556-.134 1.087-.402 1.591-.257.505-.716.928-1.375 1.268-.65.33-1.53.494-2.643.494ZM37.403 5.06c.773 0 1.489.226 2.148.679.66.443.99 1.262.99 2.457v4.837c0 .103-.031.186-.093.247-.052.052-.13.078-.232.078H39.21a.374.374 0 0 1-.247-.078.374.374 0 0 1-.077-.247V8.46c-.031-.587-.196-1.051-.495-1.39-.289-.34-.665-.51-1.128-.51-.33 0-.66.092-.99.277-.32.175-.592.448-.819.82-.227.36-.36.813-.402 1.36v4.017c0 .103-.03.186-.092.247-.052.052-.13.078-.232.078h-1.005a.373.373 0 0 1-.247-.078.374.374 0 0 1-.078-.247V5.585c0-.104.026-.18.078-.232a.334.334 0 0 1 .247-.093h1.005c.103 0 .18.03.232.093.061.051.092.128.092.232v.185c0 .072.01.129.031.17.031.03.067.046.108.046.083 0 .191-.056.325-.17a3.58 3.58 0 0 1 .927-.556c.34-.134.66-.2.959-.2ZM49.302 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.432.865c-.083.186-.217.252-.402.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.185-.371-.278-.726-.278-1.066 0-.557.17-1.056.51-1.5.35-.442.87-.752 1.561-.927.474-.113 1.134-.2 1.978-.262.577-.042.995-.083 1.252-.124.206-.03.3-.155.279-.37-.052-.464-.206-.835-.464-1.114-.247-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.164-.051-.247-.139-.247-.262 0-.031.01-.078.031-.14a2.977 2.977 0 0 1 1.221-1.421c.567-.36 1.304-.541 2.21-.541.886 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.061-.061-.144-.082-.247-.061l-.603.061a17.05 17.05 0 0 0-1.638.217 2.807 2.807 0 0 0-1.067.402.898.898 0 0 0-.433.803c0 .423.186.711.557.866.371.154.778.231 1.221.231ZM55.598 5.06c.99 0 1.757.236 2.303.71.547.464.918 1.015 1.113 1.653.196.629.294 1.257.294 1.886 0 .628-.098 1.262-.294 1.9-.195.63-.566 1.18-1.113 1.654-.546.464-1.313.696-2.303.696-.803 0-1.473-.217-2.009-.65-.072-.072-.144-.108-.216-.108-.103 0-.155.088-.155.263v3.245c0 .103-.03.18-.093.232-.051.062-.128.093-.231.093h-.928a.335.335 0 0 1-.247-.093c-.052-.051-.077-.129-.077-.232V5.584c0-.103.025-.18.077-.231a.334.334 0 0 1 .247-.093h.928c.103 0 .18.03.231.093.062.051.093.128.093.232 0 .082.01.149.031.2.031.042.067.062.108.062.052 0 .098-.02.14-.062.545-.484 1.246-.726 2.101-.726Zm-.154 7.077c.793 0 1.375-.273 1.746-.82.382-.545.572-1.215.572-2.008 0-.793-.19-1.463-.572-2.01-.37-.545-.953-.818-1.746-.818-.783 0-1.355.273-1.716.819-.35.536-.525 1.205-.525 2.009 0 .803.175 1.478.525 2.024.36.536.933.804 1.716.804ZM66.122 13.543c-1.174 0-2.19-.253-3.045-.757a4.991 4.991 0 0 1-1.932-2.071c-.433-.886-.649-1.89-.649-3.014 0-1.123.216-2.122.65-2.998a4.97 4.97 0 0 1 1.931-2.086c.856-.505 1.87-.757 3.045-.757 1.113 0 2.077.227 2.89.68a4.896 4.896 0 0 1 1.933 1.9c.03.062.046.12.046.17 0 .114-.077.196-.232.248L69.6 5.15a.342.342 0 0 1-.108.016c-.134 0-.237-.067-.31-.201-.638-1.05-1.658-1.576-3.06-1.576-.865 0-1.582.2-2.148.602a3.541 3.541 0 0 0-1.252 1.592 5.497 5.497 0 0 0-.402 2.117c0 .763.134 1.468.402 2.117a3.555 3.555 0 0 0 1.252 1.577c.566.402 1.283.602 2.148.602.814 0 1.52-.19 2.118-.571.608-.382 1.04-.964 1.298-1.747.072-.195.201-.278.387-.247l1.174.155c.175.03.263.113.263.247a.93.93 0 0 1-.03.154c-.454 1.185-1.114 2.076-1.98 2.674-.855.587-1.931.88-3.23.88ZM79.474 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.433.865c-.082.186-.216.252-.401.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.186-.371-.278-.726-.278-1.066a2.4 2.4 0 0 1 .51-1.5c.35-.442.87-.752 1.56-.927.475-.113 1.134-.2 1.98-.262.576-.042.994-.083 1.251-.124.206-.03.3-.155.278-.37-.051-.464-.206-.835-.463-1.114-.248-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.165-.051-.247-.139-.247-.262 0-.031.01-.078.03-.14a2.979 2.979 0 0 1 1.222-1.421c.567-.36 1.303-.541 2.21-.541.887 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.062-.061-.144-.082-.247-.061l-.603.061c-.67.062-1.216.134-1.638.217a2.808 2.808 0 0 0-1.067.402.898.898 0 0 0-.432.803c0 .423.185.711.556.866.37.154.778.231 1.221.231ZM83.467 13.033c0 .103-.03.185-.092.247-.052.052-.13.077-.232.077h-1.005a.374.374 0 0 1-.247-.077.374.374 0 0 1-.078-.247V2.354c0-.103.026-.18.078-.232a.335.335 0 0 1 .247-.092h1.005c.103 0 .18.03.232.093.061.051.092.128.092.231v10.679ZM87.35 13.033c0 .103-.03.185-.093.247-.051.052-.129.077-.232.077h-1.004a.374.374 0 0 1-.248-.077.374.374 0 0 1-.077-.247V2.354c0-.103.026-.18.078-.232a.334.334 0 0 1 .247-.092h1.004c.103 0 .18.03.232.093.062.051.093.128.093.231v10.679Z",stroke:"#fff",strokeWidth:".5"})});var vs=({size:e="large"})=>"small"===e?(0,o.jsx)(ms,{}):"medium"===e?(0,o.jsx)(gs,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ms,{}),(0,o.jsx)(gs,{})]});const ys=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M19 2H9a3 3 0 0 0-3 3v1H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3Zm-3 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-7h12v7Zm0-9H4V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Zm4 5a1 1 0 0 1-1 1h-1V9a3 3 0 0 0-.18-1H20v7Zm0-9H8V5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Z",fill:"#fff"})}),bs=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M21 8.94a1.307 1.307 0 0 0-.06-.27v-.09a1.07 1.07 0 0 0-.19-.28l-6-6a1.071 1.071 0 0 0-.28-.19.32.32 0 0 0-.09 0 .88.88 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V8.94Zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1V5.41ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5v1Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3v5Z",fill:e||"#fff"})}),ws=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M8 21H4a1 1 0 0 1-1-1v-4a1 1 0 1 0-2 0v4a3 3 0 0 0 3 3h4a1 1 0 0 0 0-2Zm14-6a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 0 0 2h4a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1ZM20 1h-4a1 1 0 1 0 0 2h4a1 1 0 0 1 1 1v4a1 1 0 0 0 2 0V4a3 3 0 0 0-3-3ZM2 9a1 1 0 0 0 1-1V4a1 1 0 0 1 1-1h4a1 1 0 0 0 0-2H4a3 3 0 0 0-3 3v4a1 1 0 0 0 1 1Zm8-4H6a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1ZM9 9H7V7h2v2Zm5 2h4a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1Zm1-4h2v2h-2V7Zm-5 6H6a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-1 4H7v-2h2v2Zm5-1a1 1 0 0 0 1-1 1 1 0 0 0 0-2h-1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1Zm4-3a1 1 0 0 0-1 1v3a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-4 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:e||"#fff"})}),xs=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"m21.32 9.55-1.89-.63.89-1.78A1 1 0 0 0 20.13 6L18 3.87a1 1 0 0 0-1.15-.19l-1.78.89-.63-1.89A1 1 0 0 0 13.5 2h-3a1 1 0 0 0-.95.68l-.63 1.89-1.78-.89A1 1 0 0 0 6 3.87L3.87 6a1 1 0 0 0-.19 1.15l.89 1.78-1.89.63a1 1 0 0 0-.68.94v3a1 1 0 0 0 .68.95l1.89.63-.89 1.78A1 1 0 0 0 3.87 18L6 20.13a1 1 0 0 0 1.15.19l1.78-.89.63 1.89a1 1 0 0 0 .95.68h3a1 1 0 0 0 .95-.68l.63-1.89 1.78.89a1 1 0 0 0 1.13-.19L20.13 18a1 1 0 0 0 .19-1.15l-.89-1.78 1.89-.63a1 1 0 0 0 .68-.94v-3a1 1 0 0 0-.68-.95ZM20 12.78l-1.2.4A2 2 0 0 0 17.64 16l.57 1.14-1.1 1.1-1.11-.6a2 2 0 0 0-2.79 1.16l-.4 1.2h-1.59l-.4-1.2A2 2 0 0 0 8 17.64l-1.14.57-1.1-1.1.6-1.11a2 2 0 0 0-1.16-2.82l-1.2-.4v-1.56l1.2-.4A2 2 0 0 0 6.36 8l-.57-1.11 1.1-1.1L8 6.36a2 2 0 0 0 2.82-1.16l.4-1.2h1.56l.4 1.2A2 2 0 0 0 16 6.36l1.14-.57 1.1 1.1-.6 1.11a2 2 0 0 0 1.16 2.79l1.2.4v1.59ZM12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0 6a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fill:"#fff"})}),_s=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M4 12a1 1 0 0 0 1 1h7.59l-2.3 2.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l4-4a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76 1 1 0 0 0-.21-.33l-4-4a1.003 1.003 0 1 0-1.42 1.42l2.3 2.29H5a1 1 0 0 0-1 1ZM17 2H7a3 3 0 0 0-3 3v3a1 1 0 0 0 2 0V5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-3a1 1 0 1 0-2 0v3a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3Z",fill:"#fff"})}),Ss=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M4.91 13.1a1 1 0 0 0 .85.47A1 1 0 0 0 6.61 12a17 17 0 0 1-2.47-6.85 1 1 0 0 1 .578-1.06A1 1 0 0 1 5.13 4h3a1 1 0 0 1 1 .8c0 .23.08.44.13.67v.13c.116.525.273 1.04.47 1.54l-1.39.66a1 1 0 0 0-.52.57 1 1 0 0 0 0 .77c.1.21.2.42.32.64a1 1 0 0 0 1.755-.028 1 1 0 0 0 .115-.542l.57-.21a2 2 0 0 0 1.05-2.48 9.317 9.317 0 0 1-.39-1.3v-.1c0-.2-.08-.4-.11-.58A3 3 0 0 0 8.16 2h-3a3 3 0 0 0-2.28 1 3 3 0 0 0-.72 2.39 19.05 19.05 0 0 0 2.75 7.71Zm14.61-.21-.6-.11h-.08a9.325 9.325 0 0 1-1.33-.39 2 2 0 0 0-2.47 1l-.21.46a12.392 12.392 0 0 1-1.92-1.37l8.8-8.79a1.004 1.004 0 1 0-1.42-1.42l-18 18a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.59-4.6a19.09 19.09 0 0 0 10.29 4.73c.133.01.267.01.4 0a3 3 0 0 0 2-.75 3 3 0 0 0 1-2.25v-3a3 3 0 0 0-2.47-2.93Zm.48 6a.999.999 0 0 1-.718.96 1 1 0 0 1-.432.03 17.07 17.07 0 0 1-9.14-4.18l1.77-1.77a14.695 14.695 0 0 0 3.38 2.21 1.002 1.002 0 0 0 .77 0 1 1 0 0 0 .57-.52l.62-1.41c.522.194 1.056.35 1.6.47h.11l.69.13a1 1 0 0 1 .78 1v3.08Z",fill:"#D84949"})}),ks=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsxs)("g",{clipPath:"url(#pip)",fill:"#fff",children:[(0,o.jsx)("path",{d:"M0 5v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H3a3 3 0 0 0-3 3Zm17-1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h14Z"}),(0,o.jsx)("path",{d:"M10 14v4.879a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V14a3 3 0 0 0-3-3h-8a3 3 0 0 0-3 3ZM10 11.149c0 .113-.02.226-.06.332a.85.85 0 0 1-.8.519H5.736a.851.851 0 0 1 0-1.702h1.353l-2.792-2.8a.851.851 0 1 1 1.2-1.2l2.8 2.8V7.744a.851.851 0 0 1 1.703 0v3.405Z"})]})}),Cs=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3ZM5 18a1 1 0 0 1-1-1v-2.42l3.3-3.29a1 1 0 0 1 1.4 0L15.41 18H5Zm15-1a1 1 0 0 1-1 1h-.77l-3.81-3.83.88-.88a1 1 0 0 1 1.4 0l3.3 3.29V17Zm0-3.24-1.88-1.87a3.06 3.06 0 0 0-4.24 0l-.88.88-2.88-2.88a3.06 3.06 0 0 0-4.24 0L4 11.76V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v6.76Z",fill:e||"#fff"})});Ie=a("85Hg2"),Ie=a("85Hg2");const Es=(e,t)=>((0,Ie.useEffect)((()=>{const r=r=>{e?.current?.contains(r.target)||t()};if(e?.current)return window.addEventListener("click",r),()=>window.removeEventListener("click",r)}),[e,t]),null),Rs=yr.div`
|
|
308
|
+
`,fs=()=>(0,o.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(hs,{d:"M7.82 15.328c.806 0 1.48-.668 1.243-1.438a4.788 4.788 0 0 0-1.143-1.93 4.579 4.579 0 0 0-3.28-1.396c-1.231 0-2.411.502-3.281 1.395a4.788 4.788 0 0 0-1.143 1.93c-.237.771.438 1.44 1.244 1.44h6.36ZM7.513 0C6.706 0 6.03.668 6.269 1.438a4.788 4.788 0 0 0 1.142 1.93 4.58 4.58 0 0 0 3.281 1.396c1.23 0 2.411-.502 3.281-1.395.531-.545.92-1.209 1.143-1.93C15.353.667 14.678 0 13.872 0h-6.36ZM10.692 13.868c0 .807.67 1.482 1.435 1.227a4.622 4.622 0 0 0 1.846-1.162 4.83 4.83 0 0 0 1.36-3.369 4.83 4.83 0 0 0-1.36-3.369 4.62 4.62 0 0 0-1.846-1.162c-.764-.255-1.435.42-1.435 1.227v6.608ZM4.64 1.46c0-.806-.67-1.482-1.435-1.226a4.62 4.62 0 0 0-1.846 1.161A4.83 4.83 0 0 0 0 4.765a4.83 4.83 0 0 0 1.359 3.368 4.62 4.62 0 0 0 1.846 1.162c.765.255 1.435-.42 1.435-1.226v-6.61Z"})}),ms=()=>(0,o.jsx)("svg",{width:"71",height:"17",viewBox:"17 0 71 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(hs,{d:"M27.445 13.543c-1.288 0-2.324-.206-3.107-.618-.773-.422-1.355-.948-1.747-1.576a.327.327 0 0 1 .108-.448l.882-.665a.253.253 0 0 1 .185-.077c.093 0 .18.056.263.17.69 1.112 1.85 1.669 3.477 1.669.712 0 1.314-.129 1.809-.387.505-.257.757-.67.757-1.236 0-.422-.144-.752-.432-.989-.279-.237-.712-.448-1.299-.634-.536-.164-.87-.262-1.005-.293a32.224 32.224 0 0 1-1.916-.603c-.99-.37-1.644-.798-1.963-1.282-.32-.485-.48-.99-.48-1.515 0-.433.135-.896.402-1.39.279-.506.712-.933 1.299-1.283.598-.361 1.345-.541 2.241-.541.938 0 1.726.118 2.365.355.639.227 1.247.608 1.824 1.144.072.072.108.144.108.216 0 .103-.051.186-.155.247l-.989.665a.414.414 0 0 1-.2.077c-.093 0-.181-.046-.263-.139-.619-.66-1.469-.989-2.55-.989-.619 0-1.098.093-1.438.278-.33.186-.551.392-.665.618a1.486 1.486 0 0 0-.154.603c0 .37.144.67.432.896.289.227.716.433 1.283.618.052.021.448.14 1.19.356.464.123.943.263 1.438.417 1.082.36 1.803.82 2.164 1.375.37.557.556 1.093.556 1.608 0 .556-.134 1.087-.402 1.591-.257.505-.716.928-1.375 1.268-.65.33-1.53.494-2.643.494ZM37.403 5.06c.773 0 1.489.226 2.148.679.66.443.99 1.262.99 2.457v4.837c0 .103-.031.186-.093.247-.052.052-.13.078-.232.078H39.21a.374.374 0 0 1-.247-.078.374.374 0 0 1-.077-.247V8.46c-.031-.587-.196-1.051-.495-1.39-.289-.34-.665-.51-1.128-.51-.33 0-.66.092-.99.277-.32.175-.592.448-.819.82-.227.36-.36.813-.402 1.36v4.017c0 .103-.03.186-.092.247-.052.052-.13.078-.232.078h-1.005a.373.373 0 0 1-.247-.078.374.374 0 0 1-.078-.247V5.585c0-.104.026-.18.078-.232a.334.334 0 0 1 .247-.093h1.005c.103 0 .18.03.232.093.061.051.092.128.092.232v.185c0 .072.01.129.031.17.031.03.067.046.108.046.083 0 .191-.056.325-.17a3.58 3.58 0 0 1 .927-.556c.34-.134.66-.2.959-.2ZM49.302 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.432.865c-.083.186-.217.252-.402.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.185-.371-.278-.726-.278-1.066 0-.557.17-1.056.51-1.5.35-.442.87-.752 1.561-.927.474-.113 1.134-.2 1.978-.262.577-.042.995-.083 1.252-.124.206-.03.3-.155.279-.37-.052-.464-.206-.835-.464-1.114-.247-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.164-.051-.247-.139-.247-.262 0-.031.01-.078.031-.14a2.977 2.977 0 0 1 1.221-1.421c.567-.36 1.304-.541 2.21-.541.886 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.061-.061-.144-.082-.247-.061l-.603.061a17.05 17.05 0 0 0-1.638.217 2.807 2.807 0 0 0-1.067.402.898.898 0 0 0-.433.803c0 .423.186.711.557.866.371.154.778.231 1.221.231ZM55.598 5.06c.99 0 1.757.236 2.303.71.547.464.918 1.015 1.113 1.653.196.629.294 1.257.294 1.886 0 .628-.098 1.262-.294 1.9-.195.63-.566 1.18-1.113 1.654-.546.464-1.313.696-2.303.696-.803 0-1.473-.217-2.009-.65-.072-.072-.144-.108-.216-.108-.103 0-.155.088-.155.263v3.245c0 .103-.03.18-.093.232-.051.062-.128.093-.231.093h-.928a.335.335 0 0 1-.247-.093c-.052-.051-.077-.129-.077-.232V5.584c0-.103.025-.18.077-.231a.334.334 0 0 1 .247-.093h.928c.103 0 .18.03.231.093.062.051.093.128.093.232 0 .082.01.149.031.2.031.042.067.062.108.062.052 0 .098-.02.14-.062.545-.484 1.246-.726 2.101-.726Zm-.154 7.077c.793 0 1.375-.273 1.746-.82.382-.545.572-1.215.572-2.008 0-.793-.19-1.463-.572-2.01-.37-.545-.953-.818-1.746-.818-.783 0-1.355.273-1.716.819-.35.536-.525 1.205-.525 2.009 0 .803.175 1.478.525 2.024.36.536.933.804 1.716.804ZM66.122 13.543c-1.174 0-2.19-.253-3.045-.757a4.991 4.991 0 0 1-1.932-2.071c-.433-.886-.649-1.89-.649-3.014 0-1.123.216-2.122.65-2.998a4.97 4.97 0 0 1 1.931-2.086c.856-.505 1.87-.757 3.045-.757 1.113 0 2.077.227 2.89.68a4.896 4.896 0 0 1 1.933 1.9c.03.062.046.12.046.17 0 .114-.077.196-.232.248L69.6 5.15a.342.342 0 0 1-.108.016c-.134 0-.237-.067-.31-.201-.638-1.05-1.658-1.576-3.06-1.576-.865 0-1.582.2-2.148.602a3.541 3.541 0 0 0-1.252 1.592 5.497 5.497 0 0 0-.402 2.117c0 .763.134 1.468.402 2.117a3.555 3.555 0 0 0 1.252 1.577c.566.402 1.283.602 2.148.602.814 0 1.52-.19 2.118-.571.608-.382 1.04-.964 1.298-1.747.072-.195.201-.278.387-.247l1.174.155c.175.03.263.113.263.247a.93.93 0 0 1-.03.154c-.454 1.185-1.114 2.076-1.98 2.674-.855.587-1.931.88-3.23.88ZM79.474 10.916c.02.309.072.551.155.726.082.165.257.294.525.386.165.062.248.15.248.263a.364.364 0 0 1-.047.155l-.433.865c-.082.186-.216.252-.401.201-.598-.134-1.01-.428-1.237-.88-.052-.114-.103-.17-.155-.17-.051 0-.108.04-.17.123-.535.649-1.406.973-2.612.973-.731 0-1.324-.128-1.777-.386-.443-.258-.758-.567-.943-.927-.186-.371-.278-.726-.278-1.066a2.4 2.4 0 0 1 .51-1.5c.35-.442.87-.752 1.56-.927.475-.113 1.134-.2 1.98-.262.576-.042.994-.083 1.251-.124.206-.03.3-.155.278-.37-.051-.464-.206-.835-.463-1.114-.248-.288-.665-.432-1.252-.432-.381 0-.747.082-1.098.247-.34.155-.602.428-.788.819-.093.196-.227.263-.402.2l-.943-.262c-.165-.051-.247-.139-.247-.262 0-.031.01-.078.03-.14a2.979 2.979 0 0 1 1.222-1.421c.567-.36 1.303-.541 2.21-.541.887 0 1.639.232 2.257.695.618.454.948 1.113.99 1.978.01.412.015.964.015 1.654.01.69.015 1.19.015 1.499Zm-3.864 1.313c.278 0 .582-.067.912-.2.34-.134.639-.366.896-.696.268-.34.433-.793.495-1.36v-.03c0-.104-.03-.181-.093-.233-.062-.061-.144-.082-.247-.061l-.603.061c-.67.062-1.216.134-1.638.217a2.808 2.808 0 0 0-1.067.402.898.898 0 0 0-.432.803c0 .423.185.711.556.866.37.154.778.231 1.221.231ZM83.467 13.033c0 .103-.03.185-.092.247-.052.052-.13.077-.232.077h-1.005a.374.374 0 0 1-.247-.077.374.374 0 0 1-.078-.247V2.354c0-.103.026-.18.078-.232a.335.335 0 0 1 .247-.092h1.005c.103 0 .18.03.232.093.061.051.092.128.092.231v10.679ZM87.35 13.033c0 .103-.03.185-.093.247-.051.052-.129.077-.232.077h-1.004a.374.374 0 0 1-.248-.077.374.374 0 0 1-.077-.247V2.354c0-.103.026-.18.078-.232a.334.334 0 0 1 .247-.092h1.004c.103 0 .18.03.232.093.062.051.093.128.093.231v10.679Z",stroke:"#fff",strokeWidth:".5"})});var gs=({size:e="large"})=>"small"===e?(0,o.jsx)(fs,{}):"medium"===e?(0,o.jsx)(ms,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(fs,{}),(0,o.jsx)(ms,{})]});const vs=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M19 2H9a3 3 0 0 0-3 3v1H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3Zm-3 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-7h12v7Zm0-9H4V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Zm4 5a1 1 0 0 1-1 1h-1V9a3 3 0 0 0-.18-1H20v7Zm0-9H8V5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1Z",fill:"#fff"})}),ys=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M21 8.94a1.307 1.307 0 0 0-.06-.27v-.09a1.07 1.07 0 0 0-.19-.28l-6-6a1.071 1.071 0 0 0-.28-.19.32.32 0 0 0-.09 0 .88.88 0 0 0-.33-.11H10a3 3 0 0 0-3 3v1H6a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-1h1a3 3 0 0 0 3-3V8.94Zm-6-3.53L17.59 8H16a1 1 0 0 1-1-1V5.41ZM15 19a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1v7a3 3 0 0 0 3 3h5v1Zm4-4a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h3v3a3 3 0 0 0 3 3h3v5Z",fill:e||"#fff"})}),bs=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M8 21H4a1 1 0 0 1-1-1v-4a1 1 0 1 0-2 0v4a3 3 0 0 0 3 3h4a1 1 0 0 0 0-2Zm14-6a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 0 0 2h4a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1ZM20 1h-4a1 1 0 1 0 0 2h4a1 1 0 0 1 1 1v4a1 1 0 0 0 2 0V4a3 3 0 0 0-3-3ZM2 9a1 1 0 0 0 1-1V4a1 1 0 0 1 1-1h4a1 1 0 0 0 0-2H4a3 3 0 0 0-3 3v4a1 1 0 0 0 1 1Zm8-4H6a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1ZM9 9H7V7h2v2Zm5 2h4a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1Zm1-4h2v2h-2V7Zm-5 6H6a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-1 4H7v-2h2v2Zm5-1a1 1 0 0 0 1-1 1 1 0 0 0 0-2h-1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1Zm4-3a1 1 0 0 0-1 1v3a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1Zm-4 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fill:e||"#fff"})}),ws=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"m21.32 9.55-1.89-.63.89-1.78A1 1 0 0 0 20.13 6L18 3.87a1 1 0 0 0-1.15-.19l-1.78.89-.63-1.89A1 1 0 0 0 13.5 2h-3a1 1 0 0 0-.95.68l-.63 1.89-1.78-.89A1 1 0 0 0 6 3.87L3.87 6a1 1 0 0 0-.19 1.15l.89 1.78-1.89.63a1 1 0 0 0-.68.94v3a1 1 0 0 0 .68.95l1.89.63-.89 1.78A1 1 0 0 0 3.87 18L6 20.13a1 1 0 0 0 1.15.19l1.78-.89.63 1.89a1 1 0 0 0 .95.68h3a1 1 0 0 0 .95-.68l.63-1.89 1.78.89a1 1 0 0 0 1.13-.19L20.13 18a1 1 0 0 0 .19-1.15l-.89-1.78 1.89-.63a1 1 0 0 0 .68-.94v-3a1 1 0 0 0-.68-.95ZM20 12.78l-1.2.4A2 2 0 0 0 17.64 16l.57 1.14-1.1 1.1-1.11-.6a2 2 0 0 0-2.79 1.16l-.4 1.2h-1.59l-.4-1.2A2 2 0 0 0 8 17.64l-1.14.57-1.1-1.1.6-1.11a2 2 0 0 0-1.16-2.82l-1.2-.4v-1.56l1.2-.4A2 2 0 0 0 6.36 8l-.57-1.11 1.1-1.1L8 6.36a2 2 0 0 0 2.82-1.16l.4-1.2h1.56l.4 1.2A2 2 0 0 0 16 6.36l1.14-.57 1.1 1.1-.6 1.11a2 2 0 0 0 1.16 2.79l1.2.4v1.59ZM12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0 6a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fill:"#fff"})}),xs=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M4 12a1 1 0 0 0 1 1h7.59l-2.3 2.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l4-4a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76 1 1 0 0 0-.21-.33l-4-4a1.003 1.003 0 1 0-1.42 1.42l2.3 2.29H5a1 1 0 0 0-1 1ZM17 2H7a3 3 0 0 0-3 3v3a1 1 0 0 0 2 0V5a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-3a1 1 0 1 0-2 0v3a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3Z",fill:"#fff"})}),_s=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M4.91 13.1a1 1 0 0 0 .85.47A1 1 0 0 0 6.61 12a17 17 0 0 1-2.47-6.85 1 1 0 0 1 .578-1.06A1 1 0 0 1 5.13 4h3a1 1 0 0 1 1 .8c0 .23.08.44.13.67v.13c.116.525.273 1.04.47 1.54l-1.39.66a1 1 0 0 0-.52.57 1 1 0 0 0 0 .77c.1.21.2.42.32.64a1 1 0 0 0 1.755-.028 1 1 0 0 0 .115-.542l.57-.21a2 2 0 0 0 1.05-2.48 9.317 9.317 0 0 1-.39-1.3v-.1c0-.2-.08-.4-.11-.58A3 3 0 0 0 8.16 2h-3a3 3 0 0 0-2.28 1 3 3 0 0 0-.72 2.39 19.05 19.05 0 0 0 2.75 7.71Zm14.61-.21-.6-.11h-.08a9.325 9.325 0 0 1-1.33-.39 2 2 0 0 0-2.47 1l-.21.46a12.392 12.392 0 0 1-1.92-1.37l8.8-8.79a1.004 1.004 0 1 0-1.42-1.42l-18 18a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.59-4.6a19.09 19.09 0 0 0 10.29 4.73c.133.01.267.01.4 0a3 3 0 0 0 2-.75 3 3 0 0 0 1-2.25v-3a3 3 0 0 0-2.47-2.93Zm.48 6a.999.999 0 0 1-.718.96 1 1 0 0 1-.432.03 17.07 17.07 0 0 1-9.14-4.18l1.77-1.77a14.695 14.695 0 0 0 3.38 2.21 1.002 1.002 0 0 0 .77 0 1 1 0 0 0 .57-.52l.62-1.41c.522.194 1.056.35 1.6.47h.11l.69.13a1 1 0 0 1 .78 1v3.08Z",fill:"#D84949"})}),Ss=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsxs)("g",{clipPath:"url(#pip)",fill:"#fff",children:[(0,o.jsx)("path",{d:"M0 5v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H3a3 3 0 0 0-3 3Zm17-1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h14Z"}),(0,o.jsx)("path",{d:"M10 14v4.879a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V14a3 3 0 0 0-3-3h-8a3 3 0 0 0-3 3ZM10 11.149c0 .113-.02.226-.06.332a.85.85 0 0 1-.8.519H5.736a.851.851 0 0 1 0-1.702h1.353l-2.792-2.8a.851.851 0 1 1 1.2-1.2l2.8 2.8V7.744a.851.851 0 0 1 1.703 0v3.405Z"})]})}),ks=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3ZM5 18a1 1 0 0 1-1-1v-2.42l3.3-3.29a1 1 0 0 1 1.4 0L15.41 18H5Zm15-1a1 1 0 0 1-1 1h-.77l-3.81-3.83.88-.88a1 1 0 0 1 1.4 0l3.3 3.29V17Zm0-3.24-1.88-1.87a3.06 3.06 0 0 0-4.24 0l-.88.88-2.88-2.88a3.06 3.06 0 0 0-4.24 0L4 11.76V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v6.76Z",fill:e||"#fff"})});Ie=a("85Hg2"),Ie=a("85Hg2");const Cs=(e,t)=>((0,Ie.useEffect)((()=>{const r=r=>{e?.current?.contains(r.target)||t()};if(e?.current)return window.addEventListener("click",r),()=>window.removeEventListener("click",r)}),[e,t]),null),Es=yr.div`
|
|
309
309
|
display: flex;
|
|
310
310
|
flex-direction: column;
|
|
311
311
|
padding: 6px 8px;
|
|
312
|
-
`,
|
|
312
|
+
`,Rs=yr.div`
|
|
313
313
|
display: flex;
|
|
314
314
|
flex-direction: column;
|
|
315
315
|
padding: 4px 0;
|
|
@@ -320,17 +320,17 @@ to {
|
|
|
320
320
|
overflow: auto;
|
|
321
321
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
322
322
|
|
|
323
|
-
${
|
|
323
|
+
${Es}:not(:last-child) {
|
|
324
324
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
325
325
|
}
|
|
326
|
-
`,
|
|
326
|
+
`,Ps=yr.div`
|
|
327
327
|
font-size: 12px;
|
|
328
328
|
font-weight: 400;
|
|
329
329
|
line-height: 14px;
|
|
330
330
|
color: #d4d4d4;
|
|
331
331
|
margin-left: 16px;
|
|
332
332
|
padding: 5px 0;
|
|
333
|
-
`,
|
|
333
|
+
`,Ts=yr.button`
|
|
334
334
|
display: flex;
|
|
335
335
|
align-items: center;
|
|
336
336
|
font-size: 16px;
|
|
@@ -345,7 +345,7 @@ to {
|
|
|
345
345
|
&:hover {
|
|
346
346
|
background-color: #424242;
|
|
347
347
|
}
|
|
348
|
-
`,
|
|
348
|
+
`,js=yr.span`
|
|
349
349
|
display: flex;
|
|
350
350
|
margin-right: 12px;
|
|
351
351
|
|
|
@@ -353,13 +353,13 @@ to {
|
|
|
353
353
|
img {
|
|
354
354
|
max-height: 22px;
|
|
355
355
|
}
|
|
356
|
-
`,
|
|
356
|
+
`,Os=yr.span`
|
|
357
357
|
font-size: 9px;
|
|
358
358
|
font-weight: 900;
|
|
359
359
|
line-height: 10px;
|
|
360
360
|
color: #ffb800;
|
|
361
361
|
margin-left: 8px;
|
|
362
|
-
`;var
|
|
362
|
+
`;var Ms=({categories:e})=>{const{t:t}=Li();return(0,o.jsx)(Rs,{children:e.map((e=>(0,o.jsxs)(Es,{children:[e.title&&(0,o.jsx)(Ps,{children:e.title}),e.items.map((e=>(0,o.jsxs)(Ts,{onClick:e.action,danger:e.danger,children:[e.jsxIcon&&(0,o.jsx)(js,{children:e.jsxIcon}),e.srcIcon&&(0,o.jsx)(js,{children:(0,o.jsx)("img",{alt:e.title,src:e.srcIcon})}),e.title,e.isNew&&(0,o.jsx)(Os,{children:t("menu.new")})]},e.id)))]},e.id)))})};const Is=yr.div`
|
|
363
363
|
display: flex;
|
|
364
364
|
justify-content: space-between;
|
|
365
365
|
align-items: center;
|
|
@@ -370,10 +370,10 @@ to {
|
|
|
370
370
|
@media (max-height: 500px) {
|
|
371
371
|
height: 40px;
|
|
372
372
|
}
|
|
373
|
-
`,
|
|
373
|
+
`,Ls=yr.div`
|
|
374
374
|
display: flex;
|
|
375
375
|
align-items: center;
|
|
376
|
-
`,
|
|
376
|
+
`,Ds=yr.span`
|
|
377
377
|
font-size: 16px;
|
|
378
378
|
font-weight: 300;
|
|
379
379
|
line-height: 16px;
|
|
@@ -381,10 +381,10 @@ to {
|
|
|
381
381
|
margin-left: 5px;
|
|
382
382
|
position: relative;
|
|
383
383
|
bottom: 1px;
|
|
384
|
-
`,
|
|
384
|
+
`,As=yr.div`
|
|
385
385
|
display: flex;
|
|
386
386
|
gap: 10px;
|
|
387
|
-
`,
|
|
387
|
+
`,Ns=yr.button`
|
|
388
388
|
display: flex;
|
|
389
389
|
justify-content: center;
|
|
390
390
|
align-items: center;
|
|
@@ -405,9 +405,9 @@ to {
|
|
|
405
405
|
max-width: 100%;
|
|
406
406
|
max-height: 100%;
|
|
407
407
|
}
|
|
408
|
-
`,
|
|
408
|
+
`,Bs=yr.div`
|
|
409
409
|
position: relative;
|
|
410
|
-
`,
|
|
410
|
+
`,Fs=yr.button`
|
|
411
411
|
display: flex;
|
|
412
412
|
justify-content: center;
|
|
413
413
|
align-items: center;
|
|
@@ -430,21 +430,21 @@ to {
|
|
|
430
430
|
max-width: 15px;
|
|
431
431
|
max-height: 15px;
|
|
432
432
|
}
|
|
433
|
-
`,
|
|
433
|
+
`,zs=yr.div`
|
|
434
434
|
position: absolute;
|
|
435
435
|
right: 0;
|
|
436
436
|
top: 38.5px;
|
|
437
437
|
z-index: 30;
|
|
438
|
-
`;var Vs=({baseCategories:e,extraCategories:t})=>{const{t:r}=Li(),n=(0,Ie.useRef)(null),[i,a]=(0,Ie.useState)(!1),[s,c]=(0,Ie.useState)(e),{options:l}=(0,Ie.useContext)(as);Es(n,(()=>a(!1)));const d=(0,Ie.useMemo)((()=>{const r=l.settingsShortcuts;if(r){const n=e.reduce(((e,t)=>[...e,...t.items]),[]),i=t?.reduce(((e,t)=>[...e,...t.items]),[])||[];return r.reduce(((e,t)=>{const r=n.find((e=>e.id===t.id));if(r)e.push({...r,displayType:t.displayType});else{const r=i?.find((e=>e.id===t.id));r&&e.push({...r,displayType:t.displayType})}return e}),[])}return[]}),[l.settingsShortcuts,e,t]);(0,Ie.useEffect)((()=>{const r=[...e.map((e=>({...e,items:[...e.items]})))];t?.forEach((e=>{const t=r.find((t=>t.id===e.id));if(t)e.items.forEach((e=>{const r=Number(e.position),n=isNaN(r)?t.items.length:r;t.items.splice(n,0,e)}));else{const t=Number(e.position),n=isNaN(t)?r.length:t;r.splice(n,0,e)}}));const n=r.map((e=>{const t=e.items.map((e=>({...e,action:()=>{e.action(),a(!1)}})));return{...e,items:t}}));c(n)}),[e,t]);return(0,o.jsxs)(Ns,{children:[d.map((e=>"full"===e.displayType?(0,o.jsxs)(zs,{onClick:e.action,children:[e.jsxIcon&&e.jsxIcon,e.srcIcon&&(0,o.jsx)("img",{alt:e.title,src:e.srcIcon}),e.title]},e.id):(0,o.jsxs)(Bs,{onClick:e.action,children:[e.jsxIcon&&e.jsxIcon,e.srcIcon&&(0,o.jsx)("img",{alt:e.title,src:e.srcIcon})]},e.id))),l.showMenuButton&&(0,o.jsxs)(Fs,{children:[(0,o.jsx)(zs,{onClick:()=>a((e=>!e)),children:r("menu.title")}),i&&(0,o.jsx)(Us,{ref:n,children:(0,o.jsx)(Is,{categories:s})})]})]})};const Hs=({width:e,cellAspectRatio:t,tileCount:r})=>{const n=Math.round(e/t),i=Math.round(e);return r<=1?{width:i,height:n,tileRects:[{origin:{x:0,y:0},bounds:{width:i,height:n}}],tileCount:r}:(({width:e,height:t,tileCount:r})=>{const n=Math.min(r,12);let i=0,a=0;n<=2?(i=2,a=1):n<=4?(i=2,a=2):n<=6?(i=3,a=2):n<=9?(i=3,a=3):(i=4,a=3);const o={width:Math.round(e/i),height:Math.round(t/a)},s=[...Array(n)].map(((e,t)=>({origin:{x:Math.floor(t%i)*o.width,y:Math.floor(t/i)*o.height},bounds:o})));return{width:o.width*i,height:o.height*a,tileRects:s,tileCount:n}})({width:i,height:n,tileCount:r})};const $s=new class{constructor(){this.started=!1,this.fps=18,this.devicePixelRatio=window.devicePixelRatio||1,this.layout=null,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx&&(this.ctx.fillStyle="#000",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)),this.video=document.createElement("video"),this.video.muted=!0,this.video.autoplay=!0,this.video.playsInline=!0,this.video.addEventListener("enterpictureinpicture",this.onEnterPictureInPicture.bind(this)),this.video.addEventListener("leavepictureinpicture",this.onLeavePictureInPicture.bind(this)),this.tiles=[]}async start(){this.tiles.length?(this.video.srcObject=this.canvas.captureStream(this.fps),document.pictureInPictureElement&&document.exitPictureInPicture(),this.canvas.width=this.layout?.width||50,this.canvas.height=this.layout?.height||33,await this.video.play(),await this.video.requestPictureInPicture(),this.draw()):(0,g.toast)(Bi.t("notifications.noCamera"),{className:"error"})}setTiles(e){this.tiles=e,this.layout=Hs({width:300*this.devicePixelRatio,cellAspectRatio:1.5,tileCount:e.length}),this.started&&this.draw()}onEnterPictureInPicture(){this.started=!0}onLeavePictureInPicture(){this.started=!1,this.video.srcObject=null}draw(){this.ctx&&this.started&&(this.ctx.fillStyle="#1f1f1f",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.tiles.length?(this.tiles.forEach(((e,t)=>{const r=document.body.querySelectorAll(`[data-peer-id='${e.id}'] video`)[0];if(!r)return console.warn(`MultiPiP: No video found for peer ${e.id}`);const n=this.layout?.tileRects[t];if(!n)return;this.ctx?.save();const{videoWidth:i,videoHeight:a}=r,{width:o,height:s}=n.bounds,c=Math.max(o/i,s/a),l=i/(i*c/o),d=a/(a*c/s),u=.5*(i-l),p=.5*(a-d),h=n.origin.x+5,f=n.origin.y+5,m=o-10,g=s-10;this.makeRoundedRect({ctx:this.ctx,x:h,y:f,width:m,height:g,radius:10}),this.ctx?.clip(),this.ctx?.drawImage(r,u,p,l,d,h,f,m,g),this.ctx?.restore()})),requestAnimationFrame(this.draw.bind(this))):document.exitPictureInPicture())}makeRoundedRect({ctx:e,x:t,y:r,width:n,height:i,radius:a}){e&&(e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+i-a),e.quadraticCurveTo(t+n,r+i,t+n-a,r+i),e.lineTo(t+a,r+i),e.quadraticCurveTo(t,r+i,t,r+i-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath())}},Ws=Fi.parse(window.navigator.userAgent);var qs=()=>{const{t:e}=Li(),{setIsQuickConnectPopupVisible:t,setIsSettingsMenuVisible:n,setIsVirtualBackgroundPopupVisible:i,options:a,muted:s,streaming:c}=(0,Ie.useContext)(as),{streams:l}=ps(),[d,u]=(0,Ie.useState)(a.extraSettingsOptions||[]),h=e=>{const{extraOptions:t}=e.detail;u(t)},f=()=>{$s.start()};(0,Ie.useEffect)((()=>{const e=l.filter((e=>e.webcam)).map((e=>({id:e.id})));$s.setTiles(e)}),[l]),(0,Ie.useEffect)((()=>(window.addEventListener("streamUISetExtraSettingsOptions",h),()=>{window.removeEventListener("streamUISetExtraSettingsOptions",h)})),[]);const m=(0,Ie.useMemo)((()=>{const l=[{id:"1",items:[{id:"openNewTab",title:e("menu.openNewTab"),jsxIcon:(0,o.jsx)(ys,{}),action:()=>{const e=new URL(a.sharedURL||window.location.href),t=s?"0":"1";e.searchParams.set("microphone-enabled",t);const r=c?"1":"0";e.searchParams.set("camera-enabled",r),window.open(e.href,"_blank"),is.endCall()}}]},{id:"2",items:[{id:"copyLink",title:e("copyLink.title"),jsxIcon:(0,o.jsx)(bs,{}),action:async()=>{try{await hs(a.sharedURL||window.location.href),r(g)(e("copyLink.copied"),{duration:2e3})}catch(t){console.warn(t),r(g)(e("copyLink.error"),{className:"error"})}}},{id:"quickConnect",title:e("quickConnect.title"),jsxIcon:(0,o.jsx)(ws,{}),action:()=>{t(!0),p.event("quickConnectClick")}}]},{id:"3",items:[{id:"settings",title:e("settings.title"),jsxIcon:(0,o.jsx)(xs,{}),action:()=>{n(!0)}}]}];return"desktop"===Ws.platform.type&&"Blink"===Ws.engine.name&&l[2].items.unshift({id:"virtualBackground",title:e("virtualBackground.title"),jsxIcon:(0,o.jsx)(Cs,{}),action:()=>{i(!0)}}),document.pictureInPictureEnabled&&"desktop"===Ws.platform.type&&l[0].items.push({id:"pip",title:e("menu.pictureInPicture"),jsxIcon:(0,o.jsx)(ks,{}),action:f}),l}),[s,c,a.sharedURL,t,n,i,e]);return(0,o.jsxs)(Ls,{children:[(0,o.jsxs)(Ds,{children:[(0,o.jsx)(vs,{size:a.logo?.size}),a.logo?.text&&(0,o.jsx)(As,{children:a.logo.text})]}),(0,o.jsx)(Vs,{baseCategories:m,extraCategories:d})]})};Ie=a("85Hg2"),Ie=a("85Hg2");const Gs=e=>{const[t,r]=(0,Ie.useState)([0,0]);return(0,Ie.useLayoutEffect)((()=>{if(e){const t=new ResizeObserver((()=>r([e?.offsetWidth||0,e?.offsetHeight||0])));return t.observe(e),()=>t.unobserve(e)}}),[e]),t},Zs={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Ks(){const[e,t]=(0,Ie.useState)(null),[r,n]=(0,Ie.useState)(Zs);return(0,Ie.useLayoutEffect)((()=>{if(!e)return;const t=new ResizeObserver((e=>n(e[0].contentRect)));return t.observe(e),()=>{t.disconnect()}}),[e]),[t,r]}Ie=a("85Hg2");var Ys=({slash:e,redSlash:t,status:r,deviceRequest:n})=>e?(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#fff"}),(0,o.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#fff",stroke:"#d84949",strokeLinecap:"round"})]}):t?(0,o.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#d84949"}),(0,o.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#d84949",stroke:"#242324",strokeLinecap:"round"})]}):r?(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M6.125 2.176a1.167 1.167 0 0 1 1.72-.082c.211.222.326.517.321.823v1.99a.583.583 0 1 0 1.167 0v-1.99A2.333 2.333 0 0 0 5.25 1.44a.583.583 0 1 0 .875.735Zm4.795 5.565h.117a.583.583 0 0 0 .583-.472c.042-.282.057-.567.046-.852a.584.584 0 0 0-1.166 0c0 .215-.022.43-.064.642a.583.583 0 0 0 .484.682Zm1.75 3.535L2.17.776a.583.583 0 1 0-.829.823l3.325 3.348v1.47a2.333 2.333 0 0 0 3.5 2.018l.852.852A3.5 3.5 0 0 1 3.5 6.417a.583.583 0 0 0-1.167 0 4.667 4.667 0 0 0 4.083 4.626v1.207H5.25a.583.583 0 0 0 0 1.167h3.5a.583.583 0 0 0 0-1.167H7.583v-1.207a4.59 4.59 0 0 0 2.246-.928l1.983 1.984a.584.584 0 0 0 .829-.823h.029ZM7 7.584a1.167 1.167 0 0 1-1.167-1.167v-.303l1.43 1.435A1.015 1.015 0 0 1 7 7.584Z",fill:"#fff"})}):n?(0,o.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M25 13.75a1.25 1.25 0 0 0-2.5 0 7.5 7.5 0 1 1-15 0 1.25 1.25 0 0 0-2.5 0 10 10 0 0 0 8.75 9.913v2.587h-2.5a1.25 1.25 0 0 0 0 2.5h7.5a1.25 1.25 0 0 0 0-2.5h-2.5v-2.587A10 10 0 0 0 25 13.75Z",fill:"url(#microphoneBottom)"}),(0,o.jsx)("path",{d:"M15 18.75a5 5 0 0 0 5-5v-7.5a5 5 0 0 0-10 0v7.5a5 5 0 0 0 5 5Z",fill:"url(#microphoneTop)"})]}):(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#fff"})});var Qs=({slash:e,status:t,deviceRequest:r})=>e?(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M21.53 7.15a1 1 0 0 0-1 0L17 8.89A3 3 0 0 0 14 6H5a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h9a3 3 0 0 0 3-2.89l3.56 1.78A1 1 0 0 0 21 17a1 1 0 0 0 .875-.514A1 1 0 0 0 22 16V8a1 1 0 0 0-.47-.85ZM15 15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v6Zm5-.62-3-1.5v-1.76l3-1.5v4.76Z",fill:"#fff"}),(0,o.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#fff",stroke:"#d84949",strokeLinecap:"round"})]}):t?(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M4.497 3.669 2.164 1.336a.586.586 0 1 0-.828.828L2.695 3.5a1.75 1.75 0 0 0-1.529 1.75v3.5a1.75 1.75 0 0 0 1.75 1.75h5.25a1.75 1.75 0 0 0 1.109-.403l2.56 2.567a.583.583 0 0 0 .957-.19.582.582 0 0 0-.128-.638L4.497 3.669Zm3.67 5.664h-5.25a.583.583 0 0 1-.584-.583v-3.5a.583.583 0 0 1 .583-.584h.928l4.59 4.597a.583.583 0 0 1-.268.07Zm4.392-5.162a.583.583 0 0 0-.583 0l-2.06 1.015A1.75 1.75 0 0 0 8.166 3.5h-.781a.583.583 0 0 0 0 1.166h.781a.583.583 0 0 1 .584.584v.875a.944.944 0 0 0 0 .11.38.38 0 0 0 .029.117s.03.035.04.059a.584.584 0 0 0 .088.122s.059.035.088.058l.099.065c.044.006.09.006.134 0a.41.41 0 0 0 .082 0 .949.949 0 0 0 .11 0 .38.38 0 0 0 .117-.03l2.13-1.015v3.337a.583.583 0 0 0 1.166 0V4.666a.584.584 0 0 0-.274-.495Z",fill:"#fff"})}):r?(0,o.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M26.54 8.438c.23 0 .456.06.656.176a1.315 1.315 0 0 1 .617 1.117v10.517a1.318 1.318 0 0 1-.617 1.117 1.31 1.31 0 0 1-.696.198 1.31 1.31 0 0 1-.578-.145l-4.672-2.34v-8.177l4.633-2.287c.2-.116.426-.177.656-.177Z",fill:"url(#cameraRight)"}),(0,o.jsx)("path",{d:"M20.104 8.55a3.75 3.75 0 0 1 1.146 2.563v7.775A3.75 3.75 0 0 1 17.5 22.5H6.25a3.75 3.75 0 0 1-3.75-3.75v-7.5A3.75 3.75 0 0 1 6.25 7.5H17.5a3.75 3.75 0 0 1 2.604 1.05Z",fill:"url(#cameraLeft)"})]}):(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M21.53 7.15a1 1 0 0 0-1 0L17 8.89A3 3 0 0 0 14 6H5a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h9a3 3 0 0 0 3-2.89l3.56 1.78A1 1 0 0 0 21 17a1 1 0 0 0 .875-.514A1 1 0 0 0 22 16V8a1 1 0 0 0-.47-.85ZM15 15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v6Zm5-.62-3-1.5v-1.76l3-1.5v4.76Z",fill:"#fff"})});const Js=yr.path`
|
|
438
|
+
`;var Us=({baseCategories:e,extraCategories:t})=>{const{t:r}=Li(),n=(0,Ie.useRef)(null),[i,a]=(0,Ie.useState)(!1),[s,c]=(0,Ie.useState)(e),{options:l}=(0,Ie.useContext)(is);Cs(n,(()=>a(!1)));const d=(0,Ie.useMemo)((()=>{const r=l.settingsShortcuts;if(r){const n=e.reduce(((e,t)=>[...e,...t.items]),[]),i=t?.reduce(((e,t)=>[...e,...t.items]),[])||[];return r.reduce(((e,t)=>{const r=n.find((e=>e.id===t.id));if(r)e.push({...r,displayType:t.displayType});else{const r=i?.find((e=>e.id===t.id));r&&e.push({...r,displayType:t.displayType})}return e}),[])}return[]}),[l.settingsShortcuts,e,t]);(0,Ie.useEffect)((()=>{const r=[...e.map((e=>({...e,items:[...e.items]})))];t?.forEach((e=>{const t=r.find((t=>t.id===e.id));if(t)e.items.forEach((e=>{const r=Number(e.position),n=isNaN(r)?t.items.length:r;t.items.splice(n,0,e)}));else{const t=Number(e.position),n=isNaN(t)?r.length:t;r.splice(n,0,e)}}));const n=r.map((e=>{const t=e.items.map((e=>({...e,action:()=>{e.action(),a(!1)}})));return{...e,items:t}}));c(n)}),[e,t]);return(0,o.jsxs)(As,{children:[d.map((e=>"full"===e.displayType?(0,o.jsxs)(Fs,{onClick:e.action,children:[e.jsxIcon&&e.jsxIcon,e.srcIcon&&(0,o.jsx)("img",{alt:e.title,src:e.srcIcon}),e.title]},e.id):(0,o.jsxs)(Ns,{onClick:e.action,children:[e.jsxIcon&&e.jsxIcon,e.srcIcon&&(0,o.jsx)("img",{alt:e.title,src:e.srcIcon})]},e.id))),l.showMenuButton&&(0,o.jsxs)(Bs,{children:[(0,o.jsx)(Fs,{onClick:()=>a((e=>!e)),children:r("menu.title")}),i&&(0,o.jsx)(zs,{ref:n,children:(0,o.jsx)(Ms,{categories:s})})]})]})};const Vs=({width:e,cellAspectRatio:t,tileCount:r})=>{const n=Math.round(e/t),i=Math.round(e);return r<=1?{width:i,height:n,tileRects:[{origin:{x:0,y:0},bounds:{width:i,height:n}}],tileCount:r}:(({width:e,height:t,tileCount:r})=>{const n=Math.min(r,12);let i=0,a=0;n<=2?(i=2,a=1):n<=4?(i=2,a=2):n<=6?(i=3,a=2):n<=9?(i=3,a=3):(i=4,a=3);const o={width:Math.round(e/i),height:Math.round(t/a)},s=[...Array(n)].map(((e,t)=>({origin:{x:Math.floor(t%i)*o.width,y:Math.floor(t/i)*o.height},bounds:o})));return{width:o.width*i,height:o.height*a,tileRects:s,tileCount:n}})({width:i,height:n,tileCount:r})};const Hs=new class{constructor(){this.started=!1,this.fps=18,this.devicePixelRatio=window.devicePixelRatio||1,this.layout=null,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx&&(this.ctx.fillStyle="#000",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)),this.video=document.createElement("video"),this.video.muted=!0,this.video.autoplay=!0,this.video.playsInline=!0,this.video.addEventListener("enterpictureinpicture",this.onEnterPictureInPicture.bind(this)),this.video.addEventListener("leavepictureinpicture",this.onLeavePictureInPicture.bind(this)),this.tiles=[]}async start(){this.tiles.length?(this.video.srcObject=this.canvas.captureStream(this.fps),document.pictureInPictureElement&&document.exitPictureInPicture(),this.canvas.width=this.layout?.width||50,this.canvas.height=this.layout?.height||33,await this.video.play(),await this.video.requestPictureInPicture(),this.draw()):(0,g.toast)(Bi.t("notifications.noCamera"),{className:"error"})}setTiles(e){this.tiles=e,this.layout=Vs({width:300*this.devicePixelRatio,cellAspectRatio:1.5,tileCount:e.length}),this.started&&this.draw()}onEnterPictureInPicture(){this.started=!0}onLeavePictureInPicture(){this.started=!1,this.video.srcObject=null}draw(){this.ctx&&this.started&&(this.ctx.fillStyle="#1f1f1f",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height),this.tiles.length?(this.tiles.forEach(((e,t)=>{const r=document.body.querySelectorAll(`[data-peer-id='${e.id}'] video`)[0];if(!r)return console.warn(`MultiPiP: No video found for peer ${e.id}`);const n=this.layout?.tileRects[t];if(!n)return;this.ctx?.save();const{videoWidth:i,videoHeight:a}=r,{width:o,height:s}=n.bounds,c=Math.max(o/i,s/a),l=i/(i*c/o),d=a/(a*c/s),u=.5*(i-l),p=.5*(a-d),h=n.origin.x+5,f=n.origin.y+5,m=o-10,g=s-10;this.makeRoundedRect({ctx:this.ctx,x:h,y:f,width:m,height:g,radius:10}),this.ctx?.clip(),this.ctx?.drawImage(r,u,p,l,d,h,f,m,g),this.ctx?.restore()})),requestAnimationFrame(this.draw.bind(this))):document.exitPictureInPicture())}makeRoundedRect({ctx:e,x:t,y:r,width:n,height:i,radius:a}){e&&(e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+n-a,r),e.quadraticCurveTo(t+n,r,t+n,r+a),e.lineTo(t+n,r+i-a),e.quadraticCurveTo(t+n,r+i,t+n-a,r+i),e.lineTo(t+a,r+i),e.quadraticCurveTo(t,r+i,t,r+i-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath())}},$s=Fi.parse(window.navigator.userAgent);var Ws=()=>{const{t:e}=Li(),{setIsQuickConnectPopupVisible:t,setIsSettingsMenuVisible:n,setIsVirtualBackgroundPopupVisible:i,options:a,muted:s,streaming:c}=(0,Ie.useContext)(is),{streams:l}=us(),[d,u]=(0,Ie.useState)(a.extraSettingsOptions||[]),h=e=>{const{extraOptions:t}=e.detail;u(t)},f=()=>{Hs.start()};(0,Ie.useEffect)((()=>{const e=l.filter((e=>e.webcam)).map((e=>({id:e.id})));Hs.setTiles(e)}),[l]),(0,Ie.useEffect)((()=>(window.addEventListener("streamUISetExtraSettingsOptions",h),()=>{window.removeEventListener("streamUISetExtraSettingsOptions",h)})),[]);const m=(0,Ie.useMemo)((()=>{const l=[{id:"1",items:[{id:"openNewTab",title:e("menu.openNewTab"),jsxIcon:(0,o.jsx)(vs,{}),action:()=>{const e=new URL(a.sharedURL||window.location.href),t=s?"0":"1";e.searchParams.set("microphone-enabled",t);const r=c?"1":"0";e.searchParams.set("camera-enabled",r),window.open(e.href,"_blank"),ns.endCall()}}]},{id:"2",items:[{id:"copyLink",title:e("copyLink.title"),jsxIcon:(0,o.jsx)(ys,{}),action:async()=>{try{await ps(a.sharedURL||window.location.href),r(g)(e("copyLink.copied"),{duration:2e3})}catch(t){console.warn(t),r(g)(e("copyLink.error"),{className:"error"})}}},{id:"quickConnect",title:e("quickConnect.title"),jsxIcon:(0,o.jsx)(bs,{}),action:()=>{t(!0),p.event("quickConnectClick")}}]},{id:"3",items:[{id:"settings",title:e("settings.title"),jsxIcon:(0,o.jsx)(ws,{}),action:()=>{n(!0)}}]}];return"desktop"===$s.platform.type&&"Blink"===$s.engine.name&&l[2].items.unshift({id:"virtualBackground",title:e("virtualBackground.title"),jsxIcon:(0,o.jsx)(ks,{}),action:()=>{i(!0)}}),document.pictureInPictureEnabled&&"desktop"===$s.platform.type&&l[0].items.push({id:"pip",title:e("menu.pictureInPicture"),jsxIcon:(0,o.jsx)(Ss,{}),action:f}),l}),[s,c,a.sharedURL,t,n,i,e]);return(0,o.jsxs)(Is,{children:[(0,o.jsxs)(Ls,{children:[(0,o.jsx)(gs,{size:a.logo?.size}),a.logo?.text&&(0,o.jsx)(Ds,{children:a.logo.text})]}),(0,o.jsx)(Us,{baseCategories:m,extraCategories:d})]})};Ie=a("85Hg2"),Ie=a("85Hg2");const qs=e=>{const[t,r]=(0,Ie.useState)([0,0]);return(0,Ie.useLayoutEffect)((()=>{if(e){const t=new ResizeObserver((()=>r([e?.offsetWidth||0,e?.offsetHeight||0])));return t.observe(e),()=>t.unobserve(e)}}),[e]),t},Gs={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Zs(){const[e,t]=(0,Ie.useState)(null),[r,n]=(0,Ie.useState)(Gs);return(0,Ie.useLayoutEffect)((()=>{if(!e)return;const t=new ResizeObserver((e=>n(e[0].contentRect)));return t.observe(e),()=>{t.disconnect()}}),[e]),[t,r]}Ie=a("85Hg2");var Ks=({slash:e,redSlash:t,status:r,deviceRequest:n})=>e?(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#fff"}),(0,o.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#fff",stroke:"#d84949",strokeLinecap:"round"})]}):t?(0,o.jsxs)("svg",{width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#d84949"}),(0,o.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#d84949",stroke:"#242324",strokeLinecap:"round"})]}):r?(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M6.125 2.176a1.167 1.167 0 0 1 1.72-.082c.211.222.326.517.321.823v1.99a.583.583 0 1 0 1.167 0v-1.99A2.333 2.333 0 0 0 5.25 1.44a.583.583 0 1 0 .875.735Zm4.795 5.565h.117a.583.583 0 0 0 .583-.472c.042-.282.057-.567.046-.852a.584.584 0 0 0-1.166 0c0 .215-.022.43-.064.642a.583.583 0 0 0 .484.682Zm1.75 3.535L2.17.776a.583.583 0 1 0-.829.823l3.325 3.348v1.47a2.333 2.333 0 0 0 3.5 2.018l.852.852A3.5 3.5 0 0 1 3.5 6.417a.583.583 0 0 0-1.167 0 4.667 4.667 0 0 0 4.083 4.626v1.207H5.25a.583.583 0 0 0 0 1.167h3.5a.583.583 0 0 0 0-1.167H7.583v-1.207a4.59 4.59 0 0 0 2.246-.928l1.983 1.984a.584.584 0 0 0 .829-.823h.029ZM7 7.584a1.167 1.167 0 0 1-1.167-1.167v-.303l1.43 1.435A1.015 1.015 0 0 1 7 7.584Z",fill:"#fff"})}):n?(0,o.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M25 13.75a1.25 1.25 0 0 0-2.5 0 7.5 7.5 0 1 1-15 0 1.25 1.25 0 0 0-2.5 0 10 10 0 0 0 8.75 9.913v2.587h-2.5a1.25 1.25 0 0 0 0 2.5h7.5a1.25 1.25 0 0 0 0-2.5h-2.5v-2.587A10 10 0 0 0 25 13.75Z",fill:"url(#microphoneBottom)"}),(0,o.jsx)("path",{d:"M15 18.75a5 5 0 0 0 5-5v-7.5a5 5 0 0 0-10 0v7.5a5 5 0 0 0 5 5Z",fill:"url(#microphoneTop)"})]}):(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M12 15a4 4 0 0 0 4-4V5a4 4 0 1 0-8 0v6a4 4 0 0 0 4 4ZM10 5a2 2 0 1 1 4 0v6a2 2 0 0 1-4 0V5Zm10 6a1 1 0 0 0-2 0 6 6 0 1 1-12 0 1 1 0 1 0-2 0 8 8 0 0 0 7 7.93V21H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.07A8 8 0 0 0 20 11Z",fill:"#fff"})});var Ys=({slash:e,status:t,deviceRequest:r})=>e?(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M21.53 7.15a1 1 0 0 0-1 0L17 8.89A3 3 0 0 0 14 6H5a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h9a3 3 0 0 0 3-2.89l3.56 1.78A1 1 0 0 0 21 17a1 1 0 0 0 .875-.514A1 1 0 0 0 22 16V8a1 1 0 0 0-.47-.85ZM15 15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v6Zm5-.62-3-1.5v-1.76l3-1.5v4.76Z",fill:"#fff"}),(0,o.jsx)("path",{d:"M4.005 1.53A1.75 1.75 0 1 0 1.53 4.005l19.446 19.446a1.75 1.75 0 1 0 2.475-2.475L4.005 1.53Z",fill:"#fff",stroke:"#d84949",strokeLinecap:"round"})]}):t?(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M4.497 3.669 2.164 1.336a.586.586 0 1 0-.828.828L2.695 3.5a1.75 1.75 0 0 0-1.529 1.75v3.5a1.75 1.75 0 0 0 1.75 1.75h5.25a1.75 1.75 0 0 0 1.109-.403l2.56 2.567a.583.583 0 0 0 .957-.19.582.582 0 0 0-.128-.638L4.497 3.669Zm3.67 5.664h-5.25a.583.583 0 0 1-.584-.583v-3.5a.583.583 0 0 1 .583-.584h.928l4.59 4.597a.583.583 0 0 1-.268.07Zm4.392-5.162a.583.583 0 0 0-.583 0l-2.06 1.015A1.75 1.75 0 0 0 8.166 3.5h-.781a.583.583 0 0 0 0 1.166h.781a.583.583 0 0 1 .584.584v.875a.944.944 0 0 0 0 .11.38.38 0 0 0 .029.117s.03.035.04.059a.584.584 0 0 0 .088.122s.059.035.088.058l.099.065c.044.006.09.006.134 0a.41.41 0 0 0 .082 0 .949.949 0 0 0 .11 0 .38.38 0 0 0 .117-.03l2.13-1.015v3.337a.583.583 0 0 0 1.166 0V4.666a.584.584 0 0 0-.274-.495Z",fill:"#fff"})}):r?(0,o.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M26.54 8.438c.23 0 .456.06.656.176a1.315 1.315 0 0 1 .617 1.117v10.517a1.318 1.318 0 0 1-.617 1.117 1.31 1.31 0 0 1-.696.198 1.31 1.31 0 0 1-.578-.145l-4.672-2.34v-8.177l4.633-2.287c.2-.116.426-.177.656-.177Z",fill:"url(#cameraRight)"}),(0,o.jsx)("path",{d:"M20.104 8.55a3.75 3.75 0 0 1 1.146 2.563v7.775A3.75 3.75 0 0 1 17.5 22.5H6.25a3.75 3.75 0 0 1-3.75-3.75v-7.5A3.75 3.75 0 0 1 6.25 7.5H17.5a3.75 3.75 0 0 1 2.604 1.05Z",fill:"url(#cameraLeft)"})]}):(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M21.53 7.15a1 1 0 0 0-1 0L17 8.89A3 3 0 0 0 14 6H5a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h9a3 3 0 0 0 3-2.89l3.56 1.78A1 1 0 0 0 21 17a1 1 0 0 0 .875-.514A1 1 0 0 0 22 16V8a1 1 0 0 0-.47-.85ZM15 15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v6Zm5-.62-3-1.5v-1.76l3-1.5v4.76Z",fill:"#fff"})});const Qs=yr.path`
|
|
439
439
|
fill: ${e=>e.white?"#fff":e.theme.controlsIconColor};
|
|
440
|
-
`,
|
|
440
|
+
`,Js=yr.path`
|
|
441
441
|
fill: ${e=>e.white?"#fff":e.theme.controlsIconColor};
|
|
442
442
|
stroke: ${e=>e.white?"#fff":e.theme.controlsIconColor};
|
|
443
|
-
`;var
|
|
443
|
+
`;var Xs=({arrow:e,white:t,deviceRequest:r})=>r?(0,o.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M6.25 3.75h17.5A3.75 3.75 0 0 1 27.5 7.5v10a3.75 3.75 0 0 1-3.75 3.75H6.25A3.75 3.75 0 0 1 2.5 17.5v-10a3.75 3.75 0 0 1 3.75-3.75Z",fill:"url(#screenTop)"}),(0,o.jsx)("path",{d:"M13.75 23.75v-2.5h2.5v2.5h5a1.25 1.25 0 0 1 0 2.5H8.75a1.25 1.25 0 0 1 0-2.5h5Z",fill:"url(#screenBottom)"})]}):(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)(Qs,{d:"M19 3H5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h6v2H7a1 1 0 0 0 0 2h10a1 1 0 0 0 0-2h-4v-2h6a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3Zm1 11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v8Z",white:t}),e&&(0,o.jsx)(Js,{d:"m12.443 7.054-.002-.002a.625.625 0 0 0-.205-.13.624.624 0 0 0-.473 0 .625.625 0 0 0-.205.13l-.002.002-2.498 2.501a.627.627 0 0 0 .887.887l1.43-1.436V12.5a.625.625 0 1 0 1.25 0V9.006l1.429 1.436a.626.626 0 0 0 1.023-.684.627.627 0 0 0-.136-.203l-2.498-2.5Z",strokeWidth:".25",white:t})]});const ec=yr.circle`
|
|
444
444
|
stroke: ${({theme:e})=>e.primaryColor};
|
|
445
|
-
`,
|
|
446
|
-
stroke: ${({theme:e})=>
|
|
447
|
-
`,
|
|
445
|
+
`,tc=yr.circle`
|
|
446
|
+
stroke: ${({theme:e})=>rc(e.primaryColor,.7683870967741935)};
|
|
447
|
+
`,rc=(e,t)=>{const r=e.slice(1,3),n=e.slice(3,5),i=e.slice(5,7);return`rgba(${parseInt(r,16)}, ${parseInt(n,16)}, ${parseInt(i,16)}, ${t})`};var nc=()=>(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",background:"0 0",display:"block",shapeRendering:"auto",maxWidth:"200px",maxHeight:"200px"},width:"100%",height:"100%",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",children:[(0,o.jsxs)(ec,{cx:"50",cy:"50",r:"0",fill:"none",children:[(0,o.jsx)("animate",{attributeName:"r",repeatCount:"indefinite",dur:"1.25s",values:"0;28",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"0s"}),(0,o.jsx)("animate",{attributeName:"opacity",repeatCount:"indefinite",dur:"1.25s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"0s"})]}),(0,o.jsxs)(tc,{cx:"50",cy:"50",r:"0",fill:"none",children:[(0,o.jsx)("animate",{attributeName:"r",repeatCount:"indefinite",dur:"1.25s",values:"0;28",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:"-0.625s"}),(0,o.jsx)("animate",{attributeName:"opacity",repeatCount:"indefinite",dur:"1.25s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:"-0.625s"})]})]});var ic=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M15.71 12.71a6 6 0 1 0-7.42 0 10 10 0 0 0-6.22 8.18 1.006 1.006 0 1 0 2 .22 8 8 0 0 1 15.9 0 1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1 10 10 0 0 0-6.25-8.19ZM12 12a4 4 0 1 1 0-8 4 4 0 0 1 0 8Z",fill:"#fff"})});const ac=yr.div`
|
|
448
448
|
display: flex;
|
|
449
449
|
flex: 1;
|
|
450
450
|
flex-direction: ${e=>e.direction};
|
|
@@ -452,7 +452,7 @@ to {
|
|
|
452
452
|
padding: 0 10px;
|
|
453
453
|
position: relative;
|
|
454
454
|
overflow: hidden;
|
|
455
|
-
`,
|
|
455
|
+
`,oc=yr.div`
|
|
456
456
|
display: flex;
|
|
457
457
|
width: ${e=>e.audioTiles?"100%":"landscape"===e.orientation&&e.reduced?"20%":"100%"};
|
|
458
458
|
height: ${e=>e.audioTiles?"100%":"portrait"===e.orientation&&e.reduced?"50%":"100%"};
|
|
@@ -462,7 +462,7 @@ to {
|
|
|
462
462
|
align-content: center;
|
|
463
463
|
gap: ${e=>e.audioTiles?"48px":"15px"};
|
|
464
464
|
overflow: scroll;
|
|
465
|
-
`,
|
|
465
|
+
`,sc=yr.div`
|
|
466
466
|
display: flex;
|
|
467
467
|
justify-content: center;
|
|
468
468
|
align-items: center;
|
|
@@ -474,7 +474,7 @@ to {
|
|
|
474
474
|
box-sizing: border-box;
|
|
475
475
|
max-height: 100%;
|
|
476
476
|
cursor: ${e=>e.cursor?e.cursor:"default"};
|
|
477
|
-
`,
|
|
477
|
+
`,cc=yr.video`
|
|
478
478
|
position: absolute;
|
|
479
479
|
top: 0;
|
|
480
480
|
left: 0;
|
|
@@ -484,14 +484,14 @@ to {
|
|
|
484
484
|
border-radius: inherit;
|
|
485
485
|
transform: ${e=>e.mirror?"scale(-1, 1)":"none"};
|
|
486
486
|
z-index: ${e=>e.zIndex?e.zIndex:"unset"};
|
|
487
|
-
`,
|
|
487
|
+
`,lc=yr.div`
|
|
488
488
|
display: flex;
|
|
489
489
|
position: absolute;
|
|
490
490
|
top: 8px;
|
|
491
491
|
left: 8px;
|
|
492
492
|
gap: 8px;
|
|
493
493
|
z-index: 15;
|
|
494
|
-
`,
|
|
494
|
+
`,dc=yr.div`
|
|
495
495
|
display: flex;
|
|
496
496
|
justify-content: center;
|
|
497
497
|
align-items: center;
|
|
@@ -499,7 +499,7 @@ to {
|
|
|
499
499
|
height: 26px;
|
|
500
500
|
border-radius: 50%;
|
|
501
501
|
background-color: rgba(28, 32, 36, 0.25);
|
|
502
|
-
`,
|
|
502
|
+
`,uc=yr.div`
|
|
503
503
|
position: absolute;
|
|
504
504
|
display: flex;
|
|
505
505
|
align-items: center;
|
|
@@ -511,7 +511,7 @@ to {
|
|
|
511
511
|
left: 8px;
|
|
512
512
|
color: white;
|
|
513
513
|
z-index: 15;
|
|
514
|
-
`,
|
|
514
|
+
`,pc=yr.span`
|
|
515
515
|
display: inline-block;
|
|
516
516
|
font-size: 11px;
|
|
517
517
|
font-weight: 700;
|
|
@@ -520,7 +520,7 @@ to {
|
|
|
520
520
|
overflow: hidden;
|
|
521
521
|
text-overflow: ellipsis;
|
|
522
522
|
box-sizing: border-box;
|
|
523
|
-
`,
|
|
523
|
+
`,hc=yr.div`
|
|
524
524
|
display: flex;
|
|
525
525
|
justify-content: center;
|
|
526
526
|
align-items: center;
|
|
@@ -537,12 +537,12 @@ to {
|
|
|
537
537
|
width: 8px;
|
|
538
538
|
height: 8px;
|
|
539
539
|
}
|
|
540
|
-
`,
|
|
540
|
+
`,fc=yr.img`
|
|
541
541
|
width: 100%;
|
|
542
542
|
height: 100%;
|
|
543
543
|
border-radius: inherit;
|
|
544
544
|
object-fit: cover;
|
|
545
|
-
`,
|
|
545
|
+
`,mc=yr.div`
|
|
546
546
|
display: flex;
|
|
547
547
|
justify-content: center;
|
|
548
548
|
align-items: center;
|
|
@@ -552,12 +552,12 @@ to {
|
|
|
552
552
|
border-radius: inherit;
|
|
553
553
|
z-index: 10;
|
|
554
554
|
background: ${e=>e.streaming?"linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8))":"none"};
|
|
555
|
-
`,
|
|
555
|
+
`,gc=yr.p`
|
|
556
556
|
text-align: center;
|
|
557
557
|
font-weight: 600;
|
|
558
558
|
font-size: ${e=>"small"===e.size?"12px":"medium"===e.size?"14px":(e.size,"16px")};
|
|
559
559
|
margin: 12px 6px;
|
|
560
|
-
`,
|
|
560
|
+
`,vc=yr.div`
|
|
561
561
|
display: flex;
|
|
562
562
|
max-width: 90%;
|
|
563
563
|
background: rgba(45, 45, 45, 0.5);
|
|
@@ -566,7 +566,7 @@ to {
|
|
|
566
566
|
gap: ${e=>"small"===e.size?"8px":"medium"===e.size?"12px":(e.size,"18px")};
|
|
567
567
|
gap: 18px;
|
|
568
568
|
box-sizing: border-box;
|
|
569
|
-
`,
|
|
569
|
+
`,yc=yr.button`
|
|
570
570
|
display: flex;
|
|
571
571
|
justify-content: center;
|
|
572
572
|
align-items: center;
|
|
@@ -580,7 +580,7 @@ to {
|
|
|
580
580
|
border: 2px solid ${({theme:e})=>e.primaryColor};
|
|
581
581
|
box-sizing: border-box;
|
|
582
582
|
}
|
|
583
|
-
`,
|
|
583
|
+
`,bc=yr.div`
|
|
584
584
|
display: flex;
|
|
585
585
|
justify-content: center;
|
|
586
586
|
align-items: center;
|
|
@@ -588,12 +588,12 @@ to {
|
|
|
588
588
|
height: 56px;
|
|
589
589
|
background-color: #2d2d2d;
|
|
590
590
|
border-radius: 30%;
|
|
591
|
-
`,
|
|
591
|
+
`,wc=yr.span`
|
|
592
592
|
font-size: 26px;
|
|
593
593
|
font-weight: 600;
|
|
594
594
|
line-height: 20px;
|
|
595
595
|
color: #fff;
|
|
596
|
-
`,
|
|
596
|
+
`,xc=(yr.img`
|
|
597
597
|
border: 2px solid #fff;
|
|
598
598
|
border-radius: 8px;
|
|
599
599
|
width: 36px;
|
|
@@ -621,7 +621,7 @@ to {
|
|
|
621
621
|
100% {
|
|
622
622
|
opacity: 0;
|
|
623
623
|
}
|
|
624
|
-
`),
|
|
624
|
+
`),_c=vr`
|
|
625
625
|
0% {
|
|
626
626
|
opacity: 0;
|
|
627
627
|
}
|
|
@@ -631,7 +631,7 @@ to {
|
|
|
631
631
|
100% {
|
|
632
632
|
opacity: 0;
|
|
633
633
|
}
|
|
634
|
-
`,
|
|
634
|
+
`,Sc=vr`
|
|
635
635
|
0% {
|
|
636
636
|
width: 200px;
|
|
637
637
|
height: 200px;
|
|
@@ -640,7 +640,7 @@ to {
|
|
|
640
640
|
width: 88px;
|
|
641
641
|
height: 88px;
|
|
642
642
|
}
|
|
643
|
-
`,
|
|
643
|
+
`,kc=yr.div`
|
|
644
644
|
display: flex;
|
|
645
645
|
position: absolute;
|
|
646
646
|
z-index: 20;
|
|
@@ -648,7 +648,7 @@ to {
|
|
|
648
648
|
bottom: 0;
|
|
649
649
|
cursor: ${e=>e.cursor};
|
|
650
650
|
transition: all 0.4s;
|
|
651
|
-
`,
|
|
651
|
+
`,Cc=yr.div`
|
|
652
652
|
display: flex;
|
|
653
653
|
justify-content: center;
|
|
654
654
|
align-items: center;
|
|
@@ -689,7 +689,7 @@ to {
|
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
`}
|
|
692
|
-
`,
|
|
692
|
+
`,Ec=yr.div`
|
|
693
693
|
display: flex;
|
|
694
694
|
flex-direction: column;
|
|
695
695
|
justify-content: center;
|
|
@@ -709,7 +709,7 @@ to {
|
|
|
709
709
|
border-color: ${e.theme.primaryColor};
|
|
710
710
|
}
|
|
711
711
|
`} 1.3s infinite;
|
|
712
|
-
`,
|
|
712
|
+
`,Rc=yr.div`
|
|
713
713
|
display: flex;
|
|
714
714
|
justify-content: center;
|
|
715
715
|
align-items: center;
|
|
@@ -717,18 +717,18 @@ to {
|
|
|
717
717
|
border-radius: 50%;
|
|
718
718
|
width: 62px;
|
|
719
719
|
height: 62px;
|
|
720
|
-
`,
|
|
720
|
+
`,Pc=yr.span`
|
|
721
721
|
font-size: 16px;
|
|
722
722
|
font-weight: 700;
|
|
723
723
|
max-width: 60%;
|
|
724
724
|
line-height: 18px;
|
|
725
725
|
text-align: center;
|
|
726
726
|
margin: 8px 0;
|
|
727
|
-
`,
|
|
727
|
+
`,Tc=yr.div`
|
|
728
728
|
display: flex;
|
|
729
729
|
gap: 10px;
|
|
730
730
|
margin-top: 15px;
|
|
731
|
-
`,
|
|
731
|
+
`,jc=yr.button`
|
|
732
732
|
background-color: ${e=>e.active?e.theme.primaryColor:"transparent"};
|
|
733
733
|
border: 2px solid ${({theme:e})=>e.primaryColor};
|
|
734
734
|
border-radius: 50px;
|
|
@@ -741,7 +741,7 @@ to {
|
|
|
741
741
|
&:hover {
|
|
742
742
|
background-color: ${({theme:e})=>e.primaryColor};
|
|
743
743
|
}
|
|
744
|
-
`,
|
|
744
|
+
`,Oc=yr.button`
|
|
745
745
|
display: flex;
|
|
746
746
|
justify-content: center;
|
|
747
747
|
align-items: center;
|
|
@@ -753,51 +753,51 @@ to {
|
|
|
753
753
|
background-color: rgba(28, 32, 36, 0.5);
|
|
754
754
|
color: #fff;
|
|
755
755
|
z-index: 20;
|
|
756
|
-
`,
|
|
756
|
+
`,Mc=yr.div`
|
|
757
757
|
display: flex;
|
|
758
758
|
flex-direction: column;
|
|
759
759
|
justify-content: space-between;
|
|
760
760
|
width: 100%;
|
|
761
761
|
height: 100%;
|
|
762
|
-
`,
|
|
762
|
+
`,Ic=yr.div`
|
|
763
763
|
display: flex;
|
|
764
764
|
flex-direction: row;
|
|
765
765
|
justify-content: space-between;
|
|
766
766
|
padding: 16px;
|
|
767
|
-
`,
|
|
767
|
+
`,Lc=yr.div`
|
|
768
768
|
position: absolute;
|
|
769
769
|
width: 100%;
|
|
770
770
|
height: 100%;
|
|
771
771
|
background-color: ${e=>e.show?"rgba(0, 0, 0, 0.75)":"transparent"};
|
|
772
772
|
transition: all ${({show:e})=>e?"0.2s":"0.66s"};
|
|
773
773
|
z-index: ${({show:e})=>e?16:-1};
|
|
774
|
-
`,
|
|
774
|
+
`,Dc=yr.div`
|
|
775
775
|
position: absolute;
|
|
776
776
|
width: 100%;
|
|
777
777
|
height: 100%;
|
|
778
778
|
background-color: #fff;
|
|
779
779
|
border-radius: 20px;
|
|
780
780
|
z-index: 20;
|
|
781
|
-
animation: ${
|
|
782
|
-
`,
|
|
781
|
+
animation: ${xc} 0.8s;
|
|
782
|
+
`,Ac=yr.img`
|
|
783
783
|
width: 88px;
|
|
784
784
|
height: 88px;
|
|
785
785
|
border: 3px solid #fff;
|
|
786
786
|
border-radius: 15px;
|
|
787
787
|
box-sizing: border-box;
|
|
788
788
|
z-index: 20;
|
|
789
|
-
animation: ${
|
|
790
|
-
`,
|
|
789
|
+
animation: ${_c} 2.5s, ${Sc} 0.3s;
|
|
790
|
+
`,Nc=yr.img`
|
|
791
791
|
border: 2px solid #fff;
|
|
792
792
|
border-radius: 8px;
|
|
793
793
|
width: 36px;
|
|
794
794
|
height: 36px;
|
|
795
|
-
`,
|
|
795
|
+
`,Bc=yr(uc)`
|
|
796
796
|
padding: 5px 10px;
|
|
797
797
|
font-size: 11px;
|
|
798
798
|
font-weight: 700;
|
|
799
799
|
line-height: 13px;
|
|
800
|
-
`,
|
|
800
|
+
`,Fc=yr.div`
|
|
801
801
|
display: flex;
|
|
802
802
|
align-items: center;
|
|
803
803
|
font-size: 18px;
|
|
@@ -807,12 +807,12 @@ to {
|
|
|
807
807
|
width: 12px;
|
|
808
808
|
height: 12px;
|
|
809
809
|
}
|
|
810
|
-
`;var
|
|
810
|
+
`;var zc=({stream:e,width:t=0,height:n=0})=>{const{t:i}=Li(),a=(0,Ie.useRef)(null),[s,c]=(0,Ie.useState)(!1),[l,d]=(0,Ie.useState)(null),[u,p]=(0,Ie.useState)(!1),h=(0,Ie.useRef)(null),{selfPeerId:f}=(0,Ie.useContext)(is),{highlightedTile:m}=us(),v="screenshare"===m?.type&&m.peerId===f,y=e.microphone&&!e.muted,b=!l&&s&&!m&&(!y||!e.webcam||!v),w=`${t}px`,x=`${n}px`,_=(S=t)<200?"small":S<300?"medium":"large";var S;return(0,Ie.useEffect)((()=>{if(!a.current)throw new Error("videoElementRef not available");e.webcam&&a.current?ns.requestVideo({mediaId:e.webcam,element:a.current}):e.webcam||(a.current.srcObject=null)}),[e.webcam]),(0,Ie.useEffect)((()=>{if(l)return h.current&&clearTimeout(h.current),h.current=setTimeout((()=>{d(null),r(g)(i("requestDevice.timedOut"),{className:"error"})}),2e4),()=>{h.current&&clearTimeout(h.current)};c(!1)}),[l,i]),(0,Ie.useEffect)((()=>{const t=t=>{const{peerId:n,result:a}=t.detail.result;if(n===e.id&&(h.current&&clearTimeout(h.current),d(null),!0!==a)){let t=i("requestDevice.declined");e.profile.name&&(t=i("requestDevice.userDeclined",{user:e.profile.name})),r(g)(t,{className:"error"})}};return ns.addEventListener("requestDeviceResult",t),()=>{ns.removeEventListener("requestDeviceResult",t)}}),[e.id,e.profile,i]),(0,Ie.useEffect)((()=>{const t=async t=>{const{peerId:r}=t.detail,{type:n}=t.detail.event;"snapshot"===n&&r===e.id&&p(!0)};return ns.addEventListener("customMessage",t),()=>{ns.removeEventListener("customMessage",t)}}),[e.id]),(0,o.jsxs)(sc,{onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{width:w,height:x},border:!e.webcam,activeBorder:b||e.isSpeaking,cursor:b?"pointer":"default","data-peer-id":e.id,children:[(0,o.jsx)(cc,{ref:a,style:{maxHeight:"100%"},autoPlay:!0,playsInline:!0,muted:!0}),u&&(0,o.jsx)(Dc,{onAnimationEnd:()=>p(!1)}),!b&&(0,o.jsxs)(lc,{children:[!y&&(0,o.jsx)(dc,{children:(0,o.jsx)(Ks,{status:!0})}),!e.webcam&&(0,o.jsx)(dc,{children:(0,o.jsx)(Ys,{status:!0})})]}),l&&(0,o.jsx)(mc,{streaming:Boolean(e.webcam),children:(0,o.jsx)(nc,{})}),b&&(0,o.jsxs)(mc,{streaming:Boolean(e.webcam),children:[(0,o.jsx)(gc,{size:_,children:i("requestDevice.requestInput")}),(0,o.jsxs)(vc,{size:_,children:[!y&&(0,o.jsx)(yc,{onClick:()=>{ns.requestPeerDevice(e.id,"microphone"),d("microphone")},size:_,children:(0,o.jsx)(Ks,{deviceRequest:!0})}),!e.webcam&&(0,o.jsx)(yc,{onClick:()=>{ns.requestPeerDevice(e.id,"webcam"),d("webcam")},size:_,children:(0,o.jsx)(Ys,{deviceRequest:!0})}),!v&&(0,o.jsx)(yc,{onClick:()=>{ns.requestPeerDevice(e.id,"screen"),d("screen")},size:_,children:(0,o.jsx)(Xs,{deviceRequest:!0})})]})]}),!l&&!b&&!e.webcam&&(0,o.jsx)(mc,{children:(0,o.jsx)(bc,{children:e.profile.image?(0,o.jsx)(fc,{src:e.profile.image}):e.profile.name?(0,o.jsx)(wc,{children:e.profile.name.slice(0,1).toUpperCase()}):(0,o.jsx)(ic,{})})}),!b&&(0,o.jsxs)(uc,{children:[(0,o.jsx)(hc,{children:e.profile.image?(0,o.jsx)(fc,{src:e.profile.image}):e.profile.name?(0,o.jsx)("span",{children:e.profile.name.slice(0,1).toUpperCase()}):(0,o.jsx)(ic,{})}),(0,o.jsx)(pc,{children:e.profile.name||i("misc.user")})]})]})};Ie=a("85Hg2");const Uc=yr.div`
|
|
811
811
|
display: flex;
|
|
812
812
|
flex-direction: column;
|
|
813
813
|
align-items: center;
|
|
814
814
|
border-radius: 14px;
|
|
815
|
-
`,
|
|
815
|
+
`,Vc=yr.div`
|
|
816
816
|
display: flex;
|
|
817
817
|
justify-content: center;
|
|
818
818
|
align-items: center;
|
|
@@ -821,7 +821,7 @@ to {
|
|
|
821
821
|
background-color: #131313;
|
|
822
822
|
border-radius: inherit;
|
|
823
823
|
position: relative;
|
|
824
|
-
|
|
824
|
+
`,Hc=(yr.img`
|
|
825
825
|
width: 100%;
|
|
826
826
|
height: 100%;
|
|
827
827
|
border-radius: inherit;
|
|
@@ -842,13 +842,13 @@ to {
|
|
|
842
842
|
svg {
|
|
843
843
|
height: 12px;
|
|
844
844
|
}
|
|
845
|
-
`)
|
|
845
|
+
`),$c=yr.span`
|
|
846
846
|
font-size: 14px;
|
|
847
847
|
font-weight: 600;
|
|
848
848
|
line-height: 15px;
|
|
849
849
|
margin-top: 14px;
|
|
850
850
|
color: #fff;
|
|
851
|
-
`;var qc=({stream:e})=>{const{selfPeerId:t}=(0,Ie.useContext)(as),r=t===e.id,n=(e.microphone||r)&&!e.muted;return(0,o.jsxs)(Vc,{children:[(0,o.jsxs)(Hc,{children:[e.profile.name&&(0,o.jsx)(xc,{children:e.profile.name.slice(0,1).toUpperCase()}),!e.profile.name&&(0,o.jsx)(ac,{}),(0,o.jsx)($c,{children:(0,o.jsx)(Ys,{redSlash:!n})})]}),(0,o.jsx)(Wc,{children:e.profile.name})]})};Ie=a("85Hg2");var Gc=()=>(0,o.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M9.625 5.042a.917.917 0 0 0-.917.916v1.458L3.401 2.099a.92.92 0 0 0-1.302 1.302l5.317 5.307H5.958a.917.917 0 0 0 0 1.834h3.667a.917.917 0 0 0 .348-.074.917.917 0 0 0 .495-.495.917.917 0 0 0 .074-.348V5.958a.917.917 0 0 0-.917-.916Zm10.276 13.557-5.317-5.307h1.458a.917.917 0 0 0 0-1.834h-3.667a.917.917 0 0 0-.348.074.916.916 0 0 0-.495.495.917.917 0 0 0-.074.348v3.667a.917.917 0 0 0 1.834 0v-1.458l5.307 5.317a.915.915 0 0 0 1.302 0 .915.915 0 0 0 0-1.302Z",fill:"#fff"})});var Zc=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"m13.41 12 6.3-6.29a1.004 1.004 0 0 0-1.42-1.42L12 10.59l-6.29-6.3a1.004 1.004 0 1 0-1.42 1.42l6.3 6.29-6.3 6.29a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l6.29-6.3 6.29 6.3a1.001 1.001 0 0 0 1.639-.325 1 1 0 0 0-.22-1.095L13.41 12Z",fill:"#fff"})});const Kc=()=>(0,o.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M18.333 9.625a.916.916 0 0 0-.916.916v6.417a.917.917 0 0 1-.917.917H3.667a.917.917 0 0 1-.917-.917V9.625a.917.917 0 0 1 .917-.917H5.5a.917.917 0 0 0 .917-.623l.495-1.504a.917.917 0 0 1 .87-.623h5.051a.917.917 0 1 0 0-1.833H7.737a2.75 2.75 0 0 0-2.604 1.879l-.293.917H3.667a2.75 2.75 0 0 0-2.75 2.75v7.333a2.75 2.75 0 0 0 2.75 2.75H16.5a2.75 2.75 0 0 0 2.75-2.75v-6.417a.916.916 0 0 0-.917-.962Zm-8.25-.917a3.667 3.667 0 1 0 0 7.333 3.667 3.667 0 0 0 0-7.333Zm0 5.5a1.834 1.834 0 1 1 0-3.667 1.834 1.834 0 0 1 0 3.667ZM20.167 4.125h-.917v-.917a.917.917 0 0 0-1.833 0v.917H16.5a.917.917 0 1 0 0 1.833h.917v.917a.916.916 0 1 0 1.833 0v-.917h.917a.917.917 0 0 0 0-1.833Z",fill:"#fff"})}),Yc=({availableWidth:e,availableHeight:t,numberOfTiles:r,ratio:n})=>{let i=0;for(let a=50,o=5e3;a<o&&(i=Math.floor((o+a)/2),i!==a);){const s=Math.floor(e/i);Math.ceil(r/s)*(i*n)<t?a=i:o=i}return i},Qc=({containerWidth:e,containerHeight:t,minimumWidth:r,maximumWidth:n,orientation:i,extended:a})=>{const o=e/100*20,s=e/100*30,c=e-20;if("landscape"===i){const e={width:1,height:1};if(a){const r=t/e.height*e.width;return r>c?c:r}return o<r?r:o>n?n:o}return"portrait"===i?a?c:s<r?r:s>n?n:s:0};Ie=a("85Hg2");var Jc=({device:e,requesterId:t,setExtended:r,setDeviceRequest:n})=>{const{t:i}=Li(),{streams:a}=ps(),[s,c]=(0,Ie.useState)(!1),l=a.find((e=>e.id===t)),d=(e=>"microphone"===e?Ys:"webcam"===e?Qs:"screen"===e?ec:Ys)(e),u={microphone:i("misc.microphone"),webcam:i("misc.camera"),screen:i("misc.screen")};return(0,Ie.useEffect)((()=>{r(!0)}),[r]),(0,o.jsx)(Rc,{children:s?(0,o.jsx)(ic,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Pc,{children:(0,o.jsx)(d,{deviceRequest:!0})}),(0,o.jsx)(Tc,{children:i("requestDevice.request",{user:l?.profile?.name||i("misc.someone"),device:u[e]})}),(0,o.jsxs)(jc,{children:[(0,o.jsx)(Oc,{onClick:async()=>{if(r(!1),c(!0),"microphone"===e){const{microphone:e}=is.getDevicesState();e.enabled?await is.unMuteMicrophone():await is.enableMicrophone()}else if("webcam"===e)await is.enableVideo();else if("screen"===e)return n(null),void await is.enableScreenshare();c(!1),n(null)},active:!0,children:i("misc.accept")}),(0,o.jsx)(Oc,{onClick:()=>{r(!1),n(null),is.denyDeviceRequest(e)},children:i("misc.decline")})]})]})})};const Xc=({mouseDownEvent:e,targetElement:t,containerElement:r})=>{let n=0,i=0,a=0;e.nativeEvent instanceof MouseEvent?(i=e.nativeEvent.clientX,a=e.nativeEvent.clientY):e.nativeEvent instanceof TouchEvent&&(i=e.nativeEvent.touches[0]?.clientX,a=e.nativeEvent.touches[0]?.clientY);const o=t.getBoundingClientRect(),s=i-o.left,c=a-o.top+60;t&&(t.style.transition="none");const l=e=>{e.stopPropagation(),window.removeEventListener("click",l,!0)},d=e=>{let i=0,a=0;if(e instanceof MouseEvent?(i=e.pageX,a=e.pageY):e instanceof TouchEvent&&(i=e.touches[0]?.pageX,a=e.touches[0]?.pageY),n+=1,t&&r){let e=i-s,n=a-c;e<0&&(e=0),n<0&&(n=0),e>r.clientWidth-t.offsetWidth&&(e=r.clientWidth-t.offsetWidth),n>r.clientHeight-t.offsetHeight&&(n=r.clientHeight-t.offsetHeight),t.style.left=`${e}px`,t.style.top=`${n}px`}},u=e=>{if(n>6&&e instanceof MouseEvent&&window.addEventListener("click",l,!0),t&&r){t.style.transition="all 0.4s",delete t.dataset.top,delete t.dataset.right,delete t.dataset.bottom,delete t.dataset.left;const e=r.getBoundingClientRect(),n=t.getBoundingClientRect(),i=(n.left+n.width/2-e.left)/e.width*100,a=(n.top+n.height/2-e.top)/e.height*100;a>=50&&(t.dataset.bottom="true",t.style.top=e.height-n.height+"px"),a<50&&(t.dataset.top="true",t.style.top="0"),i>=50&&(t.dataset.right="true",t.style.left=e.width-n.width-10+"px"),i<50&&(t.dataset.left="true",t.style.left="10px")}document.removeEventListener("mousemove",d),document.removeEventListener("touchmove",d),document.removeEventListener("mouseup",u),document.removeEventListener("touchend",u)};document.addEventListener("mousemove",d),document.addEventListener("touchmove",d),document.addEventListener("mouseup",u),document.addEventListener("touchend",u)},el=({element:e})=>{const t={top:"unset",right:"unset",bottom:"unset",left:"unset"},{top:r,right:n,bottom:i,left:a}=e.dataset;(r||n||i||a)&&(r&&(t.top="0"),n&&(t.right="10px"),i&&(t.bottom="0"),a&&(t.left="10px"),e.style.top=t.top,e.style.right=t.right,e.style.bottom=t.bottom,e.style.left=t.left)};Ie=a("85Hg2");var tl=()=>{const{t:e}=Li(),{muted:t,streaming:n}=(0,Ie.useContext)(as);return(0,Ie.useEffect)((()=>{navigator.mediaSession?.setMicrophoneActive?.(!t),navigator.mediaSession?.setCameraActive?.(n)}),[t,n]),(0,Ie.useEffect)((()=>{try{navigator.mediaSession.setActionHandler("togglemicrophone",(async()=>{try{is.getDevicesState().microphone.enabled?await is.toggleMute():await is.enableMicrophone()}catch(t){console.warn(t),r(g)(`${e("notifications.microphoneError")} (PiP)`,{className:"error"})}}))}catch(e){console.warn("MediaSession togglemicrophone action is not available")}try{navigator.mediaSession.setActionHandler("togglecamera",(async()=>{try{is.getDevicesState().camera.enabled?await is.disableVideo():await is.enableVideo()}catch(t){console.warn(t),r(g)(`${e("notifications.cameraError")} (PiP)`,{className:"error"})}}))}catch(e){console.warn("MediaSession togglecamera action is not available")}try{navigator.mediaSession.setActionHandler("hangup",(()=>{is.endCall()}))}catch(e){console.warn("MediaSession hangup action is not available")}}),[e]),null};var rl=({isSomeonePresenting:e,width:t,height:n})=>{const{t:i}=Li(),[a,c]=(0,Ie.useState)(!1),[l,d]=(0,Ie.useState)(!1),[u,p]=(0,Ie.useState)(!1),[h,f]=(0,Ie.useState)(null),[m,v]=(0,Ie.useState)("user"),[y,b]=(0,Ie.useState)(!1),[w,x]=(0,Ie.useState)(null),_=(0,Ie.useRef)(null),S=(0,Ie.useRef)(null),k=(0,Ie.useRef)(null),{videosContainerRef:C,remoteTilesContainerRef:E,profile:R,muted:P,streaming:T,orientation:j,options:O}=(0,Ie.useContext)(as),{streams:M}=ps(),[I,L]=Gs(C.current),D=T&&!a?"pointer":"default",A=Qc({containerWidth:I,containerHeight:L,minimumWidth:126,maximumWidth:150,orientation:j,extended:a});let N=`${A}px`,B=`${A}px`;const F=M.length<1,z=e=>{if(!e.detail?.camera?.device)return;if(!_.current)throw new Error("videoElementRef not available");const{facingMode:t}=is.requestLocalVideo(_.current);v(t),S.current=_.current.srcObject,p(is.isVideoZoomAvailable())},U=e=>{const{peerId:t,deviceType:r}=e.detail;k.current&&el({element:k.current}),f({device:r,requesterId:t})},V=e=>{!a&&k.current&&C.current&&Xc({mouseDownEvent:e,targetElement:k.current,containerElement:C.current})};(0,Ie.useEffect)((()=>{if(!_.current)throw new Error("videoElementRef not available");if(T){const{facingMode:e}=is.requestLocalVideo(_.current);v(e),p(is.isVideoZoomAvailable()),S.current=_.current.srcObject}else _.current.srcObject=null,S.current=null,c(!1)}),[T]),(0,Ie.useEffect)((()=>{T&&_.current&&!_.current.srcObject&&(_.current.srcObject=S.current)}),[T,F,e]),(0,Ie.useEffect)((()=>{k.current&&el({element:k.current})}),[I,L]),(0,Ie.useEffect)((()=>{a||(b(!1),x(null))}),[a]),(0,Ie.useEffect)((()=>(is.addEventListener("localVideoChange",z),is.addEventListener("requestDevice",U),()=>{is.removeEventListener("localVideoChange",z),is.removeEventListener("requestDevice",U)})),[]);const H=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tl,{}),(0,o.jsx)(lc,{ref:_,mirror:"user"===m,zIndex:15,autoPlay:!0,playsInline:!0,muted:!0}),h&&(0,o.jsx)(Jc,{device:h.device,requesterId:h.requesterId,setExtended:c,setDeviceRequest:f}),!a&&(0,o.jsxs)(dc,{children:[P&&(0,o.jsx)(uc,{children:(0,o.jsx)(Ys,{status:!0})}),!T&&(0,o.jsx)(uc,{children:(0,o.jsx)(Qs,{status:!0})})]}),!T&&(0,o.jsx)(gc,{children:(0,o.jsxs)(wc,{children:[R.name&&(0,o.jsx)(xc,{children:R.name.slice(0,1).toUpperCase()}),!R.name&&(0,o.jsx)(ac,{})]})}),!a&&(0,o.jsx)(Fc,{children:(0,o.jsx)("span",{children:i("misc.you")})}),a&&(0,o.jsxs)(Ic,{children:[(0,o.jsxs)(Lc,{children:[(0,o.jsx)(Mc,{onClick:()=>{c(!1)},children:(0,o.jsx)(Gc,{})}),w&&(0,o.jsx)(Nc,{src:w,onAnimationEnd:e=>{const t=Sc.getName();e.animationName===t&&x(null)}})]}),(0,o.jsxs)(Lc,{children:[(0,o.jsx)(Mc,{onClick:async()=>{if(!y&&!w){if(!_.current)throw new Error("Video element is not available");b(!0);const e=await is.captureVideo(_.current);x(e);try{const{objectUrl:t}=await fetch(`${O.streamApiURL}/uploadSnapshot`,{method:"POST",body:JSON.stringify({file:e})}).then((e=>e.json()));await is.sendCustomMessageToAll({type:"snapshot",imageSrc:t});let r=i("snapshot.sentToUsers");if(1===M.length){const e=M[0].profile.name||i("misc.user");r=i("snapshot.sentToUser",{user:e})}Dr(r,{icon:(0,o.jsx)(Bc,{src:e}),duration:2500})}catch(e){r(g)(i("snapshot.error"),{className:"error"}),console.error(e)}}},children:(0,o.jsx)(Kc,{})}),u&&(0,o.jsx)(Mc,{onClick:()=>{l?(is.unzoomVideo(),d(!1)):(is.zoomVideo(),d(!0))},children:(0,o.jsxs)(zc,{children:[l?"2":"1",(0,o.jsx)(Zc,{})]})}),(0,o.jsx)("span",{style:{width:"36px"}})]})]})]});return E?.current&&(F||e)?(0,s.createPortal)((0,o.jsx)(cc,{style:{width:`${t}px`,height:`${n}px`},border:!T,children:H}),E.current):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(Cc,{ref:k,style:{width:N,height:B},cursor:D,onClick:()=>{T&&!h&&!a&&k.current&&(el({element:k.current}),c(!0))},onMouseDown:V,onTouchStart:V,children:[y&&(0,o.jsx)(Ac,{onAnimationEnd:()=>b(!1)}),(0,o.jsx)(Ec,{orientation:j,border:!T&&!h,children:H})]}),(0,o.jsx)(Dc,{show:a})]})};Ie=a("85Hg2"),Ie=a("85Hg2");const nl=yr.div`
|
|
851
|
+
`;var Wc=({stream:e})=>{const{selfPeerId:t}=(0,Ie.useContext)(is),r=t===e.id,n=(e.microphone||r)&&!e.muted;return(0,o.jsxs)(Uc,{children:[(0,o.jsxs)(Vc,{children:[e.profile.name&&(0,o.jsx)(wc,{children:e.profile.name.slice(0,1).toUpperCase()}),!e.profile.name&&(0,o.jsx)(ic,{}),(0,o.jsx)(Hc,{children:(0,o.jsx)(Ks,{redSlash:!n})})]}),(0,o.jsx)($c,{children:e.profile.name})]})};Ie=a("85Hg2");var qc=()=>(0,o.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M9.625 5.042a.917.917 0 0 0-.917.916v1.458L3.401 2.099a.92.92 0 0 0-1.302 1.302l5.317 5.307H5.958a.917.917 0 0 0 0 1.834h3.667a.917.917 0 0 0 .348-.074.917.917 0 0 0 .495-.495.917.917 0 0 0 .074-.348V5.958a.917.917 0 0 0-.917-.916Zm10.276 13.557-5.317-5.307h1.458a.917.917 0 0 0 0-1.834h-3.667a.917.917 0 0 0-.348.074.916.916 0 0 0-.495.495.917.917 0 0 0-.074.348v3.667a.917.917 0 0 0 1.834 0v-1.458l5.307 5.317a.915.915 0 0 0 1.302 0 .915.915 0 0 0 0-1.302Z",fill:"#fff"})});var Gc=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"m13.41 12 6.3-6.29a1.004 1.004 0 0 0-1.42-1.42L12 10.59l-6.29-6.3a1.004 1.004 0 1 0-1.42 1.42l6.3 6.29-6.3 6.29a.999.999 0 0 0 0 1.42 1 1 0 0 0 1.42 0l6.29-6.3 6.29 6.3a1.001 1.001 0 0 0 1.639-.325 1 1 0 0 0-.22-1.095L13.41 12Z",fill:"#fff"})});const Zc=()=>(0,o.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M18.333 9.625a.916.916 0 0 0-.916.916v6.417a.917.917 0 0 1-.917.917H3.667a.917.917 0 0 1-.917-.917V9.625a.917.917 0 0 1 .917-.917H5.5a.917.917 0 0 0 .917-.623l.495-1.504a.917.917 0 0 1 .87-.623h5.051a.917.917 0 1 0 0-1.833H7.737a2.75 2.75 0 0 0-2.604 1.879l-.293.917H3.667a2.75 2.75 0 0 0-2.75 2.75v7.333a2.75 2.75 0 0 0 2.75 2.75H16.5a2.75 2.75 0 0 0 2.75-2.75v-6.417a.916.916 0 0 0-.917-.962Zm-8.25-.917a3.667 3.667 0 1 0 0 7.333 3.667 3.667 0 0 0 0-7.333Zm0 5.5a1.834 1.834 0 1 1 0-3.667 1.834 1.834 0 0 1 0 3.667ZM20.167 4.125h-.917v-.917a.917.917 0 0 0-1.833 0v.917H16.5a.917.917 0 1 0 0 1.833h.917v.917a.916.916 0 1 0 1.833 0v-.917h.917a.917.917 0 0 0 0-1.833Z",fill:"#fff"})}),Kc=({availableWidth:e,availableHeight:t,numberOfTiles:r,ratio:n})=>{let i=0;for(let a=50,o=5e3;a<o&&(i=Math.floor((o+a)/2),i!==a);){const s=Math.floor(e/i);Math.ceil(r/s)*(i*n)<t?a=i:o=i}return i},Yc=({containerWidth:e,containerHeight:t,minimumWidth:r,maximumWidth:n,orientation:i,extended:a})=>{const o=e/100*20,s=e/100*30,c=e-20;if("landscape"===i){const e={width:1,height:1};if(a){const r=t/e.height*e.width;return r>c?c:r}return o<r?r:o>n?n:o}return"portrait"===i?a?c:s<r?r:s>n?n:s:0};Ie=a("85Hg2");var Qc=({device:e,requesterId:t,setExtended:r,setDeviceRequest:n})=>{const{t:i}=Li(),{streams:a}=us(),[s,c]=(0,Ie.useState)(!1),l=a.find((e=>e.id===t)),d=(e=>"microphone"===e?Ks:"webcam"===e?Ys:"screen"===e?Xs:Ks)(e),u={microphone:i("misc.microphone"),webcam:i("misc.camera"),screen:i("misc.screen")};return(0,Ie.useEffect)((()=>{r(!0)}),[r]),(0,o.jsx)(Ec,{children:s?(0,o.jsx)(nc,{}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Rc,{children:(0,o.jsx)(d,{deviceRequest:!0})}),(0,o.jsx)(Pc,{children:i("requestDevice.request",{user:l?.profile?.name||i("misc.someone"),device:u[e]})}),(0,o.jsxs)(Tc,{children:[(0,o.jsx)(jc,{onClick:async()=>{if(r(!1),c(!0),"microphone"===e){const{microphone:e}=ns.getDevicesState();e.enabled?await ns.unMuteMicrophone():await ns.enableMicrophone()}else if("webcam"===e)await ns.enableVideo();else if("screen"===e)return n(null),void await ns.enableScreenshare();c(!1),n(null)},active:!0,children:i("misc.accept")}),(0,o.jsx)(jc,{onClick:()=>{r(!1),n(null),ns.denyDeviceRequest(e)},children:i("misc.decline")})]})]})})};const Jc=({mouseDownEvent:e,targetElement:t,containerElement:r})=>{let n=0,i=0,a=0;e.nativeEvent instanceof MouseEvent?(i=e.nativeEvent.clientX,a=e.nativeEvent.clientY):e.nativeEvent instanceof TouchEvent&&(i=e.nativeEvent.touches[0]?.clientX,a=e.nativeEvent.touches[0]?.clientY);const o=t.getBoundingClientRect(),s=i-o.left,c=a-o.top+60;t&&(t.style.transition="none");const l=e=>{e.stopPropagation(),window.removeEventListener("click",l,!0)},d=e=>{let i=0,a=0;if(e instanceof MouseEvent?(i=e.pageX,a=e.pageY):e instanceof TouchEvent&&(i=e.touches[0]?.pageX,a=e.touches[0]?.pageY),n+=1,t&&r){let e=i-s,n=a-c;e<0&&(e=0),n<0&&(n=0),e>r.clientWidth-t.offsetWidth&&(e=r.clientWidth-t.offsetWidth),n>r.clientHeight-t.offsetHeight&&(n=r.clientHeight-t.offsetHeight),t.style.left=`${e}px`,t.style.top=`${n}px`}},u=e=>{if(n>6&&e instanceof MouseEvent&&window.addEventListener("click",l,!0),t&&r){t.style.transition="all 0.4s",delete t.dataset.top,delete t.dataset.right,delete t.dataset.bottom,delete t.dataset.left;const e=r.getBoundingClientRect(),n=t.getBoundingClientRect(),i=(n.left+n.width/2-e.left)/e.width*100,a=(n.top+n.height/2-e.top)/e.height*100;a>=50&&(t.dataset.bottom="true",t.style.top=e.height-n.height+"px"),a<50&&(t.dataset.top="true",t.style.top="0"),i>=50&&(t.dataset.right="true",t.style.left=e.width-n.width-10+"px"),i<50&&(t.dataset.left="true",t.style.left="10px")}document.removeEventListener("mousemove",d),document.removeEventListener("touchmove",d),document.removeEventListener("mouseup",u),document.removeEventListener("touchend",u)};document.addEventListener("mousemove",d),document.addEventListener("touchmove",d),document.addEventListener("mouseup",u),document.addEventListener("touchend",u)},Xc=({element:e})=>{const t={top:"unset",right:"unset",bottom:"unset",left:"unset"},{top:r,right:n,bottom:i,left:a}=e.dataset;(r||n||i||a)&&(r&&(t.top="0"),n&&(t.right="10px"),i&&(t.bottom="0"),a&&(t.left="10px"),e.style.top=t.top,e.style.right=t.right,e.style.bottom=t.bottom,e.style.left=t.left)};Ie=a("85Hg2");var el=()=>{const{t:e}=Li(),{muted:t,streaming:n}=(0,Ie.useContext)(is);return(0,Ie.useEffect)((()=>{navigator.mediaSession?.setMicrophoneActive?.(!t),navigator.mediaSession?.setCameraActive?.(n)}),[t,n]),(0,Ie.useEffect)((()=>{try{navigator.mediaSession.setActionHandler("togglemicrophone",(async()=>{try{ns.getDevicesState().microphone.enabled?await ns.toggleMute():await ns.enableMicrophone()}catch(t){console.warn(t),r(g)(`${e("notifications.microphoneError")} (PiP)`,{className:"error"})}}))}catch(e){console.warn("MediaSession togglemicrophone action is not available")}try{navigator.mediaSession.setActionHandler("togglecamera",(async()=>{try{ns.getDevicesState().camera.enabled?await ns.disableVideo():await ns.enableVideo()}catch(t){console.warn(t),r(g)(`${e("notifications.cameraError")} (PiP)`,{className:"error"})}}))}catch(e){console.warn("MediaSession togglecamera action is not available")}try{navigator.mediaSession.setActionHandler("hangup",(()=>{ns.endCall()}))}catch(e){console.warn("MediaSession hangup action is not available")}}),[e]),null};var tl=({isSomeonePresenting:e,width:t,height:n})=>{const{t:i}=Li(),[a,c]=(0,Ie.useState)(!1),[l,d]=(0,Ie.useState)(!1),[u,p]=(0,Ie.useState)(!1),[h,f]=(0,Ie.useState)(null),[m,v]=(0,Ie.useState)("user"),[y,b]=(0,Ie.useState)(!1),[w,x]=(0,Ie.useState)(null),_=(0,Ie.useRef)(null),S=(0,Ie.useRef)(null),k=(0,Ie.useRef)(null),{videosContainerRef:C,remoteTilesContainerRef:E,profile:R,muted:P,streaming:T,orientation:j,options:O}=(0,Ie.useContext)(is),{streams:M}=us(),[I,L]=qs(C.current),D=T&&!a?"pointer":"default",A=Yc({containerWidth:I,containerHeight:L,minimumWidth:126,maximumWidth:150,orientation:j,extended:a});let N=`${A}px`,B=`${A}px`;const F=M.length<1,z=e=>{if(!e.detail?.camera?.device)return;if(!_.current)throw new Error("videoElementRef not available");const{facingMode:t}=ns.requestLocalVideo(_.current);v(t),S.current=_.current.srcObject,p(ns.isVideoZoomAvailable())},U=e=>{const{peerId:t,deviceType:r}=e.detail;k.current&&Xc({element:k.current}),f({device:r,requesterId:t})},V=e=>{!a&&k.current&&C.current&&Jc({mouseDownEvent:e,targetElement:k.current,containerElement:C.current})};(0,Ie.useEffect)((()=>{if(!_.current)throw new Error("videoElementRef not available");if(T){const{facingMode:e}=ns.requestLocalVideo(_.current);v(e),p(ns.isVideoZoomAvailable()),S.current=_.current.srcObject}else _.current.srcObject=null,S.current=null,c(!1)}),[T]),(0,Ie.useEffect)((()=>{T&&_.current&&!_.current.srcObject&&(_.current.srcObject=S.current)}),[T,F,e]),(0,Ie.useEffect)((()=>{k.current&&Xc({element:k.current})}),[I,L]),(0,Ie.useEffect)((()=>{a||(b(!1),x(null))}),[a]),(0,Ie.useEffect)((()=>(ns.addEventListener("localVideoChange",z),ns.addEventListener("requestDevice",U),()=>{ns.removeEventListener("localVideoChange",z),ns.removeEventListener("requestDevice",U)})),[]);const H=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(el,{}),(0,o.jsx)(cc,{ref:_,mirror:"user"===m,zIndex:15,autoPlay:!0,playsInline:!0,muted:!0}),h&&(0,o.jsx)(Qc,{device:h.device,requesterId:h.requesterId,setExtended:c,setDeviceRequest:f}),!a&&(0,o.jsxs)(lc,{children:[P&&(0,o.jsx)(dc,{children:(0,o.jsx)(Ks,{status:!0})}),!T&&(0,o.jsx)(dc,{children:(0,o.jsx)(Ys,{status:!0})})]}),!T&&(0,o.jsx)(mc,{children:(0,o.jsxs)(bc,{children:[R.name&&(0,o.jsx)(wc,{children:R.name.slice(0,1).toUpperCase()}),!R.name&&(0,o.jsx)(ic,{})]})}),!a&&(0,o.jsx)(Bc,{children:(0,o.jsx)("span",{children:i("misc.you")})}),a&&(0,o.jsxs)(Mc,{children:[(0,o.jsxs)(Ic,{children:[(0,o.jsx)(Oc,{onClick:()=>{c(!1)},children:(0,o.jsx)(qc,{})}),w&&(0,o.jsx)(Ac,{src:w,onAnimationEnd:e=>{const t=_c.getName();e.animationName===t&&x(null)}})]}),(0,o.jsxs)(Ic,{children:[(0,o.jsx)(Oc,{onClick:async()=>{if(!y&&!w){if(!_.current)throw new Error("Video element is not available");b(!0);const e=await ns.captureVideo(_.current);x(e);try{const{objectUrl:t}=await fetch(`${O.streamApiURL}/uploadSnapshot`,{method:"POST",body:JSON.stringify({file:e})}).then((e=>e.json()));await ns.sendCustomMessageToAll({type:"snapshot",imageSrc:t});let r=i("snapshot.sentToUsers");if(1===M.length){const e=M[0].profile.name||i("misc.user");r=i("snapshot.sentToUser",{user:e})}Dr(r,{icon:(0,o.jsx)(Nc,{src:e}),duration:2500})}catch(e){r(g)(i("snapshot.error"),{className:"error"}),console.error(e)}}},children:(0,o.jsx)(Zc,{})}),u&&(0,o.jsx)(Oc,{onClick:()=>{l?(ns.unzoomVideo(),d(!1)):(ns.zoomVideo(),d(!0))},children:(0,o.jsxs)(Fc,{children:[l?"2":"1",(0,o.jsx)(Gc,{})]})}),(0,o.jsx)("span",{style:{width:"36px"}})]})]})]});return E?.current&&(F||e)?(0,s.createPortal)((0,o.jsx)(sc,{style:{width:`${t}px`,height:`${n}px`},border:!T,children:H}),E.current):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(kc,{ref:k,style:{width:N,height:B},cursor:D,onClick:()=>{T&&!h&&!a&&k.current&&(Xc({element:k.current}),c(!0))},onMouseDown:V,onTouchStart:V,children:[y&&(0,o.jsx)(Dc,{onAnimationEnd:()=>b(!1)}),(0,o.jsx)(Cc,{orientation:j,border:!T&&!h,children:H})]}),(0,o.jsx)(Lc,{show:a})]})};Ie=a("85Hg2"),Ie=a("85Hg2");const rl=yr.div`
|
|
852
852
|
display: flex;
|
|
853
853
|
justify-content: center;
|
|
854
854
|
align-items: center;
|
|
@@ -856,30 +856,30 @@ to {
|
|
|
856
856
|
height: 100%;
|
|
857
857
|
color: #cbcbcb;
|
|
858
858
|
box-sizing: border-box;
|
|
859
|
-
`,
|
|
859
|
+
`,nl=yr.video`
|
|
860
860
|
max-width: 100%;
|
|
861
861
|
max-height: 100%;
|
|
862
862
|
object-fit: contain;
|
|
863
863
|
border-radius: 10px;
|
|
864
|
-
`;var
|
|
864
|
+
`;var il=e=>{const{selfPeerId:t}=(0,Ie.useContext)(is),r=(0,Ie.useRef)(null),n=e.peerId===t;return(0,Ie.useEffect)((()=>{e.data.mediaId&&r.current&&ns.requestVideo({mediaId:e.data.mediaId,element:r.current})}),[e.data.mediaId]),(0,Ie.useEffect)((()=>{if(n&&r.current)return ns.requestLocalScreenshare(r.current),()=>{ns.disableScreenshare()}}),[n]),(0,o.jsx)(rl,{children:(0,o.jsx)(nl,{ref:r,autoPlay:!0,playsInline:!0,muted:!0})})};Ie=a("85Hg2");Ie=a("85Hg2");const al=yr.div`
|
|
865
865
|
max-width: 100%;
|
|
866
866
|
margin-top: 60px;
|
|
867
867
|
margin-bottom: 20px;
|
|
868
868
|
padding: 0 25px;
|
|
869
869
|
box-sizing: border-box;
|
|
870
|
-
`,
|
|
870
|
+
`,ol=yr.div`
|
|
871
871
|
font-size: 20px;
|
|
872
872
|
font-weight: 700;
|
|
873
873
|
margin-bottom: 30px;
|
|
874
|
-
`,
|
|
874
|
+
`,sl=yr.div`
|
|
875
875
|
display: flex;
|
|
876
876
|
flex-direction: column;
|
|
877
877
|
gap: 17px;
|
|
878
|
-
`,
|
|
878
|
+
`,cl=yr.img`
|
|
879
879
|
border-radius: 8px;
|
|
880
880
|
width: 36px;
|
|
881
881
|
height: 36px;
|
|
882
|
-
`,
|
|
882
|
+
`,ll=yr.div`
|
|
883
883
|
display: flex;
|
|
884
884
|
justify-content: center;
|
|
885
885
|
align-items: center;
|
|
@@ -894,7 +894,7 @@ to {
|
|
|
894
894
|
width: 8px;
|
|
895
895
|
height: 8px;
|
|
896
896
|
}
|
|
897
|
-
`,
|
|
897
|
+
`,dl=e=>{const{roomId:t}=ns.getState();if(t){const r=`stream_share_history_${t}`;try{const t=localStorage.getItem(r);if(t){const n=JSON.parse(t);n.push({...e,id:n.length});const i=JSON.stringify(n);localStorage.setItem(r,i)}else{const t=JSON.stringify([{...e,id:0}]);localStorage.setItem(r,t)}}catch(e){console.warn(e)}}else console.warn("Undefined room ID")},ul=()=>{const{t:e}=Li(),[t,r]=(0,Ie.useState)([]);return(0,Ie.useEffect)((()=>{try{const{roomId:e}=ns.getState(),t=localStorage.getItem(`stream_share_history_${e}`);if(t){const e=JSON.parse(t);r(e)}}catch(e){console.warn(e)}}),[]),t.length<1?null:(0,o.jsxs)(al,{children:[(0,o.jsx)(ol,{children:e("sharedHistory.shared")}),(0,o.jsx)(sl,{children:t.map((e=>{let t;return e.statusText&&(t={text:"From",boldText:e.statusText},e.statusIconUrl&&(t.icon=e.statusIconUrl),e.statusIconLetter&&(t.icon=(0,o.jsx)(ll,{children:e.statusIconLetter.slice(0,1).toUpperCase()})),e.statusIconUser&&(t.icon=(0,o.jsx)(ll,{children:(0,o.jsx)(ic,{})}))),(0,o.jsx)(Or,{options:{width:"325px",backgroundColor:"#2d2d2d",ellipsis:!0,icon:e.iconUrl?(0,o.jsx)(cl,{style:{...e.iconStyle},src:e.iconUrl,onError:Tr}):void 0,button:{text:"Open",action:()=>window.open(e.url,"_blank"),style:{backgroundColor:"#515151",border:"2px solid #515151"}},status:t},children:e.title},e.id)}))})]})},pl=yr.div`
|
|
898
898
|
display: flex;
|
|
899
899
|
justify-content: center;
|
|
900
900
|
align-items: center;
|
|
@@ -906,7 +906,7 @@ to {
|
|
|
906
906
|
width: 100%;
|
|
907
907
|
height: 100%;
|
|
908
908
|
overflow: hidden;
|
|
909
|
-
`,
|
|
909
|
+
`,hl=yr.div`
|
|
910
910
|
width: 100%;
|
|
911
911
|
height: 100%;
|
|
912
912
|
|
|
@@ -914,16 +914,16 @@ to {
|
|
|
914
914
|
width: 100%;
|
|
915
915
|
height: 100%;
|
|
916
916
|
}
|
|
917
|
-
`,
|
|
917
|
+
`,fl="youtube_start",ml="youtube_play",gl="youtube_pause",vl="youtube_stop";var yl=e=>{const{selfPeerId:t}=(0,Ie.useContext)(is),[r,n]=(0,Ie.useState)(null),i=e.peerId===t,a=e=>{const t=e.target.getCurrentTime();e.data===YT.PlayerState.PAUSED&&ns.sendCustomMessageToAll({type:gl,time:t}),e.data===YT.PlayerState.PLAYING&&ns.sendCustomMessageToAll({type:ml,time:t})};return(0,Ie.useEffect)((()=>{const t=t=>{const r=t.target;i||dl({title:r.videoTitle||"Video",url:`https://youtube.com/watch?v=${e.data.videoId}`,iconUrl:`https://i.ytimg.com/vi/${e.data.videoId}/mqdefault.jpg`,statusText:"YouTube",statusIconUrl:"https://stream-assets.snapcall.io/icons/youtube.png"})};var r;if(n((e=>(e&&e.destroy(),null))),window.onYouTubeIframeAPIReady=()=>{const r=new YT.Player("youtube-player",{height:"390",width:"640",videoId:e.data.videoId,playerVars:{autoplay:1,controls:i?1:0,playsinline:1,enablejsapi:1,origin:window.location.origin,rel:0,start:e.data.time||0},events:{onReady:t,onStateChange:i?a:void 0}});n(r)},window?.YT?.loaded?window.onYouTubeIframeAPIReady():(r="https://www.youtube.com/iframe_api",new Promise(((e,t)=>{const n=document.createElement("script");n.src=r,n.addEventListener("load",(()=>e(1))),n.addEventListener("error",(e=>t(e))),document.body.appendChild(n)}))),i)return ns.sendCustomMessageToAll({type:fl,videoId:e.data.videoId}),()=>{ns.sendCustomMessageToAll({type:vl,videoId:e.data.videoId})}}),[e.data,i]),(0,Ie.useEffect)((()=>{if(!i&&r){const e=e=>{const{type:t,time:n}=e.detail.event;t===gl?(r.pauseVideo(),r.seekTo(n,!0)):t===ml&&(r.playVideo(),r.seekTo(n,!0))};return ns.addEventListener("customMessage",e),()=>{ns.removeEventListener("customMessage",e)}}if(i&&r){const t=t=>{const{peerId:n}=t.detail,i=r.getCurrentTime();ns.sendCustomMessage(n,{type:fl,videoId:e.data.videoId,time:i})};return ns.addEventListener("newPeer",t),()=>{ns.removeEventListener("newPeer",t)}}}),[e.data,i,r]),(0,o.jsx)(pl,{children:(0,o.jsx)(hl,{children:(0,o.jsx)("div",{id:"youtube-player"})})})};Ie=a("85Hg2");const bl=yr.div`
|
|
918
918
|
display: flex;
|
|
919
919
|
position: relative;
|
|
920
920
|
height: 100%;
|
|
921
921
|
max-width: 100%;
|
|
922
|
-
`,
|
|
922
|
+
`,wl=yr.img`
|
|
923
923
|
max-height: 100%;
|
|
924
924
|
object-fit: contain;
|
|
925
925
|
border-radius: 20px;
|
|
926
|
-
`,
|
|
926
|
+
`,xl=yr.div`
|
|
927
927
|
display: flex;
|
|
928
928
|
flex-direction: column;
|
|
929
929
|
justify-content: space-between;
|
|
@@ -932,16 +932,16 @@ to {
|
|
|
932
932
|
height: 100%;
|
|
933
933
|
padding: 16px;
|
|
934
934
|
box-sizing: border-box;
|
|
935
|
-
`,
|
|
935
|
+
`,_l=yr.div`
|
|
936
936
|
display: flex;
|
|
937
937
|
justify-content: space-between;
|
|
938
938
|
align-items: center;
|
|
939
|
-
`,
|
|
939
|
+
`,Sl=yr.span`
|
|
940
940
|
font-size: 12px;
|
|
941
941
|
font-weight: 700;
|
|
942
942
|
color: #fff;
|
|
943
943
|
text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.15);
|
|
944
|
-
`,
|
|
944
|
+
`,kl=yr.a`
|
|
945
945
|
color: #fff;
|
|
946
946
|
padding: 6px 12px;
|
|
947
947
|
font-size: 14px;
|
|
@@ -952,10 +952,10 @@ to {
|
|
|
952
952
|
border-radius: 50px;
|
|
953
953
|
text-decoration: none;
|
|
954
954
|
cursor: pointer;
|
|
955
|
-
`,
|
|
955
|
+
`,Cl=yr.div`
|
|
956
956
|
display: flex;
|
|
957
957
|
justify-content: center;
|
|
958
|
-
`,
|
|
958
|
+
`,El=yr.button`
|
|
959
959
|
display: flex;
|
|
960
960
|
justify-content: center;
|
|
961
961
|
align-items: center;
|
|
@@ -970,12 +970,12 @@ to {
|
|
|
970
970
|
width: 17px;
|
|
971
971
|
height: 17px;
|
|
972
972
|
}
|
|
973
|
-
`,
|
|
973
|
+
`,Rl=yr.img`
|
|
974
974
|
border: 2px solid #fff;
|
|
975
975
|
border-radius: 8px;
|
|
976
976
|
width: 36px;
|
|
977
977
|
height: 36px;
|
|
978
|
-
`,
|
|
978
|
+
`,Pl=yr.div`
|
|
979
979
|
display: flex;
|
|
980
980
|
justify-content: center;
|
|
981
981
|
align-items: center;
|
|
@@ -991,7 +991,7 @@ to {
|
|
|
991
991
|
width: 9px;
|
|
992
992
|
height: 9px;
|
|
993
993
|
}
|
|
994
|
-
`;var
|
|
994
|
+
`;var Tl=e=>{const{t:t}=Li(),{dispatch:r}=us(),n=(0,Ie.useRef)(null),[i,a]=(0,Ie.useState)(e.data.url),[s,c]=(0,Ie.useState)("auto"),l=(0,Ie.useMemo)((()=>{const t=e.data.url.split("/");return t[t.length-1]}),[e.data.url]),d=()=>{if(n.current){const{clientWidth:e}=n.current;c(`${e}px`)}},u=new Date(e.data.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return(0,Ie.useEffect)((()=>{const t=document.createElement("img");t.onload=()=>{const e=document.createElement("canvas"),r=e.getContext("2d");e.width=t.width,e.height=t.height,r?.drawImage(t,0,0);const n=e.toDataURL("image/jpeg");a(n)},t.crossOrigin="anonymous",t.src=e.data.url}),[e.data.url]),(0,Ie.useEffect)((()=>(window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)})),[n]),(0,o.jsxs)(bl,{style:{width:s},children:[(0,o.jsx)(wl,{onLoad:d,ref:n,src:e.data.url,crossOrigin:"anonymous"}),(0,o.jsxs)(xl,{children:[(0,o.jsxs)(_l,{children:[(0,o.jsxs)(Sl,{children:[t("snapshot.title")," · ",u]}),(0,o.jsx)(kl,{href:i,target:"_blank",download:l,children:t("snapshot.save")})]}),(0,o.jsx)(Cl,{children:(0,o.jsx)(El,{onClick:()=>{r({type:as.UNSET_HIGHLIGHTED_TILE})},children:(0,o.jsx)(Gc,{})})})]})]})};Ie=a("85Hg2");var jl=()=>{const{selfPeerId:e}=(0,Ie.useContext)(is),{dispatch:t,highlightedTile:r}=us();return(0,Ie.useEffect)((()=>{const n=e=>{const{peerId:n,mediaId:i,deviceType:a}=e.detail,o="mediaStart"===e.type;"screen"===a&&o?t({type:as.SET_HIGHLIGHTED_TILE,payload:{type:"screenshare",peerId:n,isGlobal:!0,data:{mediaId:i}}}):"screen"===a&&"screenshare"===r?.type&&r.peerId===n&&t({type:as.UNSET_HIGHLIGHTED_TILE})},i=n=>{"screenshareEnabled"===n.type?t({type:as.SET_HIGHLIGHTED_TILE,payload:{type:"screenshare",peerId:String(e),isGlobal:!0,data:{}}}):"screenshare"===r?.type&&r.peerId===e&&t({type:as.UNSET_HIGHLIGHTED_TILE})};return ns.addEventListener("mediaStart",n),ns.addEventListener("mediaStop",n),ns.addEventListener("screenshareEnabled",i),ns.addEventListener("screenshareDisabled",i),()=>{ns.removeEventListener("mediaStart",n),ns.removeEventListener("mediaStop",n),ns.removeEventListener("screenshareEnabled",i),ns.removeEventListener("screenshareDisabled",i)}}),[t,r,e]),null};Ie=a("85Hg2");var Ol=()=>{const{dispatch:e,highlightedTile:t}=us();return(0,Ie.useEffect)((()=>{const r=r=>{const{peerId:n}=r.detail,{type:i,videoId:a,time:o}=r.detail.event;i===fl?e({type:as.SET_HIGHLIGHTED_TILE,payload:{type:"youtube",peerId:n,isGlobal:!0,data:{videoId:a,time:o}}}):i===vl&&"youtube"===t?.type&&t.data.videoId===a&&e({type:as.UNSET_HIGHLIGHTED_TILE})};return ns.addEventListener("customMessage",r),()=>{ns.removeEventListener("customMessage",r)}}),[e,t]),null};Ie=a("85Hg2");var Ml=()=>{const{t:e}=Li(),{dispatch:t,streams:r}=us();return(0,Ie.useEffect)((()=>{const n=async n=>{const{peerId:i}=n.detail,{type:a,imageSrc:s}=n.detail.event;if("snapshot"===a){const n=r.find((e=>e.id===i));if(n){const r=n.profile.name?(0,o.jsx)(Pl,{children:n.profile.name.slice(0,1).toUpperCase()}):(0,o.jsx)(Pl,{children:(0,o.jsx)(ic,{})}),a=new Date,c={text:e("misc.from"),boldText:n.profile.name||e("misc.user"),icon:r};Dr(e("snapshot.shared"),{width:"290px",icon:(0,o.jsx)(Rl,{src:s,crossOrigin:"anonymous"}),messageStyle:{fontWeight:600,fontSize:"16px"},button:{text:e("misc.open"),action:({close:e})=>{t({type:as.SET_HIGHLIGHTED_TILE,payload:{type:"snapshot",peerId:i,isGlobal:!1,data:{url:s,createdAt:a.getTime()}}}),e()}},status:c,duration:1e4});const l=a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});dl({title:`${e("snapshot.title")} · ${l}`,url:s,iconUrl:s,iconStyle:{border:"2px solid #fff"},statusText:c.boldText,statusIconLetter:n.profile.name?n.profile.name.slice(0,1).toUpperCase():void 0,statusIconUser:!n.profile.name})}}};return ns.addEventListener("customMessage",n),()=>{ns.removeEventListener("customMessage",n)}}),[r,t,e]),null};const Il=yr.div`
|
|
995
995
|
display: flex;
|
|
996
996
|
justify-content: center;
|
|
997
997
|
align-items: center;
|
|
@@ -999,7 +999,7 @@ to {
|
|
|
999
999
|
height: ${e=>"portrait"===e.orientation?50:100}%;
|
|
1000
1000
|
padding-right: ${e=>"portrait"===e.orientation?0:10}px;
|
|
1001
1001
|
padding-bottom: ${e=>"portrait"===e.orientation?10:0}px;
|
|
1002
|
-
`,
|
|
1002
|
+
`,Ll=()=>{const{dispatch:e,highlightedTile:t}=us();return(0,Ie.useEffect)((()=>{const r=r=>{const{peerId:n}=r.detail;t?.peerId===n&&e({type:as.UNSET_HIGHLIGHTED_TILE})};return ns.addEventListener("peerClosed",r),()=>{ns.removeEventListener("peerClosed",r)}}),[e,t]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(jl,{}),(0,o.jsx)(Ol,{}),(0,o.jsx)(Ml,{})]})};var Dl=e=>{const{orientation:t}=(0,Ie.useContext)(is);return(0,o.jsxs)(Il,{orientation:t,children:["screenshare"===e.type&&(0,o.jsx)(il,{...e}),"youtube"===e.type&&(0,o.jsx)(yl,{...e}),"snapshot"===e.type&&(0,o.jsx)(Tl,{...e})]})};const Al=yr.div`
|
|
1003
1003
|
display: ${({show:e})=>e?"flex":"none"};
|
|
1004
1004
|
flex-direction: column;
|
|
1005
1005
|
justify-content: center;
|
|
@@ -1014,12 +1014,12 @@ to {
|
|
|
1014
1014
|
color: #fff;
|
|
1015
1015
|
font-family: Lato;
|
|
1016
1016
|
padding: 20px;
|
|
1017
|
-
`,
|
|
1017
|
+
`,Nl=yr.h2`
|
|
1018
1018
|
font-weight: 600;
|
|
1019
1019
|
font-size: 16px;
|
|
1020
1020
|
text-align: center;
|
|
1021
1021
|
max-width: 300px;
|
|
1022
|
-
`,
|
|
1022
|
+
`,Bl=yr.div`
|
|
1023
1023
|
position: relative;
|
|
1024
1024
|
display: flex;
|
|
1025
1025
|
align-items: center;
|
|
@@ -1031,7 +1031,7 @@ to {
|
|
|
1031
1031
|
border-radius: 15px;
|
|
1032
1032
|
padding: 0 10px;
|
|
1033
1033
|
box-sizing: border-box;
|
|
1034
|
-
`,
|
|
1034
|
+
`,Fl=yr.div`
|
|
1035
1035
|
display: flex;
|
|
1036
1036
|
align-items: center;
|
|
1037
1037
|
width: 100%;
|
|
@@ -1041,7 +1041,7 @@ to {
|
|
|
1041
1041
|
width: 20px;
|
|
1042
1042
|
height: 20px;
|
|
1043
1043
|
}
|
|
1044
|
-
`,
|
|
1044
|
+
`,zl=yr.p`
|
|
1045
1045
|
color: #242324;
|
|
1046
1046
|
font-size: 15px;
|
|
1047
1047
|
font-weight: 600;
|
|
@@ -1050,7 +1050,7 @@ to {
|
|
|
1050
1050
|
white-space: nowrap;
|
|
1051
1051
|
overflow: hidden;
|
|
1052
1052
|
line-height: 15px;
|
|
1053
|
-
`,
|
|
1053
|
+
`,Ul=yr.button`
|
|
1054
1054
|
position: absolute;
|
|
1055
1055
|
right: 5px;
|
|
1056
1056
|
display: flex;
|
|
@@ -1065,14 +1065,14 @@ to {
|
|
|
1065
1065
|
font-size: 16px;
|
|
1066
1066
|
padding: 8px 12px;
|
|
1067
1067
|
line-height: 18px;
|
|
1068
|
-
`,
|
|
1068
|
+
`,Vl=yr.p`
|
|
1069
1069
|
font-size: 12px;
|
|
1070
1070
|
font-weight: 400;
|
|
1071
1071
|
max-width: 300px;
|
|
1072
1072
|
text-align: center;
|
|
1073
|
-
`;var
|
|
1073
|
+
`;var Hl=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1.004 1.004 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1.004 1.004 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1.004 1.004 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.471 2.471 0 0 1 0 3.5l-3.88 3.88a1.002 1.002 0 0 0 .325 1.639.999.999 0 0 0 1.095-.219l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.92-4.92a1.004 1.004 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z",fill:e||"#fff"})});const $l=yr.path`
|
|
1074
1074
|
fill: ${({theme:e})=>e.primaryColor};
|
|
1075
|
-
`,
|
|
1075
|
+
`,Wl=(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M7 6.333A.667.667 0 0 0 6.333 7v2.667a.667.667 0 1 0 1.334 0V7A.667.667 0 0 0 7 6.333Zm.253-2.613a.667.667 0 0 0-.506 0 .667.667 0 0 0-.22.14.767.767 0 0 0-.14.22.667.667 0 0 0 .14.727c.064.059.139.106.22.14a.667.667 0 0 0 .92-.614.7.7 0 0 0-.194-.473.667.667 0 0 0-.22-.14ZM7 .333a6.667 6.667 0 1 0 0 13.334A6.667 6.667 0 0 0 7 .333Zm0 12A5.334 5.334 0 1 1 7 1.666a5.334 5.334 0 0 1 0 10.667Z",fill:"#fff"})}),ql=(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)($l,{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),(0,o.jsx)("path",{d:"M12 17a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM12 13a1 1 0 0 1-1-1V8a1 1 0 0 1 2 0v4a1 1 0 0 1-1 1Z",fill:"#fff"})]}),Gl=(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)($l,{d:"M20.058 22H3.943a3.023 3.023 0 0 1-2.617-4.534L9.383 3.511a3.023 3.023 0 0 1 5.235 0l8.057 13.955A3.023 3.023 0 0 1 20.058 22Z"}),(0,o.jsx)("path",{d:"M12 18a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM12 14a1 1 0 0 1-1-1V9a1 1 0 0 1 2 0v4a1 1 0 0 1-1 1Z",fill:"#fff"})]});Ie=a("85Hg2");var Zl=({show:e,orientation:t,width:r,height:n})=>{const{t:i}=Li(),{options:a}=(0,Ie.useContext)(is);return(0,o.jsxs)(Al,{show:e,width:r,height:n,orientation:t,children:[(0,o.jsx)(Nl,{children:i("invite.title")}),(0,o.jsxs)(Bl,{children:[(0,o.jsxs)(Fl,{children:[(0,o.jsx)(Hl,{color:"black"}),(0,o.jsx)(zl,{children:a.sharedURL||window.location.href})]}),(0,o.jsx)(Ul,{onClick:async()=>{try{await ps(a.sharedURL||window.location.href),Dr(i("copyLink.copied"),{duration:2e3})}catch(e){console.warn(e),Dr(i("copyLink.error"),{icon:ql})}},children:i("invite.copy")})]}),(0,o.jsx)(Vl,{children:i("invite.description")})]})};const Kl=yr.div`
|
|
1076
1076
|
background-color: rgba(45, 45, 45, 0.75);
|
|
1077
1077
|
display: flex;
|
|
1078
1078
|
flex-direction: row;
|
|
@@ -1083,7 +1083,7 @@ to {
|
|
|
1083
1083
|
border: 1px solid rgba(31, 31, 31, 0.5);
|
|
1084
1084
|
box-sizing: border-box;
|
|
1085
1085
|
pointer-events: auto;
|
|
1086
|
-
`,
|
|
1086
|
+
`,Yl=yr.button`
|
|
1087
1087
|
background-color: rgba(45, 45, 45, 0);
|
|
1088
1088
|
color: #fff;
|
|
1089
1089
|
border: none;
|
|
@@ -1094,24 +1094,24 @@ to {
|
|
|
1094
1094
|
font-size: 12px;
|
|
1095
1095
|
line-height: 14px;
|
|
1096
1096
|
height: 100%;
|
|
1097
|
-
`,
|
|
1097
|
+
`,Ql=yr.p`
|
|
1098
1098
|
color: #fff;
|
|
1099
1099
|
font-size: 12px;
|
|
1100
1100
|
font-weight: 400;
|
|
1101
1101
|
line-height: 14px;
|
|
1102
1102
|
max-width: 200px;
|
|
1103
1103
|
margin: 0;
|
|
1104
|
-
`,
|
|
1104
|
+
`,Jl=yr.div`
|
|
1105
1105
|
display: flex;
|
|
1106
1106
|
margin-right: 10px;
|
|
1107
|
-
`;var
|
|
1107
|
+
`;var Xl=e=>{r(g).custom((t=>(0,o.jsxs)(Kl,{children:[(0,o.jsx)(Jl,{children:Wl}),(0,o.jsx)(Ql,{children:e.message}),e.buttonText&&(0,o.jsx)(Yl,{onClick:()=>r(g).remove(t.id),children:e.buttonText})]})),{duration:e.duration||3e3,position:"top-center"})};var ed=()=>{const{selfPeerId:e,videosContainerRef:t,remoteTilesContainerRef:r,options:n,muted:i,profile:a,orientation:s,userInteractionTriggered:c}=(0,Ie.useContext)(is),[l,d]=(0,Ie.useState)({width:0,height:0}),{streams:u,highlightedTile:p,dispatch:h}=us(),[f,m]=qs(r.current),g=!n.audioTiles&&u.length<1&&!p&&f>0;return(0,Ie.useEffect)((()=>{n.GDPRDisclaimer&&Xl({message:"Para mejorar la calidad de nuestro servicio, esta llamada será grabada",buttonText:"Cerrar",duration:-1})}),[n.GDPRDisclaimer]),(0,Ie.useEffect)((()=>{if(r?.current){const e=1;let t=r.current.childElementCount;g||(t-=1);const n=Kc({availableWidth:f-16*(t-1),availableHeight:m-16*(t-1),numberOfTiles:t,ratio:e});d({width:n,height:n*e})}}),[r,f,m,u.length,p,g]),(0,Ie.useEffect)((()=>{c&&(n.controls?.microphone?.enabled&&ns.enableMicrophone(),n.controls?.camera?.enabled&&!n.audioTiles&&ns.enableVideo())}),[n.controls,n.audioTiles,c]),(0,Ie.useEffect)((()=>{const e=e=>{const{peerId:t,profile:r}=e.detail;h({type:as.ADD_STREAM,payload:{id:t,profile:r}})},t=e=>{const{peerId:t,mediaId:r,deviceType:n,paused:i}=e.detail,a="mediaStart"===e.type;"screen"!==n&&h({type:as.DEVICE_UPDATE,payload:{streamId:t,mediaId:r,device:n,available:a,paused:i}})},r=e=>{const{peerId:t,deviceType:r}=e.detail,n="mediaPause"===e.type;"microphone"===r&&n?h({type:as.MUTE,payload:{streamId:t}}):"microphone"===r&&h({type:as.UNMUTE,payload:{streamId:t}})},n=e=>{const{peers:t}=e.detail,r=t.map((e=>({id:e.peerId,profile:e.profile})));h({type:as.SET_STREAMS,payload:r})},i=e=>{const{peerId:t}=e.detail;h({type:as.REMOVE_STREAM,payload:{id:t}})},a=e=>{const{peerId:t,profile:r}=e.detail;h({type:as.SET_STREAM_PROFILE,payload:{streamId:t,profile:r}})},o=e=>{const t="peerStartSpeak"===e.type,{peerId:r}=e.detail;h({type:as.SET_STREAM_SPEAKING,payload:{streamId:r,isSpeaking:t}})};return ns.addEventListener("enterRoom",n),ns.addEventListener("newPeer",e),ns.addEventListener("peerClosed",i),ns.addEventListener("mediaStart",t),ns.addEventListener("mediaStop",t),ns.addEventListener("mediaPause",r),ns.addEventListener("mediaResume",r),ns.addEventListener("profileUpdate",a),ns.addEventListener("peerStartSpeak",o),ns.addEventListener("peerStopSpeak",o),()=>{ns.removeEventListener("enterRoom",n),ns.removeEventListener("newPeer",e),ns.removeEventListener("peerClosed",i),ns.removeEventListener("mediaStart",t),ns.removeEventListener("mediaStop",t),ns.removeEventListener("mediaPause",r),ns.removeEventListener("mediaResume",r),ns.removeEventListener("profileUpdate",a),ns.removeEventListener("peerStartSpeak",o),ns.removeEventListener("peerStopSpeak",o)}}),[h]),(0,o.jsxs)(ac,{ref:t,direction:"portrait"===s?"column":"row",children:[!n.audioTiles&&(0,o.jsx)(tl,{isSomeonePresenting:Boolean(p),width:l.width,height:l.height}),(0,o.jsx)(Ll,{}),p&&(0,o.jsx)(Dl,{...p}),(0,o.jsxs)(oc,{ref:r,orientation:s,reduced:Boolean(p),audioTiles:Boolean(n.audioTiles),children:[n.audioTiles&&(0,o.jsx)(Wc,{stream:{id:String(e),muted:i,profile:a}}),u.map((e=>n.audioTiles?(0,o.jsx)(Wc,{stream:e},e.id):(0,o.jsx)(zc,{stream:e,width:l.width,height:l.height},e.id))),(0,o.jsx)(Zl,{show:g,width:`${l.width}px`,height:`${l.height}px`,orientation:s})]})]})};Ie=a("85Hg2");var td=()=>(0,o.jsx)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("g",{clipPath:"url(#hangup)",children:(0,o.jsx)("path",{d:"M6.942 16.21c.144-.145.34-.25.517-.36a8.735 8.735 0 0 1 1.113-.603 1.851 1.851 0 0 0 .969-2.278l-.151-.438a11.279 11.279 0 0 1 3.05-.432c1.032.003 2.058.149 3.05.432l-.091.458a1.852 1.852 0 0 0 .968 2.278 9.55 9.55 0 0 1 1.113.602c.177.111.354.235.524.366a2.777 2.777 0 0 0 3.593-.333l1.964-1.964a2.776 2.776 0 0 0-.269-4.196 17.588 17.588 0 0 0-21.586.04l-.249.248a2.777 2.777 0 0 0-.63 2.958c.14.367.358.7.637.976l1.963 1.964a2.777 2.777 0 0 0 3.515.281Zm-4.254-3.6a.926.926 0 0 1-.156-1.104.98.98 0 0 1 .26-.31 15.736 15.736 0 0 1 19.303.045 1.009 1.009 0 0 1 .373.7.925.925 0 0 1-.269.714l-1.963 1.964a.925.925 0 0 1-1.172.137 9.979 9.979 0 0 0-.628-.432c-.42-.27-.86-.508-1.316-.713l.491-1.342a.925.925 0 0 0-.55-1.191 13.412 13.412 0 0 0-9.163 0 .926.926 0 0 0-.498.497.926.926 0 0 0-.032.714l.51 1.322c-.46.217-.905.462-1.335.733-.214.135-.423.279-.629.432a.926.926 0 0 1-1.171-.138L2.688 12.61Z",fill:"#fff"})})});var rd=()=>(0,o.jsx)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M20.41 15.51h-4.53a1 1 0 0 0 0 2h2.4A8 8 0 0 1 4.5 12a1 1 0 1 0-2 0 10 10 0 0 0 16.88 7.23V21a1 1 0 0 0 2 0v-4.5a1 1 0 0 0-.97-.99ZM12.5 2a10 10 0 0 0-6.88 2.77V3a1 1 0 0 0-2 0v4.5a1 1 0 0 0 1 1h4.5a1 1 0 0 0 0-2h-2.4A8 8 0 0 1 20.5 12a1 1 0 0 0 2 0 10 10 0 0 0-10-10Z",fill:"#F7F7F7"})});const nd=vr`
|
|
1108
1108
|
0% {
|
|
1109
1109
|
transform: rotate(0deg);
|
|
1110
1110
|
}
|
|
1111
1111
|
100% {
|
|
1112
1112
|
transform: rotate(360deg);
|
|
1113
1113
|
}
|
|
1114
|
-
`,
|
|
1114
|
+
`,id=yr.div`
|
|
1115
1115
|
display: inline-block;
|
|
1116
1116
|
position: relative;
|
|
1117
1117
|
width: ${({size:e})=>e};
|
|
@@ -1127,7 +1127,7 @@ to {
|
|
|
1127
1127
|
left: 0px;
|
|
1128
1128
|
border: 2px solid #fff;
|
|
1129
1129
|
border-radius: 50%;
|
|
1130
|
-
animation: ${
|
|
1130
|
+
animation: ${nd} 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
|
1131
1131
|
border-color: #fff transparent transparent transparent;
|
|
1132
1132
|
}
|
|
1133
1133
|
|
|
@@ -1142,7 +1142,7 @@ to {
|
|
|
1142
1142
|
div:nth-child(3) {
|
|
1143
1143
|
animation-delay: -0.15s;
|
|
1144
1144
|
}
|
|
1145
|
-
`;var
|
|
1145
|
+
`;var ad=({size:e})=>(0,o.jsxs)(id,{size:e||"24px",children:[(0,o.jsx)("div",{}),(0,o.jsx)("div",{}),(0,o.jsx)("div",{}),(0,o.jsx)("div",{})]});Ie=a("85Hg2");var od=({color:e})=>(0,o.jsx)("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M23 10.21a8.499 8.499 0 0 0-.91-4.13 2.92 2.92 0 0 0-1.72-1A78.362 78.362 0 0 0 12 4.77a78.45 78.45 0 0 0-8.34.3 2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48.29 48.29 0 0 0 0 6.48 9.55 9.55 0 0 0 .3 2c.12.505.365.972.71 1.36a2.86 2.86 0 0 0 1.49.78c2.156.266 4.328.376 6.5.33 3.5.05 6.57 0 10.2-.28a2.88 2.88 0 0 0 1.53-.78c.28-.28.49-.623.61-1 .358-1.097.533-2.246.52-3.4.04-.56.04-3.94.04-4.54ZM9.74 15.35V9.16l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08Z",fill:e||"#fff"})});const sd=yr.div`
|
|
1146
1146
|
display: flex;
|
|
1147
1147
|
justify-content: center;
|
|
1148
1148
|
align-items: center;
|
|
@@ -1157,7 +1157,7 @@ to {
|
|
|
1157
1157
|
@media (max-height: 500px) {
|
|
1158
1158
|
height: 60px;
|
|
1159
1159
|
}
|
|
1160
|
-
`,
|
|
1160
|
+
`,cd=yr.button`
|
|
1161
1161
|
display: flex;
|
|
1162
1162
|
align-items: center;
|
|
1163
1163
|
justify-content: center;
|
|
@@ -1180,9 +1180,9 @@ to {
|
|
|
1180
1180
|
border: 2px solid
|
|
1181
1181
|
${e=>e.danger?"#fc7d7d":e.primary?"#a3ceff":e.theme.controlsHoverBorderColor};
|
|
1182
1182
|
}
|
|
1183
|
-
`,
|
|
1183
|
+
`,ld=yr.div`
|
|
1184
1184
|
position: relative;
|
|
1185
|
-
`,
|
|
1185
|
+
`,dd=yr(cd)`
|
|
1186
1186
|
padding: 0 14px;
|
|
1187
1187
|
|
|
1188
1188
|
@media (max-width: 345px) {
|
|
@@ -1190,18 +1190,18 @@ to {
|
|
|
1190
1190
|
display: none;
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
1193
|
-
`,
|
|
1193
|
+
`,ud=yr.div`
|
|
1194
1194
|
position: absolute;
|
|
1195
1195
|
bottom: 58px;
|
|
1196
1196
|
left: 50%;
|
|
1197
1197
|
transform: translate(-50%, 0);
|
|
1198
1198
|
z-index: 30;
|
|
1199
|
-
`,
|
|
1199
|
+
`,pd=yr.div`
|
|
1200
1200
|
position: absolute;
|
|
1201
1201
|
right: 0;
|
|
1202
1202
|
bottom: 58px;
|
|
1203
1203
|
z-index: 30;
|
|
1204
|
-
`,fd=Boolean(navigator.mediaDevices.getDisplayMedia);var md=()=>{const{t:e}=Li(),t=(0,Ie.useRef)(null),[n,i]=(0,Ie.useState)(!1),{setIsYoutubePopupVisible:a,setIsLinksharePopupVisible:s,selfPeerId:c}=(0,Ie.useContext)(as),{highlightedTile:l,dispatch:d}=ps(),u=Boolean(l?.isGlobal&&l?.peerId===c);Es(t,(()=>i(!1)));const h=[{id:"1",items:[{id:"linksharing",title:e("shareLink.title"),jsxIcon:(0,o.jsx)($l,{}),action:()=>{i(!1),s(!0),p.event("linkshareClick")}},{id:"youtube",title:e("youtube.title"),jsxIcon:(0,o.jsx)(sd,{}),action:()=>{i(!1),a(!0),p.event("youtubeClick")}}]}];return fd&&h.push({id:"2",items:[{id:"screensharing",title:e("menu.screenSharing"),jsxIcon:(0,o.jsx)(ec,{}),action:async()=>{i(!1);try{p.event("screenshareClick"),await is.enableScreenshare(),p.event("enableScreenshare")}catch(t){console.warn(t),p.event("screenshareCancel"),r(g)(e("notifications.screensharingError"),{className:"error"})}}}]}),(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(dd,{children:[n&&(0,o.jsx)(pd,{ref:t,children:(0,o.jsx)(Is,{categories:h})}),(0,o.jsx)(ld,{primary:u,onClick:async()=>{u?d({type:os.UNSET_HIGHLIGHTED_TILE}):i((e=>!e))},children:(0,o.jsx)(ec,{white:u,arrow:!0})})]})})};var gd,vd,yd,bd,wd,xd,_d,Sd,kd,Cd=()=>{const{t:e}=Li(),t=(0,Ie.useRef)(null),[n,i]=(0,Ie.useState)(0),[a,s]=(0,Ie.useState)(!1),[c,l]=(0,Ie.useState)(!1),{muted:d,streaming:u,options:h,isAgent:f}=(0,Ie.useContext)(as);Es(t,(()=>s(!1)));const m=()=>{is.endCall()},v=e=>{const{numberOfAvailableWebcams:t}=e.detail;i(t)};return(0,Ie.useEffect)((()=>(is.addEventListener("webcamsUpdate",v),()=>{is.removeEventListener("webcamsUpdate",v)})),[]),(0,o.jsxs)(cd,{children:[h.controls?.microphone?.available&&(0,o.jsx)(ld,{danger:d,onClick:async()=>{try{is.getDevicesState().microphone.enabled?(p.event("toggleMicrophone"),await is.toggleMute()):(p.event("enableMicrophone"),await is.enableMicrophone())}catch(t){console.warn(t),r(g)(e("notifications.microphoneError"),{className:"error"})}},children:(0,o.jsx)(Ys,{slash:d})}),h.controls?.camera?.available&&(0,o.jsx)(ld,{danger:!u,onClick:async()=>{try{u?(p.event("disableCamera"),await is.disableVideo()):(l(!0),p.event("enableCamera"),await is.enableVideo())}catch(t){console.warn(t),r(g)(e("notifications.cameraError"),{className:"error"})}finally{l(!1)}},children:c?(0,o.jsx)(od,{}):(0,o.jsx)(Qs,{slash:!u})}),h.controls?.screenshare?.available&&(0,o.jsx)(md,{}),u&&n>1&&(0,o.jsx)(ld,{onClick:async()=>{try{p.event("rotateCamera"),await is.rotateVideo()}catch(t){console.warn(t),r(g)(e("notifications.cameraRotateError"),{className:"error"})}},children:(0,o.jsx)(nd,{})}),(0,o.jsxs)(dd,{children:[a&&(0,o.jsx)(hd,{ref:t,children:(0,o.jsx)(Is,{categories:[{id:"1",items:[{id:"leaveCall",title:e("leave.leaveCall"),jsxIcon:(0,o.jsx)(_s,{}),action:m},{id:"terminateCall",title:e("leave.endCall"),jsxIcon:(0,o.jsx)(Ss,{}),action:()=>{is.terminateRoom()},danger:!0}]}]})}),(0,o.jsxs)(ud,{onClick:()=>{f?s((e=>!e)):m()},danger:!0,children:[(0,o.jsx)(rd,{}),(0,o.jsx)("p",{children:e("leave.title")})]})]})]})};Ie=a("85Hg2"),Ie=a("85Hg2");let Ed;vd=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then};const Rd=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var Pd,Td,jd,Od,Md,Id;bd=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},wd=function(e){return Rd[e]},xd=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},_d=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Ed=e},Sd=function(){return void 0!==Ed},kd=function(e){return Ed(e)},Pd={bit:1},Td={bit:0},jd={bit:3},Od={bit:2},Md=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},Id=function(e,t){if(Md(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return Pd;case"m":case"medium":return Td;case"q":case"quartile":return jd;case"h":case"high":return Od;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}};var Ld={};function Dd(){this.buffer=[],this.length=0}Dd.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},Ld=Dd;var Ad,Nd,Bd={};function Fd(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Fd.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},Fd.prototype.get=function(e,t){return this.data[e*this.size+t]},Fd.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},Fd.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},Bd=Fd;var zd,Ud=bd;Ad=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=Ud(e),n=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e<t-1;e++)i[e]=i[e-1]-n;return i.push(6),i.reverse()},Nd=function(e){const t=[],r=Ad(e),n=r.length;for(let e=0;e<n;e++)for(let i=0;i<n;i++)0===e&&0===i||0===e&&i===n-1||e===n-1&&0===i||t.push([r[e],r[i]]);return t};var Vd=bd;var Hd,$d,Wd,qd,Gd,Zd,Kd,Yd,Qd;zd=function(e){const t=Vd(e);return[[0,0],[t-7,0],[0,t-7]]},Hd={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const Jd=3,Xd=3,eu=40,tu=10;function ru(e,t,r){switch(e){case Hd.PATTERN000:return(t+r)%2==0;case Hd.PATTERN001:return t%2==0;case Hd.PATTERN010:return r%3==0;case Hd.PATTERN011:return(t+r)%3==0;case Hd.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Hd.PATTERN101:return t*r%2+t*r%3==0;case Hd.PATTERN110:return(t*r%2+t*r%3)%2==0;case Hd.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}var nu,iu;$d=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},Wd=function(e){return $d(e)?parseInt(e,10):void 0},qd=function(e){const t=e.size;let r=0,n=0,i=0,a=null,o=null;for(let s=0;s<t;s++){n=i=0,a=o=null;for(let c=0;c<t;c++){let t=e.get(s,c);t===a?n++:(n>=5&&(r+=Jd+(n-5)),a=t,n=1),t=e.get(c,s),t===o?i++:(i>=5&&(r+=Jd+(i-5)),o=t,i=1)}n>=5&&(r+=Jd+(n-5)),i>=5&&(r+=Jd+(i-5))}return r},Gd=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let i=0;i<t-1;i++){const t=e.get(n,i)+e.get(n,i+1)+e.get(n+1,i)+e.get(n+1,i+1);4!==t&&0!==t||r++}return r*Xd},Zd=function(e){const t=e.size;let r=0,n=0,i=0;for(let a=0;a<t;a++){n=i=0;for(let o=0;o<t;o++)n=n<<1&2047|e.get(a,o),o>=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(o,a),o>=10&&(1488===i||93===i)&&r++}return r*eu},Kd=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/r/5)-10)*tu},Yd=function(e,t){const r=t.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)t.isReserved(i,n)||t.xor(i,n,ru(e,i,n))},Qd=function(e,t){const r=Object.keys(Hd).length;let n=0,i=1/0;for(let a=0;a<r;a++){t(a),Yd(a,e);const r=qd(e)+Gd(e)+Zd(e)+Kd(e);Yd(a,e),r<i&&(i=r,n=a)}return n};const au=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],ou=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];nu=function(e,t){switch(t){case Pd:return au[4*(e-1)+0];case Td:return au[4*(e-1)+1];case jd:return au[4*(e-1)+2];case Od:return au[4*(e-1)+3];default:return}},iu=function(e,t){switch(t){case Pd:return ou[4*(e-1)+0];case Td:return ou[4*(e-1)+1];case jd:return ou[4*(e-1)+2];case Od:return ou[4*(e-1)+3];default:return}};var su,cu,lu,du,uu,pu={};const hu=new Uint8Array(512),fu=new Uint8Array(256);function mu(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}var gu,vu,yu,bu,wu,xu,_u,Su,ku,Cu,Eu,Ru,Pu,Tu,ju,Ou,Mu,Iu,Lu,Du,Au,Nu,Bu;!function(){let e=1;for(let t=0;t<255;t++)hu[t]=e,fu[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)hu[e]=hu[e-255]}(),du=function(e){return hu[e]},uu=function(e,t){return 0===e||0===t?0:hu[fu[e]+fu[t]]},su=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let i=0;i<t.length;i++)r[n+i]^=uu(e[n],t[i]);return r},cu=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let n=0;n<t.length;n++)r[n]^=uu(t[n],e);let n=0;for(;n<r.length&&0===r[n];)n++;r=r.slice(n)}return r},lu=function(e){let t=new Uint8Array([1]);for(let r=0;r<e;r++)t=su(t,new Uint8Array([1,du(r)]));return t},mu.prototype.initialize=function(e){this.degree=e,this.genPoly=lu(this.degree)},mu.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=cu(t,this.genPoly),n=this.degree-r.length;if(n>0){const e=new Uint8Array(this.degree);return e.set(r,n),e}return r},pu=mu,ju=function(e){return!isNaN(e)&&e>=1&&e<=40};const Fu="[0-9]+";let zu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";zu=zu.replace(/u/g,"\\u");const Uu="(?:(?![A-Z0-9 $%*+\\-./:]|"+zu+")(?:.|[\r\n]))+";Ou=new RegExp(zu,"g"),Mu=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Iu=new RegExp(Uu,"g"),Lu=new RegExp(Fu,"g"),Du=new RegExp("[A-Z $%*+\\-./:]+","g");const Vu=new RegExp("^"+zu+"$"),Hu=new RegExp("^[0-9]+$"),$u=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Au=function(e){return Vu.test(e)},Nu=function(e){return Hu.test(e)},Bu=function(e){return $u.test(e)},wu={id:"Numeric",bit:1,ccBits:[10,12,14]},xu={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},_u={id:"Byte",bit:4,ccBits:[8,16,16]},Su={id:"Kanji",bit:8,ccBits:[8,10,12]},ku={bit:-1},Cu=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!ju(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},Eu=function(e){return Nu(e)?wu:Bu(e)?xu:Au(e)?Su:_u},Ru=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},Pu=function(e){return e&&e.bit&&e.ccBits},Tu=function(e,t){if(Pu(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return wu;case"alphanumeric":return xu;case"kanji":return Su;case"byte":return _u;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return t}};const Wu=xd(7973);function qu(e,t){return Cu(e,t)+4}function Gu(e,t){let r=0;return e.forEach((function(e){const n=qu(e.mode,t);r+=n+e.getBitsLength()})),r}var Zu;gu=function(e,t){return ju(e)?parseInt(e,10):t},vu=function(e,t,r){if(!ju(e))throw new Error("Invalid QR Code version");void 0===r&&(r=_u);const n=8*(wd(e)-iu(e,t));if(r===ku)return n;const i=n-qu(r,e);switch(r){case wu:return Math.floor(i/10*3);case xu:return Math.floor(i/11*2);case Su:return Math.floor(i/13);default:return Math.floor(i/8)}},yu=function(e,t){let r;const n=Id(t,Td);if(Array.isArray(e)){if(e.length>1)return function(e,t){for(let r=1;r<=40;r++)if(Gu(e,r)<=vu(r,t,ku))return r}(e,n);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,t,r){for(let n=1;n<=40;n++)if(t<=vu(n,r,e))return n}(r.mode,r.getLength(),n)},bu=function(e){if(!ju(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;xd(t)-Wu>=0;)t^=7973<<xd(t)-Wu;return e<<12|t};const Ku=xd(1335);var Yu,Qu,Ju;Zu=function(e,t){const r=e.bit<<3|t;let n=r<<10;for(;xd(n)-Ku>=0;)n^=1335<<xd(n)-Ku;return 21522^(r<<10|n)};var Xu={};function ep(e){this.mode=wu,this.data=e.toString()}ep.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},ep.prototype.getLength=function(){return this.data.length},ep.prototype.getBitsLength=function(){return ep.getBitsLength(this.data.length)},ep.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))},Xu=ep;var tp={};const rp=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function np(e){this.mode=xu,this.data=e}np.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},np.prototype.getLength=function(){return this.data.length},np.prototype.getBitsLength=function(){return np.getBitsLength(this.data.length)},np.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*rp.indexOf(this.data[t]);r+=rp.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(rp.indexOf(this.data[t]),6)},tp=np;var ip,ap={};function op(e){this.mode=_u,"string"==typeof e&&(e=ip(e)),this.data=new Uint8Array(e)}ip=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319&&r>n+1){var a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(i=1024*(i-55296)+a-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer},op.getBitsLength=function(e){return 8*e},op.prototype.getLength=function(){return this.data.length},op.prototype.getBitsLength=function(){return op.getBitsLength(this.data.length)},op.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},ap=op;var sp={};function cp(e){this.mode=Su,this.data=e}cp.getBitsLength=function(e){return 13*e},cp.prototype.getLength=function(){return this.data.length},cp.prototype.getBitsLength=function(){return cp.getBitsLength(this.data.length)},cp.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=kd(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},sp=cp;var lp,dp,up,pp,hp,fp,mp,gp={},vp={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var a,o,s,c,l,d,u,p=vp.PriorityQueue.make();for(p.push(t,0);!p.empty();)for(s in o=(a=p.pop()).value,c=a.cost,l=e[o]||{})l.hasOwnProperty(s)&&(d=c+l[s],u=i[s],(void 0===i[s]||u>d)&&(i[s]=d,p.push(s,d),n[s]=o));if(void 0!==r&&void 0===i[r]){var h=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(h)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=vp.single_source_shortest_paths(e,t,r);return vp.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t,r=vp.PriorityQueue,n={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(n[t]=r[t]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};function yp(e){return unescape(encodeURIComponent(e)).length}function bp(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function wp(e){const t=bp(Lu,wu,e),r=bp(Du,xu,e);let n,i;Sd()?(n=bp(Iu,_u,e),i=bp(Ou,Su,e)):(n=bp(Mu,_u,e),i=[]);return t.concat(r,n,i).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function xp(e,t){switch(t){case wu:return Xu.getBitsLength(e);case xu:return tp.getBitsLength(e);case Su:return sp.getBitsLength(e);case _u:return ap.getBitsLength(e)}}function _p(e,t){let r;const n=Eu(e);if(r=Tu(t,n),r!==_u&&r.bit<n.bit)throw new Error('"'+e+'" cannot be encoded with mode '+Ru(r)+".\n Suggested mode is: "+Ru(n));switch(r!==Su||Sd()||(r=_u),r){case wu:return new Xu(e);case xu:return new tp(e);case Su:return new sp(e);case _u:return new ap(e)}}function Sp(e,t,r){const n=e.size,i=Zu(t,r);let a,o;for(a=0;a<15;a++)o=1==(i>>a&1),a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(n-15+a,8,o,!0),a<8?e.set(8,n-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(n-8,8,1,!0)}function kp(e,t,r){const n=new Ld;r.forEach((function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Cu(t.mode,e)),t.write(n)}));const i=8*(wd(e)-iu(e,t));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const a=(i-n.getLengthInBits())/8;for(let e=0;e<a;e++)n.put(e%2?17:236,8);return function(e,t,r){const n=wd(t),i=iu(t,r),a=n-i,o=nu(t,r),s=o-n%o,c=Math.floor(n/o),l=Math.floor(a/o),d=l+1,u=c-l,p=new pu(u);let h=0;const f=new Array(o),m=new Array(o);let g=0;const v=new Uint8Array(e.buffer);for(let e=0;e<o;e++){const t=e<s?l:d;f[e]=v.slice(h,h+t),m[e]=p.encode(f[e]),h+=t,g=Math.max(g,t)}const y=new Uint8Array(n);let b,w,x=0;for(b=0;b<g;b++)for(w=0;w<o;w++)b<f[w].length&&(y[x++]=f[w][b]);for(b=0;b<u;b++)for(w=0;w<o;w++)y[x++]=m[w][b];return y}(n,e,t)}function Cp(e,t,r,n){let i;if(Array.isArray(e))i=Yu(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=Ju(e);n=yu(t,r)}i=Qu(e,n||40)}}const a=yu(i,r);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<a)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+a+".\n")}else t=a;const o=kp(t,r,i),s=bd(t),c=new Bd(s);return function(e,t){const r=e.size,n=zd(t);for(let t=0;t<n.length;t++){const i=n[t][0],a=n[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||r<=i+t))for(let n=-1;n<=7;n++)a+n<=-1||r<=a+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,a+n,!0,!0):e.set(i+t,a+n,!1,!0))}}(c,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(c),function(e,t){const r=Nd(t);for(let t=0;t<r.length;t++){const n=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,i+r,!0,!0):e.set(n+t,i+r,!1,!0)}}(c,t),Sp(c,r,0),t>=7&&function(e,t){const r=e.size,n=bu(t);let i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+r-8-3,o=1==(n>>t&1),e.set(i,a,o,!0),e.set(a,i,o,!0)}(c,t),function(e,t){const r=e.size;let n=-1,i=r-1,a=7,o=0;for(let s=r-1;s>0;s-=2)for(6===s&&s--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,s-r)){let n=!1;o<t.length&&(n=1==(t[o]>>>a&1)),e.set(i,s-r,n),a--,-1===a&&(o++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(c,o),isNaN(n)&&(n=Qd(c,Sp.bind(null,c,r))),Yd(n,c),Sp(c,r,n),{modules:c,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}function Ep(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}function Rp(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Pp(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}function Tp(e,t,r,n,i){const a=[].slice.call(arguments,1),o=a.length,s="function"==typeof a[o-1];if(!s&&!vd())throw new Error("Callback required as last argument");if(!s){if(o<1)throw new Error("Too few arguments provided");return 1===o?(r=t,t=n=void 0):2!==o||t.getContext||(n=r,r=t,t=void 0),new Promise((function(i,a){try{const a=yd(r,n);i(e(a,t,n))}catch(e){a(e)}}))}if(o<2)throw new Error("Too few arguments provided");2===o?(i=r,r=t,t=n=void 0):3===o&&(t.getContext&&void 0===i?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0));try{const a=yd(r,n);i(null,e(a,t,n))}catch(e){i(e)}}gp=vp,Yu=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(_p(t,null)):t.data&&e.push(_p(t.data,t.mode)),e}),[])},Qu=function(e,t){const r=function(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];switch(n.mode){case wu:t.push([n,{data:n.data,mode:xu,length:n.length},{data:n.data,mode:_u,length:n.length}]);break;case xu:t.push([n,{data:n.data,mode:_u,length:n.length}]);break;case Su:t.push([n,{data:n.data,mode:_u,length:yp(n.data)}]);break;case _u:t.push([{data:n.data,mode:_u,length:yp(n.data)}])}}return t}(wp(e,Sd())),n=function(e,t){const r={},n={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const o=e[a],s=[];for(let e=0;e<o.length;e++){const c=o[e],l=""+a+e;s.push(l),r[l]={node:c,lastCount:0},n[l]={};for(let e=0;e<i.length;e++){const a=i[e];r[a]&&r[a].node.mode===c.mode?(n[a][l]=xp(r[a].lastCount+c.length,c.mode)-xp(r[a].lastCount,c.mode),r[a].lastCount+=c.length):(r[a]&&(r[a].lastCount=c.length),n[a][l]=xp(c.length,c.mode)+4+Cu(c.mode,t))}}i=s}for(let e=0;e<i.length;e++)n[i[e]].end=0;return{map:n,table:r}}(r,t),i=gp.find_path(n.map,"start","end"),a=[];for(let e=1;e<i.length-1;e++)a.push(n.table[i[e]].node);return Yu(function(e){return e.reduce((function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(a))},Ju=function(e){return Yu(wp(e,Sd()))},up=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:Ep(e.color.dark||"#000000ff"),light:Ep(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},pp=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},hp=function(e,t){const r=pp(e,t);return Math.floor((e+2*t.margin)*r)},fp=function(e,t,r){const n=t.modules.size,i=t.modules.data,a=pp(n,r),o=Math.floor((n+2*r.margin)*a),s=r.margin*a,c=[r.color.light,r.color.dark];for(let t=0;t<o;t++)for(let l=0;l<o;l++){let d=4*(t*o+l),u=r.color.light;if(t>=s&&l>=s&&t<o-s&&l<o-s){u=c[i[Math.floor((t-s)/a)*n+Math.floor((l-s)/a)]?1:0]}e[d++]=u.r,e[d++]=u.g,e[d++]=u.b,e[d]=u.a}},lp=function(e,t,r){let n=r,i=t;void 0!==n||t&&t.getContext||(n=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),n=up(n);const a=hp(e.modules.size,n),o=i.getContext("2d"),s=o.createImageData(a,a);return fp(s.data,e,n),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(o,i,a),o.putImageData(s,0,0),i},dp=function(e,t,r){let n=r;void 0!==n||t&&t.getContext||(n=t,t=void 0),n||(n={});const i=lp(e,t,n),a=n.type||"image/png",o=n.rendererOpts||{};return i.toDataURL(a,o.quality)},mp=function(e,t,r){const n=up(t),i=e.modules.size,a=e.modules.data,o=i+2*n.margin,s=n.color.light.a?"<path "+Rp(n.color.light,"fill")+' d="M0 0h'+o+"v"+o+'H0z"/>':"",c="<path "+Rp(n.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,a=!1,o=0;for(let s=0;s<e.length;s++){const c=Math.floor(s%t),l=Math.floor(s/t);c||a||(a=!0),e[s]?(o++,s>0&&c>0&&e[s-1]||(n+=a?Pp("M",c+r,.5+l+r):Pp("m",i,0),i=0,a=!1),c+1<t&&e[s+1]||(n+=Pp("h",o),o=0)):i++}return n}(a,i,n.margin)+'"/>',l='viewBox="0 0 '+o+" "+o+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+l+' shape-rendering="crispEdges">'+s+c+"</svg>\n";return"function"==typeof r&&r(null,d),d},yd=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,n,i=Td;return void 0!==t&&(i=Id(t.errorCorrectionLevel,Td),r=gu(t.version),n=Wd(t.maskPattern),t.toSJISFunc&&_d(t.toSJISFunc)),Cp(e,r,i,n)},gd=Tp.bind(null,lp),Tp.bind(null,dp),Tp.bind(null,(function(e,t,r){return mp(e,r)}));const jp=yr.div`
|
|
1204
|
+
`,hd=Boolean(navigator.mediaDevices.getDisplayMedia);var fd=()=>{const{t:e}=Li(),t=(0,Ie.useRef)(null),[n,i]=(0,Ie.useState)(!1),{setIsYoutubePopupVisible:a,setIsLinksharePopupVisible:s,selfPeerId:c}=(0,Ie.useContext)(is),{highlightedTile:l,dispatch:d}=us(),u=Boolean(l?.isGlobal&&l?.peerId===c);Cs(t,(()=>i(!1)));const h=[{id:"1",items:[{id:"linksharing",title:e("shareLink.title"),jsxIcon:(0,o.jsx)(Hl,{}),action:()=>{i(!1),s(!0),p.event("linkshareClick")}},{id:"youtube",title:e("youtube.title"),jsxIcon:(0,o.jsx)(od,{}),action:()=>{i(!1),a(!0),p.event("youtubeClick")}}]}];return hd&&h.push({id:"2",items:[{id:"screensharing",title:e("menu.screenSharing"),jsxIcon:(0,o.jsx)(Xs,{}),action:async()=>{i(!1);try{p.event("screenshareClick"),await ns.enableScreenshare(),p.event("enableScreenshare")}catch(t){console.warn(t),p.event("screenshareCancel"),r(g)(e("notifications.screensharingError"),{className:"error"})}}}]}),(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(ld,{children:[n&&(0,o.jsx)(ud,{ref:t,children:(0,o.jsx)(Ms,{categories:h})}),(0,o.jsx)(cd,{primary:u,onClick:async()=>{u?d({type:as.UNSET_HIGHLIGHTED_TILE}):i((e=>!e))},children:(0,o.jsx)(Xs,{white:u,arrow:!0})})]})})};var md,gd,vd,yd,bd,wd,xd,_d,Sd,kd=()=>{const{t:e}=Li(),t=(0,Ie.useRef)(null),[n,i]=(0,Ie.useState)(0),[a,s]=(0,Ie.useState)(!1),[c,l]=(0,Ie.useState)(!1),{muted:d,streaming:u,options:h,isAgent:f}=(0,Ie.useContext)(is);Cs(t,(()=>s(!1)));const m=()=>{ns.endCall()},v=e=>{const{numberOfAvailableWebcams:t}=e.detail;i(t)};return(0,Ie.useEffect)((()=>(ns.addEventListener("webcamsUpdate",v),()=>{ns.removeEventListener("webcamsUpdate",v)})),[]),(0,o.jsxs)(sd,{children:[h.controls?.microphone?.available&&(0,o.jsx)(cd,{danger:d,onClick:async()=>{try{ns.getDevicesState().microphone.enabled?(p.event("toggleMicrophone"),await ns.toggleMute()):(p.event("enableMicrophone"),await ns.enableMicrophone())}catch(t){console.warn(t),r(g)(e("notifications.microphoneError"),{className:"error"})}},children:(0,o.jsx)(Ks,{slash:d})}),h.controls?.camera?.available&&(0,o.jsx)(cd,{danger:!u,onClick:async()=>{try{u?(p.event("disableCamera"),await ns.disableVideo()):(l(!0),p.event("enableCamera"),await ns.enableVideo())}catch(t){console.warn(t),r(g)(e("notifications.cameraError"),{className:"error"})}finally{l(!1)}},children:c?(0,o.jsx)(ad,{}):(0,o.jsx)(Ys,{slash:!u})}),h.controls?.screenshare?.available&&(0,o.jsx)(fd,{}),u&&n>1&&(0,o.jsx)(cd,{onClick:async()=>{try{p.event("rotateCamera"),await ns.rotateVideo()}catch(t){console.warn(t),r(g)(e("notifications.cameraRotateError"),{className:"error"})}},children:(0,o.jsx)(rd,{})}),(0,o.jsxs)(ld,{children:[a&&(0,o.jsx)(pd,{ref:t,children:(0,o.jsx)(Ms,{categories:[{id:"1",items:[{id:"leaveCall",title:e("leave.leaveCall"),jsxIcon:(0,o.jsx)(xs,{}),action:m},{id:"terminateCall",title:e("leave.endCall"),jsxIcon:(0,o.jsx)(_s,{}),action:()=>{ns.terminateRoom()},danger:!0}]}]})}),(0,o.jsxs)(dd,{onClick:()=>{f?s((e=>!e)):m()},danger:!0,children:[(0,o.jsx)(td,{}),(0,o.jsx)("p",{children:e("leave.title")})]})]})]})};Ie=a("85Hg2"),Ie=a("85Hg2");let Cd;gd=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then};const Ed=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var Rd,Pd,Td,jd,Od,Md;yd=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},bd=function(e){return Ed[e]},wd=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},xd=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');Cd=e},_d=function(){return void 0!==Cd},Sd=function(e){return Cd(e)},Rd={bit:1},Pd={bit:0},Td={bit:3},jd={bit:2},Od=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},Md=function(e,t){if(Od(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return Rd;case"m":case"medium":return Pd;case"q":case"quartile":return Td;case"h":case"high":return jd;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}};var Id={};function Ld(){this.buffer=[],this.length=0}Ld.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},Id=Ld;var Dd,Ad,Nd={};function Bd(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Bd.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},Bd.prototype.get=function(e,t){return this.data[e*this.size+t]},Bd.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},Bd.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},Nd=Bd;var Fd,zd=yd;Dd=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=zd(e),n=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e<t-1;e++)i[e]=i[e-1]-n;return i.push(6),i.reverse()},Ad=function(e){const t=[],r=Dd(e),n=r.length;for(let e=0;e<n;e++)for(let i=0;i<n;i++)0===e&&0===i||0===e&&i===n-1||e===n-1&&0===i||t.push([r[e],r[i]]);return t};var Ud=yd;var Vd,Hd,$d,Wd,qd,Gd,Zd,Kd,Yd;Fd=function(e){const t=Ud(e);return[[0,0],[t-7,0],[0,t-7]]},Vd={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const Qd=3,Jd=3,Xd=40,eu=10;function tu(e,t,r){switch(e){case Vd.PATTERN000:return(t+r)%2==0;case Vd.PATTERN001:return t%2==0;case Vd.PATTERN010:return r%3==0;case Vd.PATTERN011:return(t+r)%3==0;case Vd.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Vd.PATTERN101:return t*r%2+t*r%3==0;case Vd.PATTERN110:return(t*r%2+t*r%3)%2==0;case Vd.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}var ru,nu;Hd=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},$d=function(e){return Hd(e)?parseInt(e,10):void 0},Wd=function(e){const t=e.size;let r=0,n=0,i=0,a=null,o=null;for(let s=0;s<t;s++){n=i=0,a=o=null;for(let c=0;c<t;c++){let t=e.get(s,c);t===a?n++:(n>=5&&(r+=Qd+(n-5)),a=t,n=1),t=e.get(c,s),t===o?i++:(i>=5&&(r+=Qd+(i-5)),o=t,i=1)}n>=5&&(r+=Qd+(n-5)),i>=5&&(r+=Qd+(i-5))}return r},qd=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let i=0;i<t-1;i++){const t=e.get(n,i)+e.get(n,i+1)+e.get(n+1,i)+e.get(n+1,i+1);4!==t&&0!==t||r++}return r*Jd},Gd=function(e){const t=e.size;let r=0,n=0,i=0;for(let a=0;a<t;a++){n=i=0;for(let o=0;o<t;o++)n=n<<1&2047|e.get(a,o),o>=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(o,a),o>=10&&(1488===i||93===i)&&r++}return r*Xd},Zd=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/r/5)-10)*eu},Kd=function(e,t){const r=t.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)t.isReserved(i,n)||t.xor(i,n,tu(e,i,n))},Yd=function(e,t){const r=Object.keys(Vd).length;let n=0,i=1/0;for(let a=0;a<r;a++){t(a),Kd(a,e);const r=Wd(e)+qd(e)+Gd(e)+Zd(e);Kd(a,e),r<i&&(i=r,n=a)}return n};const iu=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],au=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];ru=function(e,t){switch(t){case Rd:return iu[4*(e-1)+0];case Pd:return iu[4*(e-1)+1];case Td:return iu[4*(e-1)+2];case jd:return iu[4*(e-1)+3];default:return}},nu=function(e,t){switch(t){case Rd:return au[4*(e-1)+0];case Pd:return au[4*(e-1)+1];case Td:return au[4*(e-1)+2];case jd:return au[4*(e-1)+3];default:return}};var ou,su,cu,lu,du,uu={};const pu=new Uint8Array(512),hu=new Uint8Array(256);function fu(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}var mu,gu,vu,yu,bu,wu,xu,_u,Su,ku,Cu,Eu,Ru,Pu,Tu,ju,Ou,Mu,Iu,Lu,Du,Au,Nu;!function(){let e=1;for(let t=0;t<255;t++)pu[t]=e,hu[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)pu[e]=pu[e-255]}(),lu=function(e){return pu[e]},du=function(e,t){return 0===e||0===t?0:pu[hu[e]+hu[t]]},ou=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let i=0;i<t.length;i++)r[n+i]^=du(e[n],t[i]);return r},su=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let n=0;n<t.length;n++)r[n]^=du(t[n],e);let n=0;for(;n<r.length&&0===r[n];)n++;r=r.slice(n)}return r},cu=function(e){let t=new Uint8Array([1]);for(let r=0;r<e;r++)t=ou(t,new Uint8Array([1,lu(r)]));return t},fu.prototype.initialize=function(e){this.degree=e,this.genPoly=cu(this.degree)},fu.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=su(t,this.genPoly),n=this.degree-r.length;if(n>0){const e=new Uint8Array(this.degree);return e.set(r,n),e}return r},uu=fu,Tu=function(e){return!isNaN(e)&&e>=1&&e<=40};const Bu="[0-9]+";let Fu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Fu=Fu.replace(/u/g,"\\u");const zu="(?:(?![A-Z0-9 $%*+\\-./:]|"+Fu+")(?:.|[\r\n]))+";ju=new RegExp(Fu,"g"),Ou=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Mu=new RegExp(zu,"g"),Iu=new RegExp(Bu,"g"),Lu=new RegExp("[A-Z $%*+\\-./:]+","g");const Uu=new RegExp("^"+Fu+"$"),Vu=new RegExp("^[0-9]+$"),Hu=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Du=function(e){return Uu.test(e)},Au=function(e){return Vu.test(e)},Nu=function(e){return Hu.test(e)},bu={id:"Numeric",bit:1,ccBits:[10,12,14]},wu={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},xu={id:"Byte",bit:4,ccBits:[8,16,16]},_u={id:"Kanji",bit:8,ccBits:[8,10,12]},Su={bit:-1},ku=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Tu(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},Cu=function(e){return Au(e)?bu:Nu(e)?wu:Du(e)?_u:xu},Eu=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},Ru=function(e){return e&&e.bit&&e.ccBits},Pu=function(e,t){if(Ru(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return bu;case"alphanumeric":return wu;case"kanji":return _u;case"byte":return xu;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return t}};const $u=wd(7973);function Wu(e,t){return ku(e,t)+4}function qu(e,t){let r=0;return e.forEach((function(e){const n=Wu(e.mode,t);r+=n+e.getBitsLength()})),r}var Gu;mu=function(e,t){return Tu(e)?parseInt(e,10):t},gu=function(e,t,r){if(!Tu(e))throw new Error("Invalid QR Code version");void 0===r&&(r=xu);const n=8*(bd(e)-nu(e,t));if(r===Su)return n;const i=n-Wu(r,e);switch(r){case bu:return Math.floor(i/10*3);case wu:return Math.floor(i/11*2);case _u:return Math.floor(i/13);default:return Math.floor(i/8)}},vu=function(e,t){let r;const n=Md(t,Pd);if(Array.isArray(e)){if(e.length>1)return function(e,t){for(let r=1;r<=40;r++)if(qu(e,r)<=gu(r,t,Su))return r}(e,n);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,t,r){for(let n=1;n<=40;n++)if(t<=gu(n,r,e))return n}(r.mode,r.getLength(),n)},yu=function(e){if(!Tu(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;wd(t)-$u>=0;)t^=7973<<wd(t)-$u;return e<<12|t};const Zu=wd(1335);var Ku,Yu,Qu;Gu=function(e,t){const r=e.bit<<3|t;let n=r<<10;for(;wd(n)-Zu>=0;)n^=1335<<wd(n)-Zu;return 21522^(r<<10|n)};var Ju={};function Xu(e){this.mode=bu,this.data=e.toString()}Xu.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Xu.prototype.getLength=function(){return this.data.length},Xu.prototype.getBitsLength=function(){return Xu.getBitsLength(this.data.length)},Xu.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))},Ju=Xu;var ep={};const tp=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function rp(e){this.mode=wu,this.data=e}rp.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},rp.prototype.getLength=function(){return this.data.length},rp.prototype.getBitsLength=function(){return rp.getBitsLength(this.data.length)},rp.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*tp.indexOf(this.data[t]);r+=tp.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(tp.indexOf(this.data[t]),6)},ep=rp;var np,ip={};function ap(e){this.mode=xu,"string"==typeof e&&(e=np(e)),this.data=new Uint8Array(e)}np=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319&&r>n+1){var a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(i=1024*(i-55296)+a-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer},ap.getBitsLength=function(e){return 8*e},ap.prototype.getLength=function(){return this.data.length},ap.prototype.getBitsLength=function(){return ap.getBitsLength(this.data.length)},ap.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},ip=ap;var op={};function sp(e){this.mode=_u,this.data=e}sp.getBitsLength=function(e){return 13*e},sp.prototype.getLength=function(){return this.data.length},sp.prototype.getBitsLength=function(){return sp.getBitsLength(this.data.length)},sp.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=Sd(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},op=sp;var cp,lp,dp,up,pp,hp,fp,mp={},gp={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var a,o,s,c,l,d,u,p=gp.PriorityQueue.make();for(p.push(t,0);!p.empty();)for(s in o=(a=p.pop()).value,c=a.cost,l=e[o]||{})l.hasOwnProperty(s)&&(d=c+l[s],u=i[s],(void 0===i[s]||u>d)&&(i[s]=d,p.push(s,d),n[s]=o));if(void 0!==r&&void 0===i[r]){var h=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(h)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=gp.single_source_shortest_paths(e,t,r);return gp.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t,r=gp.PriorityQueue,n={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(n[t]=r[t]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};function vp(e){return unescape(encodeURIComponent(e)).length}function yp(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function bp(e){const t=yp(Iu,bu,e),r=yp(Lu,wu,e);let n,i;_d()?(n=yp(Mu,xu,e),i=yp(ju,_u,e)):(n=yp(Ou,xu,e),i=[]);return t.concat(r,n,i).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function wp(e,t){switch(t){case bu:return Ju.getBitsLength(e);case wu:return ep.getBitsLength(e);case _u:return op.getBitsLength(e);case xu:return ip.getBitsLength(e)}}function xp(e,t){let r;const n=Cu(e);if(r=Pu(t,n),r!==xu&&r.bit<n.bit)throw new Error('"'+e+'" cannot be encoded with mode '+Eu(r)+".\n Suggested mode is: "+Eu(n));switch(r!==_u||_d()||(r=xu),r){case bu:return new Ju(e);case wu:return new ep(e);case _u:return new op(e);case xu:return new ip(e)}}function _p(e,t,r){const n=e.size,i=Gu(t,r);let a,o;for(a=0;a<15;a++)o=1==(i>>a&1),a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(n-15+a,8,o,!0),a<8?e.set(8,n-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(n-8,8,1,!0)}function Sp(e,t,r){const n=new Id;r.forEach((function(t){n.put(t.mode.bit,4),n.put(t.getLength(),ku(t.mode,e)),t.write(n)}));const i=8*(bd(e)-nu(e,t));for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const a=(i-n.getLengthInBits())/8;for(let e=0;e<a;e++)n.put(e%2?17:236,8);return function(e,t,r){const n=bd(t),i=nu(t,r),a=n-i,o=ru(t,r),s=o-n%o,c=Math.floor(n/o),l=Math.floor(a/o),d=l+1,u=c-l,p=new uu(u);let h=0;const f=new Array(o),m=new Array(o);let g=0;const v=new Uint8Array(e.buffer);for(let e=0;e<o;e++){const t=e<s?l:d;f[e]=v.slice(h,h+t),m[e]=p.encode(f[e]),h+=t,g=Math.max(g,t)}const y=new Uint8Array(n);let b,w,x=0;for(b=0;b<g;b++)for(w=0;w<o;w++)b<f[w].length&&(y[x++]=f[w][b]);for(b=0;b<u;b++)for(w=0;w<o;w++)y[x++]=m[w][b];return y}(n,e,t)}function kp(e,t,r,n){let i;if(Array.isArray(e))i=Ku(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=Qu(e);n=vu(t,r)}i=Yu(e,n||40)}}const a=vu(i,r);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<a)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+a+".\n")}else t=a;const o=Sp(t,r,i),s=yd(t),c=new Nd(s);return function(e,t){const r=e.size,n=Fd(t);for(let t=0;t<n.length;t++){const i=n[t][0],a=n[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||r<=i+t))for(let n=-1;n<=7;n++)a+n<=-1||r<=a+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,a+n,!0,!0):e.set(i+t,a+n,!1,!0))}}(c,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(c),function(e,t){const r=Ad(t);for(let t=0;t<r.length;t++){const n=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,i+r,!0,!0):e.set(n+t,i+r,!1,!0)}}(c,t),_p(c,r,0),t>=7&&function(e,t){const r=e.size,n=yu(t);let i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+r-8-3,o=1==(n>>t&1),e.set(i,a,o,!0),e.set(a,i,o,!0)}(c,t),function(e,t){const r=e.size;let n=-1,i=r-1,a=7,o=0;for(let s=r-1;s>0;s-=2)for(6===s&&s--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,s-r)){let n=!1;o<t.length&&(n=1==(t[o]>>>a&1)),e.set(i,s-r,n),a--,-1===a&&(o++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}(c,o),isNaN(n)&&(n=Yd(c,_p.bind(null,c,r))),Kd(n,c),_p(c,r,n),{modules:c,version:t,errorCorrectionLevel:r,maskPattern:n,segments:i}}function Cp(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}function Ep(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Rp(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}function Pp(e,t,r,n,i){const a=[].slice.call(arguments,1),o=a.length,s="function"==typeof a[o-1];if(!s&&!gd())throw new Error("Callback required as last argument");if(!s){if(o<1)throw new Error("Too few arguments provided");return 1===o?(r=t,t=n=void 0):2!==o||t.getContext||(n=r,r=t,t=void 0),new Promise((function(i,a){try{const a=vd(r,n);i(e(a,t,n))}catch(e){a(e)}}))}if(o<2)throw new Error("Too few arguments provided");2===o?(i=r,r=t,t=n=void 0):3===o&&(t.getContext&&void 0===i?(i=n,n=void 0):(i=n,n=r,r=t,t=void 0));try{const a=vd(r,n);i(null,e(a,t,n))}catch(e){i(e)}}mp=gp,Ku=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(xp(t,null)):t.data&&e.push(xp(t.data,t.mode)),e}),[])},Yu=function(e,t){const r=function(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];switch(n.mode){case bu:t.push([n,{data:n.data,mode:wu,length:n.length},{data:n.data,mode:xu,length:n.length}]);break;case wu:t.push([n,{data:n.data,mode:xu,length:n.length}]);break;case _u:t.push([n,{data:n.data,mode:xu,length:vp(n.data)}]);break;case xu:t.push([{data:n.data,mode:xu,length:vp(n.data)}])}}return t}(bp(e,_d())),n=function(e,t){const r={},n={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const o=e[a],s=[];for(let e=0;e<o.length;e++){const c=o[e],l=""+a+e;s.push(l),r[l]={node:c,lastCount:0},n[l]={};for(let e=0;e<i.length;e++){const a=i[e];r[a]&&r[a].node.mode===c.mode?(n[a][l]=wp(r[a].lastCount+c.length,c.mode)-wp(r[a].lastCount,c.mode),r[a].lastCount+=c.length):(r[a]&&(r[a].lastCount=c.length),n[a][l]=wp(c.length,c.mode)+4+ku(c.mode,t))}}i=s}for(let e=0;e<i.length;e++)n[i[e]].end=0;return{map:n,table:r}}(r,t),i=mp.find_path(n.map,"start","end"),a=[];for(let e=1;e<i.length-1;e++)a.push(n.table[i[e]].node);return Ku(function(e){return e.reduce((function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(a))},Qu=function(e){return Ku(bp(e,_d()))},dp=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:Cp(e.color.dark||"#000000ff"),light:Cp(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},up=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},pp=function(e,t){const r=up(e,t);return Math.floor((e+2*t.margin)*r)},hp=function(e,t,r){const n=t.modules.size,i=t.modules.data,a=up(n,r),o=Math.floor((n+2*r.margin)*a),s=r.margin*a,c=[r.color.light,r.color.dark];for(let t=0;t<o;t++)for(let l=0;l<o;l++){let d=4*(t*o+l),u=r.color.light;if(t>=s&&l>=s&&t<o-s&&l<o-s){u=c[i[Math.floor((t-s)/a)*n+Math.floor((l-s)/a)]?1:0]}e[d++]=u.r,e[d++]=u.g,e[d++]=u.b,e[d]=u.a}},cp=function(e,t,r){let n=r,i=t;void 0!==n||t&&t.getContext||(n=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),n=dp(n);const a=pp(e.modules.size,n),o=i.getContext("2d"),s=o.createImageData(a,a);return hp(s.data,e,n),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(o,i,a),o.putImageData(s,0,0),i},lp=function(e,t,r){let n=r;void 0!==n||t&&t.getContext||(n=t,t=void 0),n||(n={});const i=cp(e,t,n),a=n.type||"image/png",o=n.rendererOpts||{};return i.toDataURL(a,o.quality)},fp=function(e,t,r){const n=dp(t),i=e.modules.size,a=e.modules.data,o=i+2*n.margin,s=n.color.light.a?"<path "+Ep(n.color.light,"fill")+' d="M0 0h'+o+"v"+o+'H0z"/>':"",c="<path "+Ep(n.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,a=!1,o=0;for(let s=0;s<e.length;s++){const c=Math.floor(s%t),l=Math.floor(s/t);c||a||(a=!0),e[s]?(o++,s>0&&c>0&&e[s-1]||(n+=a?Rp("M",c+r,.5+l+r):Rp("m",i,0),i=0,a=!1),c+1<t&&e[s+1]||(n+=Rp("h",o),o=0)):i++}return n}(a,i,n.margin)+'"/>',l='viewBox="0 0 '+o+" "+o+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+l+' shape-rendering="crispEdges">'+s+c+"</svg>\n";return"function"==typeof r&&r(null,d),d},vd=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,n,i=Pd;return void 0!==t&&(i=Md(t.errorCorrectionLevel,Pd),r=mu(t.version),n=$d(t.maskPattern),t.toSJISFunc&&xd(t.toSJISFunc)),kp(e,r,i,n)},md=Pp.bind(null,cp),Pp.bind(null,lp),Pp.bind(null,(function(e,t,r){return fp(e,r)}));const Tp=yr.div`
|
|
1205
1205
|
position: absolute;
|
|
1206
1206
|
width: 100%;
|
|
1207
1207
|
bottom: ${e=>e.open?0:"-500px"};
|
|
@@ -1214,7 +1214,7 @@ to {
|
|
|
1214
1214
|
justify-content: center;
|
|
1215
1215
|
align-items: center;
|
|
1216
1216
|
`}}
|
|
1217
|
-
`,
|
|
1217
|
+
`,jp=yr.div`
|
|
1218
1218
|
display: flex;
|
|
1219
1219
|
flex-direction: column;
|
|
1220
1220
|
height: 500px;
|
|
@@ -1223,7 +1223,7 @@ to {
|
|
|
1223
1223
|
color: ${e=>e.theme.popupTitleColor};
|
|
1224
1224
|
border-radius: ${e=>e.desktop?"20px":"20px 20px 0 0"};
|
|
1225
1225
|
padding-bottom: ${({desktop:e})=>e?0:"12px"};
|
|
1226
|
-
`,
|
|
1226
|
+
`,Op=yr.div`
|
|
1227
1227
|
display: flex;
|
|
1228
1228
|
justify-content: space-between;
|
|
1229
1229
|
align-items: center;
|
|
@@ -1233,7 +1233,7 @@ to {
|
|
|
1233
1233
|
margin: 0;
|
|
1234
1234
|
font-weight: 600;
|
|
1235
1235
|
}
|
|
1236
|
-
`,
|
|
1236
|
+
`,Mp=yr.div`
|
|
1237
1237
|
display: flex;
|
|
1238
1238
|
align-items: center;
|
|
1239
1239
|
|
|
@@ -1247,7 +1247,7 @@ to {
|
|
|
1247
1247
|
width: 20px;
|
|
1248
1248
|
height: 20px;
|
|
1249
1249
|
}
|
|
1250
|
-
`,
|
|
1250
|
+
`,Ip=yr.button`
|
|
1251
1251
|
display: flex;
|
|
1252
1252
|
justify-content: center;
|
|
1253
1253
|
align-items: center;
|
|
@@ -1266,7 +1266,7 @@ to {
|
|
|
1266
1266
|
fill: #000;
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
|
-
`,
|
|
1269
|
+
`,Lp=yr.div`
|
|
1270
1270
|
display: flex;
|
|
1271
1271
|
justify-content: center;
|
|
1272
1272
|
align-items: center;
|
|
@@ -1278,13 +1278,13 @@ to {
|
|
|
1278
1278
|
height: 100% !important;
|
|
1279
1279
|
width: auto !important;
|
|
1280
1280
|
}
|
|
1281
|
-
`,
|
|
1281
|
+
`,Dp=yr.p`
|
|
1282
1282
|
display: flex;
|
|
1283
1283
|
justify-content: center;
|
|
1284
1284
|
text-align: center;
|
|
1285
1285
|
margin: 0px 16% 20px;
|
|
1286
1286
|
font-size: 14px;
|
|
1287
|
-
`,
|
|
1287
|
+
`,Ap=yr.button`
|
|
1288
1288
|
font-size: 100%;
|
|
1289
1289
|
font-family: inherit;
|
|
1290
1290
|
font-weight: 700;
|
|
@@ -1298,11 +1298,11 @@ to {
|
|
|
1298
1298
|
align-items: center;
|
|
1299
1299
|
justify-content: center;
|
|
1300
1300
|
color: ${({theme:e})=>e.popupTitleColor};
|
|
1301
|
-
`,
|
|
1301
|
+
`,Np=yr.image`
|
|
1302
1302
|
position: absolute;
|
|
1303
1303
|
with: 70px;
|
|
1304
1304
|
height: 70px;
|
|
1305
|
-
`;var
|
|
1305
|
+
`;var Bp=()=>(0,o.jsxs)("svg",{width:"71",height:"70",viewBox:"0 0 71 70",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("path",{d:"M2 35c0-7.171.386-12.832 1.38-17.303.99-4.454 2.562-7.635 4.872-9.945 2.31-2.31 5.491-3.882 9.945-4.872C22.668 1.886 28.33 1.5 35.5 1.5c7.171 0 12.832.386 17.303 1.38 4.454.99 7.635 2.562 9.945 4.872 2.31 2.31 3.882 5.491 4.872 9.945C68.614 22.168 69 27.83 69 35c0 7.171-.386 12.832-1.38 17.303-.99 4.454-2.562 7.635-4.872 9.945-2.31 2.31-5.491 3.882-9.945 4.872-4.471.994-10.132 1.38-17.303 1.38-7.171 0-12.832-.386-17.303-1.38-4.454-.99-7.635-2.562-9.945-4.872-2.31-2.31-3.882-5.491-4.872-9.945C2.386 47.832 2 42.17 2 35Z",fill:"#000",stroke:"#fff",strokeWidth:"3"}),(0,o.jsx)("path",{d:"M35.72 55.833c2.3 0 4.229-1.91 3.518-4.099a13.01 13.01 0 0 0-3.045-5.058c-2.365-2.43-5.572-3.794-8.917-3.794-3.344 0-6.551 1.365-8.916 3.794a13.01 13.01 0 0 0-3.045 5.058c-.711 2.189 1.217 4.099 3.518 4.099H35.72ZM35.28 14.167c-2.3 0-4.229 1.91-3.518 4.099a13.008 13.008 0 0 0 3.045 5.058c2.365 2.43 5.572 3.793 8.917 3.793 3.344 0 6.551-1.364 8.916-3.793a13.005 13.005 0 0 0 3.045-5.058c.711-2.189-1.217-4.099-3.519-4.099H35.281ZM43.724 51.667c0 2.301 1.916 4.231 4.087 3.467a12.565 12.565 0 0 0 4.829-3.094c2.365-2.428 3.693-5.722 3.693-9.157 0-3.435-1.328-6.729-3.693-9.158a12.565 12.565 0 0 0-4.829-3.093c-2.17-.764-4.087 1.166-4.087 3.467v17.568ZM27.277 18.333c0-2.3-1.917-4.23-4.088-3.467a12.565 12.565 0 0 0-4.829 3.094c-2.364 2.429-3.693 5.723-3.693 9.157 0 3.435 1.329 6.729 3.693 9.158a12.565 12.565 0 0 0 4.83 3.093c2.17.764 4.087-1.166 4.087-3.467V18.333Z",fill:"#fff"})]});var Fp=()=>{const{t:e}=Li(),t=(0,Ie.useContext)(dr),r=(0,Ie.useRef)(null),n=(0,Ie.useRef)(null),{selfPeerId:i,profile:a,isQuickConnectPopupVisible:s,setIsQuickConnectPopupVisible:c,options:l,orientation:d}=(0,Ie.useContext)(is);Cs(r,(()=>{s&&c(!1)}));const u="landscape"===d,p=(0,Ie.useMemo)((()=>{let e=new URL(window.location.href);if(i){if(l.sharedURL)try{e=new URL(l.sharedURL)}catch(e){console.warn(`Shared URL is invalid (${l.sharedURL})`)}e.searchParams.set("microphone-enabled","0"),e.searchParams.set("camera-enabled","1"),e.searchParams.set("quick-connect",i),a.name&&e.searchParams.set("name",a.name)}return e.href}),[l.sharedURL,i,a.name]),h=(0,Ie.useCallback)((async()=>{try{await ps(p||window.location.href),Dr(e("copyLink.copied"),{duration:2e3})}catch(t){console.warn(t),Dr(e("copyLink.error"),{icon:ql})}}),[e,p]);return(0,Ie.useEffect)((()=>{const e=e=>{const{type:t}=e.detail.event;"quick_connect_close"===t&&c(!1)};return ns.addEventListener("customMessage",e),()=>{ns.removeEventListener("customMessage",e)}}),[c]),(0,Ie.useEffect)((()=>{md(n.current,p,{errorCorrectionLevel:"M"})}),[p]),(0,Ie.useEffect)((()=>{if(i){const e=new URLSearchParams(window.location.href),t=e.get("quick-connect"),r=e.get("name");t&&(ns.sendCustomMessage(t,{type:"quick_connect_close"}),r?ns.setProfile({name:`${r} (mobile)`}):ns.setProfile({name:"Mobile"}))}}),[i]),(0,o.jsx)(Tp,{open:s,desktop:u,children:(0,o.jsxs)(jp,{ref:r,desktop:u,children:[(0,o.jsxs)(Op,{children:[(0,o.jsxs)(Mp,{children:[(0,o.jsx)(bs,{color:t.popupTitleColor}),(0,o.jsx)("h4",{children:e("quickConnect.scanTitle")})]}),(0,o.jsx)(Ip,{onClick:()=>c(!1),children:(0,o.jsx)(Gc,{})})]}),(0,o.jsxs)(Lp,{children:[(0,o.jsx)(Np,{children:(0,o.jsx)(Bp,{})}),(0,o.jsx)("canvas",{ref:n})]}),(0,o.jsx)(Dp,{children:e("quickConnect.scan")}),(0,o.jsxs)(Ap,{onClick:h,children:[(0,o.jsx)(ys,{color:"#686868"}),e("copyLink.description")]})]})})};Ie=a("85Hg2");var zp=()=>(0,o.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M15 9.017a.833.833 0 0 0-.833.833v5.983a.833.833 0 0 1-.833.833H4.167a.833.833 0 0 1-.833-.833V6.667a.833.833 0 0 1 .833-.834h5.983a.833.833 0 0 0 0-1.667H4.167a2.5 2.5 0 0 0-2.5 2.5v9.167a2.5 2.5 0 0 0 2.5 2.5h9.167a2.5 2.5 0 0 0 2.5-2.5V9.85A.833.833 0 0 0 15 9.017Zm3.267-6.834a.834.834 0 0 0-.45-.45.834.834 0 0 0-.317-.067h-5a.833.833 0 0 0 0 1.667h2.992l-8.583 8.575a.832.832 0 0 0 0 1.184.833.833 0 0 0 1.183 0l8.575-8.584V7.5a.833.833 0 1 0 1.667 0v-5a.835.835 0 0 0-.067-.317Z",fill:"#fff"})});var Up=({direction:e})=>"right"===e?(0,o.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M8.233 14.37a.834.834 0 0 1-.59-1.423L10.59 10 7.643 7.054a.833.833 0 1 1 1.179-1.179l3.535 3.536a.833.833 0 0 1 0 1.178l-3.535 3.536a.83.83 0 0 1-.59.244Z",fill:"#fff"})}):"left"===e?(0,o.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M22.667 14.666h-10.12l4.4-4.386a1.34 1.34 0 0 0-1.893-1.894l-6.667 6.667a1.334 1.334 0 0 0-.28.44 1.334 1.334 0 0 0 0 1.013c.063.164.158.314.28.44l6.666 6.667a1.333 1.333 0 0 0 1.894 0 1.334 1.334 0 0 0 0-1.893l-4.4-4.387h10.12a1.333 1.333 0 1 0 0-2.667Z",fill:"#fff"})}):null;var Vp=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M12.43 4.1a1 1 0 0 0-1 .12L6.65 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h3.65l4.73 3.78A1 1 0 0 0 12 20a.91.91 0 0 0 .43-.1A1 1 0 0 0 13 19V5a1 1 0 0 0-.57-.9ZM11 16.92l-3.38-2.7A1 1 0 0 0 7 14H4v-4h3a1 1 0 0 0 .62-.22L11 7.08v9.84Zm8.66-10.58a1.004 1.004 0 1 0-1.42 1.42 5.998 5.998 0 0 1-.38 8.84 1 1 0 0 0 .64 1.76 1 1 0 0 0 .64-.23 8 8 0 0 0 .52-11.79Zm-2.83 2.83a1.003 1.003 0 1 0-1.42 1.42A2 2 0 0 1 16 12a2.001 2.001 0 0 1-.71 1.53.997.997 0 1 0 1.28 1.53A4 4 0 0 0 18 12a4.06 4.06 0 0 0-1.17-2.83Z",fill:"#fff"})});Ie=a("85Hg2");var Hp=()=>(0,o.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M15.592 6.008a.833.833 0 0 0-1.184 0L8.2 12.225 5.592 9.608a.852.852 0 0 0-1.184 1.225l3.2 3.2a.833.833 0 0 0 1.184 0l6.8-6.8a.834.834 0 0 0 0-1.225Z",fill:"#fff"})});const $p=yr.div`
|
|
1306
1306
|
display: flex;
|
|
1307
1307
|
flex-direction: column;
|
|
1308
1308
|
position: absolute;
|
|
@@ -1317,7 +1317,7 @@ to {
|
|
|
1317
1317
|
bottom: 0;
|
|
1318
1318
|
right: ${e=>e.open?0:"-375px"};
|
|
1319
1319
|
}
|
|
1320
|
-
`,
|
|
1320
|
+
`,Wp=yr.div`
|
|
1321
1321
|
display: flex;
|
|
1322
1322
|
flex-direction: column;
|
|
1323
1323
|
height: 88%;
|
|
@@ -1333,7 +1333,7 @@ to {
|
|
|
1333
1333
|
@media (min-width: 600px) {
|
|
1334
1334
|
border-radius: 0;
|
|
1335
1335
|
}
|
|
1336
|
-
`,
|
|
1336
|
+
`,qp=yr.div`
|
|
1337
1337
|
display: flex;
|
|
1338
1338
|
flex: 1;
|
|
1339
1339
|
justify-content: center;
|
|
@@ -1345,7 +1345,7 @@ to {
|
|
|
1345
1345
|
@media (min-width: 600px) {
|
|
1346
1346
|
background-color: ${e=>e.theme.settingsBackgroundColor};
|
|
1347
1347
|
}
|
|
1348
|
-
`,
|
|
1348
|
+
`,Gp=yr.span`
|
|
1349
1349
|
color: ${e=>e.theme.settingsHeaderTextColor};
|
|
1350
1350
|
font-size: 18px;
|
|
1351
1351
|
font-weight: 700;
|
|
@@ -1353,7 +1353,7 @@ to {
|
|
|
1353
1353
|
@media (max-width: 600px) {
|
|
1354
1354
|
color: #fff;
|
|
1355
1355
|
}
|
|
1356
|
-
`,
|
|
1356
|
+
`,Zp=yr.button`
|
|
1357
1357
|
display: flex;
|
|
1358
1358
|
justify-content: center;
|
|
1359
1359
|
align-items: center;
|
|
@@ -1362,16 +1362,16 @@ to {
|
|
|
1362
1362
|
padding: 0;
|
|
1363
1363
|
border: none;
|
|
1364
1364
|
background-color: transparent;
|
|
1365
|
-
`,
|
|
1365
|
+
`,Kp=yr.div`
|
|
1366
1366
|
display: flex;
|
|
1367
1367
|
flex-direction: column;
|
|
1368
1368
|
gap: 12px;
|
|
1369
|
-
`,
|
|
1369
|
+
`,Yp=yr.span`
|
|
1370
1370
|
color: ${e=>e.theme.settingsHeaderTextColor};
|
|
1371
1371
|
font-size: 18px;
|
|
1372
1372
|
font-weight: 700;
|
|
1373
1373
|
margin-bottom: 4px;
|
|
1374
|
-
`,
|
|
1374
|
+
`,Qp=yr.button`
|
|
1375
1375
|
display: flex;
|
|
1376
1376
|
background-color: ${e=>e.theme.controlsBackgroundColor};
|
|
1377
1377
|
border: none;
|
|
@@ -1388,20 +1388,20 @@ to {
|
|
|
1388
1388
|
display: flex;
|
|
1389
1389
|
align-items: center;
|
|
1390
1390
|
}
|
|
1391
|
-
`,
|
|
1391
|
+
`,Jp=yr.div`
|
|
1392
1392
|
display: flex;
|
|
1393
1393
|
align-items: center;
|
|
1394
1394
|
margin-right: 10px;
|
|
1395
|
-
`,
|
|
1395
|
+
`,Xp=yr.p`
|
|
1396
1396
|
margin: 0;
|
|
1397
1397
|
text-overflow: ellipsis;
|
|
1398
1398
|
white-space: nowrap;
|
|
1399
1399
|
overflow: hidden;
|
|
1400
|
-
`,
|
|
1400
|
+
`,eh=yr.div`
|
|
1401
1401
|
display: flex;
|
|
1402
1402
|
align-items: center;
|
|
1403
1403
|
gap: 8px;
|
|
1404
|
-
`,
|
|
1404
|
+
`,th=(yr.div`
|
|
1405
1405
|
display: flex;
|
|
1406
1406
|
justify-content: ${e=>e.checked?"flex-end":"flex-start"};
|
|
1407
1407
|
position: relative;
|
|
@@ -1434,48 +1434,48 @@ to {
|
|
|
1434
1434
|
gap: 10px;
|
|
1435
1435
|
background-color: #686868;
|
|
1436
1436
|
border-radius: 15px;
|
|
1437
|
-
`),
|
|
1437
|
+
`),rh=yr.p`
|
|
1438
1438
|
font-weight: 700;
|
|
1439
1439
|
font-size: 16px;
|
|
1440
1440
|
line-height: 16px;
|
|
1441
1441
|
text-align: center;
|
|
1442
1442
|
margin: 0;
|
|
1443
|
-
`,
|
|
1443
|
+
`,nh=yr.p`
|
|
1444
1444
|
font-weight: 500;
|
|
1445
1445
|
font-size: 14px;
|
|
1446
1446
|
line-height: 16px;
|
|
1447
1447
|
text-align: center;
|
|
1448
1448
|
margin: 0;
|
|
1449
|
-
`,
|
|
1449
|
+
`,ih=Object.keys(Ai);var ah=({back:e})=>{const{t:t}=Li(),{language:r,setLanguage:n}=(0,Ie.useContext)(is);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(qp,{children:[(0,o.jsx)(Gp,{children:t("settings.language")}),(0,o.jsx)(Zp,{onClick:e,children:(0,o.jsx)(Up,{direction:"left"})})]}),(0,o.jsx)(Wp,{children:(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:t("settings.language")}),ih.map((e=>{const t=r===e;return(0,o.jsxs)(Qp,{onClick:()=>{n(e)},children:[(0,o.jsx)(Xp,{children:Ai[e].name}),(0,o.jsx)("span",{children:t&&(0,o.jsx)(Hp,{})})]},e)}))]})})]})};Ie=a("85Hg2");var oh=({back:e})=>{const{t:t}=Li(),[r,n]=(0,Ie.useState)([]),[i,a]=(0,Ie.useState)(ns.getCurrentMicrophoneId()),[s,c]=(0,Ie.useState)(ns.getCurrentSpeakerId()),l=r.filter((e=>"audioinput"===e.kind)),d=r.filter((e=>"audiooutput"===e.kind)),u=l.length&&r.every((e=>""===e.deviceId)),p="setSinkId"in HTMLAudioElement.prototype,h=async()=>{const e=await ns.listAudioDevices();n(e)};return(0,Ie.useEffect)((()=>(h(),ns.addEventListener("devicesListChange",h),()=>ns.removeEventListener("devicesListChange",h))),[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(qp,{children:[(0,o.jsx)(Gp,{children:t("audioMenu.title")}),(0,o.jsx)(Zp,{onClick:e,children:(0,o.jsx)(Up,{direction:"left"})})]}),(0,o.jsx)(Wp,{children:u?(0,o.jsx)(Kp,{children:(0,o.jsxs)(th,{children:[(0,o.jsx)(rh,{children:t("audioMenu.blockedMicrophone")}),(0,o.jsx)(nh,{children:t("audioMenu.microphonePermissions")})]})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:t("misc.microphone")}),l.map((e=>{const r=e.deviceId===i;return(0,o.jsxs)(Qp,{onClick:()=>(async e=>{i!==e.deviceId&&(await ns.switchMicrophone(e.deviceId),a(e.deviceId),Dr(t("notifications.connectedTo",{name:e.label}),{duration:3e3,icon:(0,o.jsx)(Ks,{}),messageStyle:{fontWeight:600}}))})(e),children:[(0,o.jsx)(Xp,{children:e.label}),(0,o.jsx)("span",{children:r&&(0,o.jsx)(Hp,{})})]},e.deviceId)}))]}),p&&(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:t("misc.speaker")}),d.map((e=>{const r=e.deviceId===s;return(0,o.jsxs)(Qp,{onClick:()=>(e=>{s!==e.deviceId&&(ns.setAudioSink(e.deviceId),c(e.deviceId),Dr(t("notifications.connectedTo",{name:e.label}),{duration:3e3,icon:(0,o.jsx)(Vp,{}),messageStyle:{fontWeight:600}}))})(e),children:[(0,o.jsx)(Xp,{children:e.label}),(0,o.jsx)("span",{children:r&&(0,o.jsx)(Hp,{})})]},e.deviceId)}))]})]})})]})};Ie=a("85Hg2");var sh=({back:e})=>{const{t:t}=Li(),[r,n]=(0,Ie.useState)([]),[i,a]=(0,Ie.useState)(ns.getCurrentWebcam()),s=r.length&&r.every((e=>""===e.deviceId)),c=(0,Ie.useMemo)((()=>Object.keys(Xo).map((e=>{switch(Xo[e].height.ideal){case 240:return{name:t("videoMenu.lowDef"),key:e};case 480:return{name:t("videoMenu.standardDef"),key:e};case 720:return{name:t("videoMenu.highDef"),key:e};default:return{name:"",key:e}}})).filter((e=>""!==e.name))),[t]),l=async()=>{const e=await ns.listVideoDevices();n(e)},d=e=>{a({...e.detail.camera})};return(0,Ie.useEffect)((()=>(l(),ns.addEventListener("devicesListChange",l),ns.addEventListener("localVideoChange",d),ns.addEventListener("localVideoAvailable",d),()=>{ns.removeEventListener("devicesListChange",l),ns.removeEventListener("localVideoChange",d),ns.removeEventListener("localVideoAvailable",d)})),[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(qp,{children:[(0,o.jsx)(Gp,{children:t("videoMenu.title")}),(0,o.jsx)(Zp,{onClick:e,children:(0,o.jsx)(Up,{direction:"left"})})]}),(0,o.jsx)(Wp,{children:s?(0,o.jsx)(Kp,{children:(0,o.jsxs)(th,{children:[(0,o.jsx)(rh,{children:t("videoMenu.blockedCamera")}),(0,o.jsx)(nh,{children:t("videoMenu.cameraPermissions")})]})}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:t("misc.camera")}),r.map((e=>{const r=e.deviceId===i.device?.deviceId;return(0,o.jsxs)(Qp,{onClick:()=>(async e=>{i.device?.deviceId!==e.deviceId&&(i.device?await ns.switchWebcam({device:e}):await ns.enableVideo({device:e,resolution:i.resolution}),Dr(t("notifications.connectedTo",{name:e.label}),{duration:3e3,icon:(0,o.jsx)(Ys,{}),messageStyle:{fontWeight:600}}))})(e),children:[(0,o.jsx)(Xp,{children:e.label}),(0,o.jsx)("span",{children:r&&(0,o.jsx)(Hp,{})})]},e.deviceId)}))]}),(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:t("videoMenu.sendResolution")}),c.map((e=>{const t=e.key===i.resolution;return(0,o.jsxs)(Qp,{onClick:()=>(async e=>{i.resolution!==e.key&&(await ns.setWebcamResolution(e.key),Dr(e.name,{duration:3e3}))})(e),children:[(0,o.jsx)(Xp,{children:e.name}),(0,o.jsx)("span",{children:t&&(0,o.jsx)(Hp,{})})]},e.key)}))]})]})})]})};var ch=()=>{const{t:e}=Li(),[t,r]=(0,Ie.useState)("base"),n=(0,Ie.useRef)(null),{isSettingsMenuVisible:i,setIsSettingsMenuVisible:a,language:s,options:c}=(0,Ie.useContext)(is),l=()=>r("base"),d=(0,Ie.useCallback)((e=>{!n?.current?.contains(e.target)&&document.body.contains(e.target)&&(a(!1),r("base"))}),[a]);return(0,Ie.useEffect)((()=>{i?window.addEventListener("click",d):window.removeEventListener("click",d)}),[i,a,d]),(0,o.jsxs)($p,{ref:n,open:i,children:["base"===t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(qp,{children:[(0,o.jsx)(Gp,{children:e("settings.title")}),(0,o.jsx)(Zp,{onClick:()=>a(!1),children:(0,o.jsx)(Gc,{})})]}),(0,o.jsxs)(Wp,{children:[(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:e("settings.preferences")}),(0,o.jsxs)(Qp,{onClick:()=>r("languages"),children:[(0,o.jsx)("span",{children:e("settings.language")}),(0,o.jsxs)(eh,{children:[Ai[s]?.name,(0,o.jsx)(Up,{direction:"right"})]})]})]}),(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:e("settings.devices")}),ns.isListDevicesSupported()&&(0,o.jsxs)(Qp,{onClick:()=>r("audio"),children:[(0,o.jsxs)("span",{children:[(0,o.jsx)(Jp,{children:(0,o.jsx)(Vp,{})}),e("audioMenu.title")]}),(0,o.jsx)(eh,{children:(0,o.jsx)(Up,{direction:"right"})})]}),!c.audioTiles&&(0,o.jsxs)(Qp,{onClick:()=>r("video"),children:[(0,o.jsxs)("span",{children:[(0,o.jsx)(Jp,{children:(0,o.jsx)(Ys,{})}),e("videoMenu.title")]}),(0,o.jsx)(eh,{children:(0,o.jsx)(Up,{direction:"right"})})]})]}),(0,o.jsxs)(Kp,{children:[(0,o.jsx)(Yp,{children:e("settings.help")}),(0,o.jsxs)(Qp,{onClick:()=>{window.open("https://support.snapcall.io/hc/","_blank")},children:[(0,o.jsx)("span",{children:e("settings.helpCenter")}),(0,o.jsx)(zp,{})]})]})]})]}),"languages"===t&&(0,o.jsx)(ah,{back:l}),"audio"===t&&(0,o.jsx)(oh,{back:l}),"video"===t&&(0,o.jsx)(sh,{back:l})]})};Ie=a("85Hg2");var lh=()=>(0,o.jsx)("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M11.091 6.908a.833.833 0 0 0-.275-.175.833.833 0 0 0-.633 0 .833.833 0 0 0-.275.175l-2.5 2.5a.837.837 0 1 0 1.183 1.184l1.075-1.084V12.5a.833.833 0 1 0 1.667 0V9.508l1.075 1.084a.833.833 0 0 0 1.183 0 .833.833 0 0 0 0-1.184l-2.5-2.5Zm-.592-5.242a8.333 8.333 0 1 0 0 16.667 8.333 8.333 0 0 0 0-16.666Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.334Z",fill:"#fff"})});const dh=e=>e?"215px":"227px",uh=yr.div`
|
|
1450
1450
|
position: absolute;
|
|
1451
1451
|
width: 100%;
|
|
1452
|
-
bottom: ${e=>e.open?0:`-${
|
|
1452
|
+
bottom: ${e=>e.open?0:`-${dh(e.desktop)}`};
|
|
1453
1453
|
transition: all 0.4s;
|
|
1454
1454
|
|
|
1455
1455
|
${e=>{if(e.desktop)return Xt`
|
|
1456
|
-
bottom: ${e.open?0:`calc(-${
|
|
1456
|
+
bottom: ${e.open?0:`calc(-${dh(e.desktop)} - (100vh / 2))`};
|
|
1457
1457
|
height: 100%;
|
|
1458
1458
|
display: flex;
|
|
1459
1459
|
justify-content: center;
|
|
1460
1460
|
align-items: center;
|
|
1461
1461
|
`}}
|
|
1462
|
-
`,
|
|
1462
|
+
`,ph=yr.div`
|
|
1463
1463
|
display: flex;
|
|
1464
1464
|
flex-direction: column;
|
|
1465
1465
|
width: ${e=>e.desktop?"375px":"100%"};
|
|
1466
|
-
height: ${({desktop:e})=>
|
|
1466
|
+
height: ${({desktop:e})=>dh(e)};
|
|
1467
1467
|
max-height: 100vh;
|
|
1468
1468
|
background-color: ${e=>e.theme.popupBackgroundPrimaryColor};
|
|
1469
1469
|
color: ${e=>e.theme.popupTitleColor};
|
|
1470
1470
|
border-radius: ${e=>e.desktop?"20px":"20px 20px 0 0"};
|
|
1471
1471
|
padding: ${({desktop:e})=>e?"16px 14px":"16px 14px 28px"};
|
|
1472
1472
|
box-sizing: border-box;
|
|
1473
|
-
`,
|
|
1473
|
+
`,hh=yr.div`
|
|
1474
1474
|
display: flex;
|
|
1475
1475
|
justify-content: space-between;
|
|
1476
1476
|
align-items: center;
|
|
1477
1477
|
margin-bottom: 30px;
|
|
1478
|
-
`,
|
|
1478
|
+
`,fh=yr.div`
|
|
1479
1479
|
display: flex;
|
|
1480
1480
|
align-items: center;
|
|
1481
1481
|
|
|
@@ -1489,7 +1489,7 @@ to {
|
|
|
1489
1489
|
width: 20px;
|
|
1490
1490
|
height: 21px;
|
|
1491
1491
|
}
|
|
1492
|
-
`,
|
|
1492
|
+
`,mh=yr.button`
|
|
1493
1493
|
display: flex;
|
|
1494
1494
|
justify-content: center;
|
|
1495
1495
|
align-items: center;
|
|
@@ -1508,10 +1508,10 @@ to {
|
|
|
1508
1508
|
fill: #000;
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
|
-
`,
|
|
1511
|
+
`,gh=yr.form`
|
|
1512
1512
|
display: flex;
|
|
1513
1513
|
flex-direction: column;
|
|
1514
|
-
`,
|
|
1514
|
+
`,vh=yr.div`
|
|
1515
1515
|
display: flex;
|
|
1516
1516
|
flex-direction: column;
|
|
1517
1517
|
position: relative;
|
|
@@ -1536,7 +1536,7 @@ to {
|
|
|
1536
1536
|
border: 1px solid ${({theme:e})=>e.primaryColor};
|
|
1537
1537
|
}
|
|
1538
1538
|
}
|
|
1539
|
-
`,
|
|
1539
|
+
`,yh=yr.span`
|
|
1540
1540
|
position: absolute;
|
|
1541
1541
|
left: 0;
|
|
1542
1542
|
bottom: -20px;
|
|
@@ -1545,7 +1545,7 @@ to {
|
|
|
1545
1545
|
font-weight: 700;
|
|
1546
1546
|
line-height: 10px;
|
|
1547
1547
|
margin-top: 10px;
|
|
1548
|
-
`,
|
|
1548
|
+
`,bh=yr.button`
|
|
1549
1549
|
background-color: ${({theme:e})=>e.primaryColor};
|
|
1550
1550
|
padding: 8px 18px;
|
|
1551
1551
|
width: 100%;
|
|
@@ -1565,36 +1565,36 @@ to {
|
|
|
1565
1565
|
alig-items: center;
|
|
1566
1566
|
justify-content: center;
|
|
1567
1567
|
}
|
|
1568
|
-
`,xh=/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&?]*).*/;var _h=()=>{const{t:e}=Li(),t=(0,Ie.useContext)(dr),r=(0,Ie.useRef)(null),[n,i]=(0,Ie.useState)(""),[a,s]=(0,Ie.useState)(null),{isYoutubePopupVisible:c,setIsYoutubePopupVisible:l,selfPeerId:d,orientation:u}=(0,Ie.useContext)(as),{dispatch:h}=ps(),f="landscape"===u;Es(r,(()=>{c&&l(!1)}));return(0,Ie.useEffect)((()=>{i(""),s(null)}),[c]),(0,o.jsx)(ph,{open:c,desktop:f,children:(0,o.jsxs)(hh,{ref:r,desktop:f,children:[(0,o.jsxs)(fh,{children:[(0,o.jsxs)(mh,{children:[(0,o.jsx)(sd,{color:t.popupTitleColor}),(0,o.jsx)("h4",{children:e("youtube.title")})]}),(0,o.jsx)(gh,{onClick:()=>l(!1),children:(0,o.jsx)(Zc,{})})]}),(0,o.jsxs)(vh,{onSubmit:t=>{t.preventDefault(),s(null),p.event("youtubeShare");const[,r]=n.match(xh)||[];r?(h({type:os.SET_HIGHLIGHTED_TILE,payload:{type:"youtube",peerId:String(d),isGlobal:!0,data:{videoId:r}}}),l(!1)):s(e("youtube.invalid"))},children:[(0,o.jsxs)(yh,{errored:Boolean(a),children:[(0,o.jsx)("input",{id:"youtube-popup-input",placeholder:"https://www.youtube.com/watch?v=abcdef",value:n,onChange:e=>i(e.target.value),"data-lpignore":!0,autoComplete:"off","data-form-type":"other"}),a&&(0,o.jsx)(bh,{children:a})]}),(0,o.jsx)(wh,{type:"submit",children:(0,o.jsxs)("span",{children:[(0,o.jsx)(dh,{}),e("youtube.share")]})})]})]})})};Ie=a("85Hg2");const Sh=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M20.437 7.104a3.825 3.825 0 0 0-.573-.523 4.727 4.727 0 0 0-1.158-3.74C17.622 1.619 15.775 1 13.214 1H7a1.892 1.892 0 0 0-1.863 1.592l-2.59 16.406a1.533 1.533 0 0 0 1.516 1.785h2.664l-.082.52A1.467 1.467 0 0 0 8.093 23h3.235a1.762 1.762 0 0 0 1.75-1.47l.641-4.031.01-.055h.3c4.032 0 6.55-1.993 7.285-5.762a5.15 5.15 0 0 0-.877-4.578Zm-12.595 6.6-.714 4.535-.087.544H4.606L7.097 3h6.117c1.936 0 3.318.404 3.992 1.164a2.966 2.966 0 0 1 .608 2.733l-.018.113c-.012.076-.023.15-.044.246a5.847 5.847 0 0 1-2.005 3.67 6.678 6.678 0 0 1-4.217 1.183H9.706a1.88 1.88 0 0 0-1.864 1.595ZM19.351 11.3c-.55 2.828-2.242 4.145-5.322 4.145h-.484a1.762 1.762 0 0 0-1.75 1.473l-.65 4.074L8.717 21l.478-3.034.611-3.853h1.72c.156 0 .295-.023.448-.029.359-.012.716-.026 1.053-.067.205-.026.393-.073.59-.11.272-.05.545-.1.8-.17.191-.053.369-.122.55-.186a7.68 7.68 0 0 0 .698-.279c.168-.079.328-.167.486-.257a6.745 6.745 0 0 0 1.027-.713 6.56 6.56 0 0 0 .537-.519c.113-.12.23-.237.334-.367.173-.221.334-.452.48-.693.076-.122.161-.235.231-.363.203-.371.377-.757.521-1.154.009-.024.021-.044.03-.068.004-.01.01-.02.014-.032.198.717.207 1.472.026 2.193Z",fill:"#fff"})}),kh=()=>(0,o.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,o.jsx)("rect",{width:"14",height:"14",rx:"7",fill:"#fff"}),(0,o.jsx)("rect",{width:"14",height:"14",rx:"7",fill:"url(#paypalPattern)"}),(0,o.jsxs)("defs",{children:[(0,o.jsx)("pattern",{id:"paypalPattern",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,o.jsx)("use",{xlinkHref:"#paypalImage",transform:"matrix(.00308 0 0 .00308 .154 .154)"})}),(0,o.jsx)("image",{id:"paypalImage",width:"225",height:"225",xlinkHref:"data:image/png;base64,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"})]})]});var Ch=({colored:e})=>e?(0,o.jsx)(kh,{}):(0,o.jsx)(Sh,{});const Eh=e=>e?"215px":"227px",Rh=yr.div`
|
|
1568
|
+
`,wh=/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&?]*).*/;var xh=()=>{const{t:e}=Li(),t=(0,Ie.useContext)(dr),r=(0,Ie.useRef)(null),[n,i]=(0,Ie.useState)(""),[a,s]=(0,Ie.useState)(null),{isYoutubePopupVisible:c,setIsYoutubePopupVisible:l,selfPeerId:d,orientation:u}=(0,Ie.useContext)(is),{dispatch:h}=us(),f="landscape"===u;Cs(r,(()=>{c&&l(!1)}));return(0,Ie.useEffect)((()=>{i(""),s(null)}),[c]),(0,o.jsx)(uh,{open:c,desktop:f,children:(0,o.jsxs)(ph,{ref:r,desktop:f,children:[(0,o.jsxs)(hh,{children:[(0,o.jsxs)(fh,{children:[(0,o.jsx)(od,{color:t.popupTitleColor}),(0,o.jsx)("h4",{children:e("youtube.title")})]}),(0,o.jsx)(mh,{onClick:()=>l(!1),children:(0,o.jsx)(Gc,{})})]}),(0,o.jsxs)(gh,{onSubmit:t=>{t.preventDefault(),s(null),p.event("youtubeShare");const[,r]=n.match(wh)||[];r?(h({type:as.SET_HIGHLIGHTED_TILE,payload:{type:"youtube",peerId:String(d),isGlobal:!0,data:{videoId:r}}}),l(!1)):s(e("youtube.invalid"))},children:[(0,o.jsxs)(vh,{errored:Boolean(a),children:[(0,o.jsx)("input",{id:"youtube-popup-input",placeholder:"https://www.youtube.com/watch?v=abcdef",value:n,onChange:e=>i(e.target.value),"data-lpignore":!0,autoComplete:"off","data-form-type":"other"}),a&&(0,o.jsx)(yh,{children:a})]}),(0,o.jsx)(bh,{type:"submit",children:(0,o.jsxs)("span",{children:[(0,o.jsx)(lh,{}),e("youtube.share")]})})]})]})})};Ie=a("85Hg2");const _h=()=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M20.437 7.104a3.825 3.825 0 0 0-.573-.523 4.727 4.727 0 0 0-1.158-3.74C17.622 1.619 15.775 1 13.214 1H7a1.892 1.892 0 0 0-1.863 1.592l-2.59 16.406a1.533 1.533 0 0 0 1.516 1.785h2.664l-.082.52A1.467 1.467 0 0 0 8.093 23h3.235a1.762 1.762 0 0 0 1.75-1.47l.641-4.031.01-.055h.3c4.032 0 6.55-1.993 7.285-5.762a5.15 5.15 0 0 0-.877-4.578Zm-12.595 6.6-.714 4.535-.087.544H4.606L7.097 3h6.117c1.936 0 3.318.404 3.992 1.164a2.966 2.966 0 0 1 .608 2.733l-.018.113c-.012.076-.023.15-.044.246a5.847 5.847 0 0 1-2.005 3.67 6.678 6.678 0 0 1-4.217 1.183H9.706a1.88 1.88 0 0 0-1.864 1.595ZM19.351 11.3c-.55 2.828-2.242 4.145-5.322 4.145h-.484a1.762 1.762 0 0 0-1.75 1.473l-.65 4.074L8.717 21l.478-3.034.611-3.853h1.72c.156 0 .295-.023.448-.029.359-.012.716-.026 1.053-.067.205-.026.393-.073.59-.11.272-.05.545-.1.8-.17.191-.053.369-.122.55-.186a7.68 7.68 0 0 0 .698-.279c.168-.079.328-.167.486-.257a6.745 6.745 0 0 0 1.027-.713 6.56 6.56 0 0 0 .537-.519c.113-.12.23-.237.334-.367.173-.221.334-.452.48-.693.076-.122.161-.235.231-.363.203-.371.377-.757.521-1.154.009-.024.021-.044.03-.068.004-.01.01-.02.014-.032.198.717.207 1.472.026 2.193Z",fill:"#fff"})}),Sh=()=>(0,o.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[(0,o.jsx)("rect",{width:"14",height:"14",rx:"7",fill:"#fff"}),(0,o.jsx)("rect",{width:"14",height:"14",rx:"7",fill:"url(#paypalPattern)"}),(0,o.jsxs)("defs",{children:[(0,o.jsx)("pattern",{id:"paypalPattern",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:(0,o.jsx)("use",{xlinkHref:"#paypalImage",transform:"matrix(.00308 0 0 .00308 .154 .154)"})}),(0,o.jsx)("image",{id:"paypalImage",width:"225",height:"225",xlinkHref:"data:image/png;base64,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"})]})]});var kh=({colored:e})=>e?(0,o.jsx)(Sh,{}):(0,o.jsx)(_h,{});const Ch=e=>e?"215px":"227px",Eh=yr.div`
|
|
1569
1569
|
position: absolute;
|
|
1570
1570
|
width: 100%;
|
|
1571
|
-
bottom: ${e=>e.open?0:`-${
|
|
1571
|
+
bottom: ${e=>e.open?0:`-${Ch(e.desktop)}`};
|
|
1572
1572
|
transition: all 0.4s;
|
|
1573
1573
|
|
|
1574
1574
|
${e=>{if(e.desktop)return Xt`
|
|
1575
|
-
bottom: ${e.open?0:`calc(-${
|
|
1575
|
+
bottom: ${e.open?0:`calc(-${Ch(e.desktop)} - (100vh / 2))`};
|
|
1576
1576
|
height: 100%;
|
|
1577
1577
|
display: flex;
|
|
1578
1578
|
justify-content: center;
|
|
1579
1579
|
align-items: center;
|
|
1580
1580
|
`}}
|
|
1581
|
-
`,
|
|
1581
|
+
`,Rh=yr.div`
|
|
1582
1582
|
display: flex;
|
|
1583
1583
|
flex-direction: column;
|
|
1584
1584
|
width: ${e=>e.desktop?"375px":"100%"};
|
|
1585
|
-
height: ${({desktop:e})=>
|
|
1585
|
+
height: ${({desktop:e})=>Ch(e)};
|
|
1586
1586
|
max-height: 100vh;
|
|
1587
1587
|
background-color: ${e=>e.theme.popupBackgroundPrimaryColor};
|
|
1588
1588
|
color: ${e=>e.theme.popupTitleColor};
|
|
1589
1589
|
border-radius: ${e=>e.desktop?"20px":"20px 20px 0 0"};
|
|
1590
1590
|
padding: ${({desktop:e})=>e?"16px 14px":"16px 14px 28px"};
|
|
1591
1591
|
box-sizing: border-box;
|
|
1592
|
-
`,
|
|
1592
|
+
`,Ph=yr.div`
|
|
1593
1593
|
display: flex;
|
|
1594
1594
|
justify-content: space-between;
|
|
1595
1595
|
align-items: center;
|
|
1596
1596
|
margin-bottom: 30px;
|
|
1597
|
-
`,
|
|
1597
|
+
`,Th=yr.div`
|
|
1598
1598
|
display: flex;
|
|
1599
1599
|
align-items: center;
|
|
1600
1600
|
|
|
@@ -1608,7 +1608,7 @@ to {
|
|
|
1608
1608
|
width: 20px;
|
|
1609
1609
|
height: 20px;
|
|
1610
1610
|
}
|
|
1611
|
-
`,
|
|
1611
|
+
`,jh=yr.button`
|
|
1612
1612
|
display: flex;
|
|
1613
1613
|
justify-content: center;
|
|
1614
1614
|
align-items: center;
|
|
@@ -1627,10 +1627,10 @@ to {
|
|
|
1627
1627
|
fill: #000;
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
|
-
`,
|
|
1630
|
+
`,Oh=yr.form`
|
|
1631
1631
|
display: flex;
|
|
1632
1632
|
flex-direction: column;
|
|
1633
|
-
`,
|
|
1633
|
+
`,Mh=yr.div`
|
|
1634
1634
|
display: flex;
|
|
1635
1635
|
flex-direction: column;
|
|
1636
1636
|
position: relative;
|
|
@@ -1647,7 +1647,7 @@ to {
|
|
|
1647
1647
|
border: 1px solid ${({theme:e})=>e.primaryColor};
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
1650
|
-
`,
|
|
1650
|
+
`,Ih=yr.span`
|
|
1651
1651
|
position: absolute;
|
|
1652
1652
|
left: 0;
|
|
1653
1653
|
bottom: -20px;
|
|
@@ -1656,7 +1656,7 @@ to {
|
|
|
1656
1656
|
font-weight: 700;
|
|
1657
1657
|
line-height: 10px;
|
|
1658
1658
|
margin-top: 10px;
|
|
1659
|
-
`,
|
|
1659
|
+
`,Lh=yr.button`
|
|
1660
1660
|
background-color: ${({theme:e})=>e.primaryColor};
|
|
1661
1661
|
padding: ${({status:e})=>"waiting"!==e?"auto":"8px 18px"};
|
|
1662
1662
|
width: ${({status:e})=>"waiting"!==e?"46px":"100%"};
|
|
@@ -1677,44 +1677,44 @@ to {
|
|
|
1677
1677
|
align-items: center;
|
|
1678
1678
|
justify-content: center;
|
|
1679
1679
|
}
|
|
1680
|
-
`,
|
|
1680
|
+
`,Dh=yr.img`
|
|
1681
1681
|
width: 36px;
|
|
1682
1682
|
height: 36px;
|
|
1683
1683
|
border-radius: 8px;
|
|
1684
|
-
`,
|
|
1684
|
+
`,Ah=yr.div`
|
|
1685
1685
|
display: flex;
|
|
1686
1686
|
align-items: center;
|
|
1687
1687
|
justify-content: center;
|
|
1688
|
-
`,
|
|
1688
|
+
`,Nh="linkshare_sent";var Bh=()=>{const{t:e}=Li(),t=(0,Ie.useContext)(dr),n=(0,Ie.useRef)(null),i=(0,Ie.useRef)(null),[a,s]=(0,Ie.useState)(""),[c,l]=(0,Ie.useState)(null),[d,u]=(0,Ie.useState)("waiting"),{isLinksharePopupVisible:h,setIsLinksharePopupVisible:f,orientation:m,options:v}=(0,Ie.useContext)(is),{streams:y}=us(),b="landscape"===m,w=(0,Ie.useCallback)((t=>{const{type:r,data:n}=t.detail.event;if(r===Nh)((e,t)=>{let r=new URL(e.url).hostname;r.startsWith("www.")&&(r=r.slice(4));const n=e.ogImage?(0,o.jsx)(Dh,{src:e.ogImage}):void 0;Dr(e.title,{width:"350px",icon:n,status:{icon:e.favicon,text:t("misc.from"),boldText:r},button:{text:t("misc.open"),action:({close:t})=>{window.open(e.url,"_blank"),t()}},ellipsis:!0,duration:1e4}),dl({title:e.title,url:e.url,iconUrl:e.ogImage,statusIconUrl:e.favicon,statusText:r})})(n,e);else if("paypal_invoice"===r){((e,t,r)=>{const n=e||r("misc.user"),i=r("shareLink.invoice",{user:n});Dr(i,{button:{icon:(0,o.jsx)(kh,{}),text:r("shareLink.pay"),action:()=>window.open(t,"_blank")},status:{icon:(0,o.jsx)(kh,{colored:!0}),text:r("shareLink.poweredBy"),boldText:"PayPal"},duration:1e4}),dl({title:i,url:t,statusIconUrl:"https://stream-assets.snapcall.io/icons/paypal.png",statusText:"PayPal"})})(y.find((e=>e.id===t.detail.peerId))?.profile?.name,n.url,e)}}),[y,e]);(0,Ie.useEffect)((()=>(ns.addEventListener("customMessage",w),()=>{ns.removeEventListener("customMessage",w)})),[w]);return(0,o.jsx)(Eh,{open:h,desktop:b,onTransitionEnd:()=>{h&&i.current?.focus(),"done"===d&&u("waiting")},children:(0,o.jsxs)(Rh,{ref:n,desktop:b,children:[(0,o.jsxs)(Ph,{children:[(0,o.jsxs)(Th,{children:[(0,o.jsx)(Hl,{color:t.popupTitleColor}),(0,o.jsx)("h4",{children:e("shareLink.title2")})]}),(0,o.jsx)(jh,{onClick:()=>f(!1),children:(0,o.jsx)(Gc,{})})]}),(0,o.jsxs)(Oh,{onSubmit:async t=>{if(t.preventDefault(),!a)return;let n;l(null),u("loading"),p.event("linkshareShare");try{n=new URL(a),"http"===n.protocol&&(n.protocol="https")}catch(t){l(e("shareLink.invalid")),console.error(t)}if(n){try{if(-1!==n.href.indexOf("paypal.com/invoice"))ns.sendCustomMessageToAll({type:"paypal_invoice",data:{url:n}});else{const{linkData:e}=await fetch(`${v.streamApiURL}/shareLink`,{method:"POST",body:JSON.stringify({url:n.href})}).then((e=>e.json()));ns.sendCustomMessageToAll({type:Nh,data:e})}if(y.length<2){const t=y[0]?.profile?.name||e("misc.user");r(g)(e("shareLink.sentToUser",{user:t}))}else r(g)(e("shareLink.sentToUsers"));f(!1)}catch(t){console.error(t),r(g)(e("shareLink.failed"),{className:"error"})}s("")}u("done")},children:[(0,o.jsxs)(Mh,{errored:Boolean(c),children:[(0,o.jsx)("input",{id:"linkshare-popup-input",ref:i,placeholder:"https://www.example.com",value:a,onChange:e=>s(e.target.value),"data-lpignore":!0,autoComplete:"off","data-form-type":"other"}),c&&(0,o.jsx)(Ih,{children:c})]}),(0,o.jsx)(Lh,{type:"submit",disabled:"waiting"!==d,status:d,children:"waiting"!==d?(0,o.jsx)(Ah,{children:(0,o.jsx)(ad,{size:"18px"})}):(0,o.jsxs)("span",{children:[(0,o.jsx)(lh,{}),e("shareLink.title")]})})]})]})})};Ie=a("85Hg2");var Fh=()=>(0,o.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)("path",{d:"M12.266 7.325 8.691 10.91 7.316 9.534a.833.833 0 1 0-1.175 1.175l1.958 1.966a.831.831 0 0 0 .592.242.833.833 0 0 0 .583-.242l4.167-4.166a.833.833 0 1 0-1.175-1.184ZM9.999 1.667a8.333 8.333 0 1 0 0 16.667 8.333 8.333 0 0 0 0-16.667Zm0 15a6.667 6.667 0 1 1 0-13.334 6.667 6.667 0 0 1 0 13.334Z",fill:"#fff"})});const zh=e=>e?"420px":"432px",Uh=yr.div`
|
|
1689
1689
|
position: absolute;
|
|
1690
1690
|
width: 100%;
|
|
1691
|
-
bottom: ${e=>e.open?0:`-${
|
|
1691
|
+
bottom: ${e=>e.open?0:`-${zh(e.desktop)}`};
|
|
1692
1692
|
transition: all 0.4s;
|
|
1693
1693
|
|
|
1694
1694
|
${e=>{if(e.desktop)return Xt`
|
|
1695
|
-
bottom: ${e.open?0:`calc(-${
|
|
1695
|
+
bottom: ${e.open?0:`calc(-${zh(e.desktop)} - (100vh / 2))`};
|
|
1696
1696
|
height: 100%;
|
|
1697
1697
|
display: flex;
|
|
1698
1698
|
justify-content: center;
|
|
1699
1699
|
align-items: center;
|
|
1700
1700
|
`}}
|
|
1701
|
-
`,
|
|
1701
|
+
`,Vh=yr.div`
|
|
1702
1702
|
display: flex;
|
|
1703
1703
|
flex-direction: column;
|
|
1704
1704
|
width: ${e=>e.desktop?"375px":"100%"};
|
|
1705
|
-
height: ${({desktop:e})=>
|
|
1705
|
+
height: ${({desktop:e})=>zh(e)};
|
|
1706
1706
|
max-height: 100vh;
|
|
1707
1707
|
background-color: ${e=>e.theme.popupBackgroundPrimaryColor};
|
|
1708
1708
|
color: ${e=>e.theme.popupTitleColor};
|
|
1709
1709
|
border-radius: ${e=>e.desktop?"20px":"20px 20px 0 0"};
|
|
1710
1710
|
padding: 12px 14px 30px;
|
|
1711
1711
|
box-sizing: border-box;
|
|
1712
|
-
|
|
1712
|
+
`,Hh=yr.div`
|
|
1713
1713
|
display: flex;
|
|
1714
1714
|
justify-content: space-between;
|
|
1715
1715
|
align-items: center;
|
|
1716
1716
|
margin-bottom: 30px;
|
|
1717
|
-
|
|
1717
|
+
`,$h=yr.div`
|
|
1718
1718
|
display: flex;
|
|
1719
1719
|
align-items: center;
|
|
1720
1720
|
|
|
@@ -1728,7 +1728,7 @@ to {
|
|
|
1728
1728
|
width: 20px;
|
|
1729
1729
|
height: 20px;
|
|
1730
1730
|
}
|
|
1731
|
-
`,
|
|
1731
|
+
`,Wh=yr.button`
|
|
1732
1732
|
display: flex;
|
|
1733
1733
|
justify-content: center;
|
|
1734
1734
|
align-items: center;
|
|
@@ -1747,17 +1747,17 @@ to {
|
|
|
1747
1747
|
fill: #000;
|
|
1748
1748
|
}
|
|
1749
1749
|
}
|
|
1750
|
-
`,
|
|
1750
|
+
`,qh=yr.form`
|
|
1751
1751
|
display: flex;
|
|
1752
1752
|
flex-direction: column;
|
|
1753
|
-
`,
|
|
1753
|
+
`,Gh=yr.div`
|
|
1754
1754
|
display: flex;
|
|
1755
1755
|
flex-direction: row;
|
|
1756
1756
|
flex-wrap: wrap-reverse;
|
|
1757
1757
|
gap: 10px 20px;
|
|
1758
1758
|
width: 280px;
|
|
1759
1759
|
margin: auto;
|
|
1760
|
-
`,
|
|
1760
|
+
`,Zh=yr.label`
|
|
1761
1761
|
display: flex;
|
|
1762
1762
|
flex-direction: column;
|
|
1763
1763
|
position: relative;
|
|
@@ -1801,7 +1801,7 @@ to {
|
|
|
1801
1801
|
text-align: center;
|
|
1802
1802
|
display: ${({image:e})=>e?"none":"inline"};
|
|
1803
1803
|
}
|
|
1804
|
-
`,
|
|
1804
|
+
`,Kh=yr.button`
|
|
1805
1805
|
background-color: ${({theme:e})=>e.primaryColor};
|
|
1806
1806
|
padding: 8px 18px;
|
|
1807
1807
|
width: 280px;
|
|
@@ -1822,7 +1822,7 @@ to {
|
|
|
1822
1822
|
align-items: center;
|
|
1823
1823
|
justify-content: center;
|
|
1824
1824
|
}
|
|
1825
|
-
`,
|
|
1825
|
+
`,Yh=[{title:"Blue",id:"background-blue",iconUrl:"https://stream-assets.snapcall.io/backgrounds/blue_background_icon.png",value:"https://stream-assets.snapcall.io/backgrounds/blue_background.png"},{title:"Cold",id:"background-cold",iconUrl:"https://stream-assets.snapcall.io/backgrounds/cold_background_icon.png",value:"https://stream-assets.snapcall.io/backgrounds/cold_background.png"},{title:"Bricks",id:"background-bricks",iconUrl:"https://stream-assets.snapcall.io/backgrounds/bricks_background_icon.png",value:"https://stream-assets.snapcall.io/backgrounds/bricks_background.png"},{title:"White",id:"background-white",iconUrl:"https://stream-assets.snapcall.io/backgrounds/white_background_icon.png",value:"https://stream-assets.snapcall.io/backgrounds/white_background.png"},{title:"Yellow",id:"background-yellow",iconUrl:"https://stream-assets.snapcall.io/backgrounds/yellow_background_icon.png",value:"https://stream-assets.snapcall.io/backgrounds/yellow_background.png"},{title:"Warm",id:"background-warm",iconUrl:"https://stream-assets.snapcall.io/backgrounds/warm_background_icon.png",value:"https://stream-assets.snapcall.io/backgrounds/warm_background.png"},{title:"None",value:"none",id:"background-none"},{title:"Blurred",value:"blurred",id:"background-blurred"}];var Qh=()=>{const{t:e}=Li(),t=(0,Ie.useRef)(null),{isVirtualBackgroundPopupVisible:r,setIsVirtualBackgroundPopupVisible:n,orientation:i}=(0,Ie.useContext)(is),a="landscape"===i;return(0,o.jsx)(Uh,{open:r,desktop:a,children:(0,o.jsxs)(Vh,{ref:t,desktop:a,children:[(0,o.jsxs)(Hh,{children:[(0,o.jsxs)($h,{children:[(0,o.jsx)(ks,{color:"#000"}),(0,o.jsx)("h4",{children:e("virtualBackground.title")})]}),(0,o.jsx)(Wh,{onClick:()=>n(!1),children:(0,o.jsx)(Gc,{})})]}),(0,o.jsxs)(qh,{onSubmit:e=>{e.preventDefault();const t=e.currentTarget.elements.background.value;if("none"===t)ns.stopVideoBackground();else if("blurred"===t)ns.setVideoBackground({blurLevel:16,type:"blur"}),ns.initVideoBackground();else{const e=new Image;e.src=t,e.crossOrigin="anonymous",e.onload=()=>{ns.setVideoBackground({background:e,type:"background"}),ns.initVideoBackground()}}n(!1)},children:[(0,o.jsx)(Gh,{children:Yh.map((({id:e,title:t,value:r,iconUrl:n})=>(0,o.jsxs)(Zh,{htmlFor:e,image:n,children:[(0,o.jsx)("input",{type:"radio",value:r,id:e,name:"background",defaultChecked:"none"===r}),(0,o.jsx)("span",{children:t})]},e)))}),(0,o.jsx)(Kh,{type:"submit",children:(0,o.jsxs)("span",{children:[(0,o.jsx)(Fh,{}),e("virtualBackground.setBackground")]})})]})]})})};const Jh=yr.div`
|
|
1826
1826
|
position: absolute;
|
|
1827
1827
|
width: 100%;
|
|
1828
1828
|
height: 100%;
|
|
@@ -1830,7 +1830,7 @@ to {
|
|
|
1830
1830
|
z-index: ${e=>e.open?100:-1};
|
|
1831
1831
|
overflow: hidden;
|
|
1832
1832
|
transition: all ${e=>e.open?"0.2s":"0.6s"};
|
|
1833
|
-
`;var
|
|
1833
|
+
`;var Xh=()=>{const{isQuickConnectPopupVisible:e,isSettingsMenuVisible:t,isYoutubePopupVisible:r,isLinksharePopupVisible:n,isVirtualBackgroundPopupVisible:i}=(0,Ie.useContext)(is),a=e||t||r||n||i;return(0,o.jsxs)(Jh,{open:a,children:[(0,o.jsx)(Fp,{}),(0,o.jsx)(ch,{}),(0,o.jsx)(xh,{}),(0,o.jsx)(Bh,{}),(0,o.jsx)(Qh,{})]})};Ie=a("85Hg2");const ef=yr.div`
|
|
1834
1834
|
display: flex;
|
|
1835
1835
|
flex: 1;
|
|
1836
1836
|
flex-direction: column;
|
|
@@ -1839,18 +1839,18 @@ to {
|
|
|
1839
1839
|
background-color: #000;
|
|
1840
1840
|
color: #fff;
|
|
1841
1841
|
padding-top: 70px;
|
|
1842
|
-
`,
|
|
1842
|
+
`,tf=yr.span`
|
|
1843
1843
|
font-size: 60px;
|
|
1844
|
-
`,
|
|
1844
|
+
`,rf=yr.h1`
|
|
1845
1845
|
font-size: 28px;
|
|
1846
1846
|
font-weight: 600;
|
|
1847
1847
|
line-height: 33.6px;
|
|
1848
|
-
`,
|
|
1848
|
+
`,nf=yr.p`
|
|
1849
1849
|
font-size: 22px;
|
|
1850
1850
|
font-weight: 500;
|
|
1851
1851
|
line-height: 26.4px;
|
|
1852
1852
|
margin: 0;
|
|
1853
|
-
`,
|
|
1853
|
+
`,af=yr.button`
|
|
1854
1854
|
background-color: ${({theme:e})=>e.primaryColor};
|
|
1855
1855
|
border: none;
|
|
1856
1856
|
border-radius: 50px;
|
|
@@ -1860,7 +1860,7 @@ to {
|
|
|
1860
1860
|
line-height: 18px;
|
|
1861
1861
|
color: #fff;
|
|
1862
1862
|
margin-top: 30px;
|
|
1863
|
-
`;var
|
|
1863
|
+
`;var of=()=>{const{t:e}=Li(),{streamState:t,setStreamState:r}=(0,Ie.useContext)(is),n="ended"===t,i="terminated"===t,a="expired"===t,s="full"===t;return(0,Ie.useEffect)((()=>{document.pictureInPictureElement&&document.exitPictureInPicture()}),[]),(0,o.jsxs)(ef,{children:[(0,o.jsxs)(tf,{children:[(n||i)&&"👋",(a||s)&&"🥺"]}),(0,o.jsxs)(rf,{children:[n&&e("endView.callLeft"),i&&e("endView.callEnded"),a&&e("endView.tooLate"),s&&e("endView.full")]}),a&&(0,o.jsx)(nf,{children:e("endView.callIsOver")}),s&&(0,o.jsx)(nf,{children:e("endView.fullDescription")}),(n||s)&&(0,o.jsx)(af,{onClick:()=>{ns.init(),r("streaming")},children:e("endView.goBack")}),!s&&(0,o.jsx)(ul,{})]})};Ie=a("85Hg2");const sf=new Audio("https://cdn.snapcall.io/stream/connected.mp3"),cf=new Audio("https://cdn.snapcall.io/stream/disconnected.mp3"),lf=new Audio("https://cdn.snapcall.io/stream/user-connected.mp3"),df=new Audio("https://cdn.snapcall.io/stream/user-disconnected.mp3");var uf=()=>{const{userInteractionTriggered:e}=(0,Ie.useContext)(is),t=async()=>{try{lf.currentTime=0,await lf.play()}catch(e){console.warn("Couldn't play user connected sound")}},r=async()=>{try{df.currentTime=0,await df.play()}catch(e){console.warn("Couldn't play user disconnected sound")}},n=async()=>{try{await cf.play()}catch(e){console.warn("Couldn't play disconnected sound")}};return(0,Ie.useEffect)((()=>(ns.addEventListener("newPeer",t),ns.addEventListener("peerClosed",r),ns.addEventListener("leaveRoom",n),()=>{ns.removeEventListener("newPeer",t),ns.removeEventListener("peerClosed",r),ns.removeEventListener("leaveRoom",n)})),[]),(0,Ie.useEffect)((()=>{e&&(async()=>{try{await sf.play()}catch(e){console.warn("Couldn't play connected sound")}})()}),[e]),null};const pf={error:ql,critical:Gl},hf=gr`
|
|
1864
1864
|
@keyframes fadeIn {
|
|
1865
1865
|
0% {
|
|
1866
1866
|
opacity: 0;
|
|
@@ -1877,15 +1877,15 @@ to {
|
|
|
1877
1877
|
opacity: 0;
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
|
-
`,
|
|
1880
|
+
`,ff={top:110},mf={style:{fontSize:"14px",fontWeight:400,lineHeight:"18px",padding:"10px 15px",color:"#fff",backgroundColor:"rgba(45, 45, 45, 0.75)",textAlign:"left",borderRadius:"50px"}},gf=yr.div`
|
|
1881
1881
|
max-width: ${({maxWidth:e})=>e||"200px"};
|
|
1882
1882
|
div {
|
|
1883
1883
|
margin: 0;
|
|
1884
1884
|
}
|
|
1885
|
-
`,
|
|
1885
|
+
`,vf=yr.div`
|
|
1886
1886
|
display: flex;
|
|
1887
1887
|
margin-right: 10px;
|
|
1888
|
-
`;var
|
|
1888
|
+
`;var yf=()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(hf,{}),(0,o.jsx)(g.Toaster,{toastOptions:mf,containerStyle:ff,gutter:20,children:e=>(0,o.jsx)(g.ToastBar,{toast:e,style:{...e.style,animation:e.visible?"fadeIn 1s ease forwards":"fadeOut 1s forwards ease"},children:({message:t})=>{const r=(e=>{if(e){const t=pf[e];if(t)return t}return null})(e.className);return(0,o.jsxs)(o.Fragment,{children:[r&&(0,o.jsx)(vf,{children:r}),(0,o.jsx)(gf,{maxWidth:e.style?.maxWidth,children:t})]})}})})]});const bf={primaryColor:"#268AFA",backgroundColor:"#fff",controlBarBackground:"#fff",logoColor:"#000",controlsIconColor:"#4f5a65",controlsBackgroundColor:"#f9f9f9",controlsBorderColor:"#f5f5f5",controlsHoverBorderColor:"#8d8d8d",streamTileBackgroundColor:"#eaebec",streamTileBorderColor:"#d3d6d9",settingsBackgroundColor:"#fff",settingsHeaderTextColor:"#000",settingsTextColor:"#000",settingsCloseBackgroundColor:"#eaebec",popupBackgroundPrimaryColor:"#fff",popupBackgroundSecondaryColor:"#f3f3f3",popupBackgroundThirdColor:"#f7f7f7",popupBorderColor:"#d4d4d4",popupTitleColor:"#2d2d2d"},wf={primaryColor:"#268AFA",backgroundColor:"#000",controlBarBackground:"linear-gradient(180deg, #000000 0%, #131313 100%)",logoColor:"#fff",controlsIconColor:"#fff",controlsBackgroundColor:"#2d2d2d",controlsBorderColor:"#343434",controlsHoverBorderColor:"#8d8d8d",streamTileBackgroundColor:"#131313",streamTileBorderColor:"#1f1f1f",settingsBackgroundColor:"#242324",settingsHeaderTextColor:"#f9f9f9",settingsTextColor:"#fff",settingsCloseBackgroundColor:"#7b7c7e",popupBackgroundPrimaryColor:"#fff",popupBackgroundSecondaryColor:"#f3f3f3",popupBackgroundThirdColor:"#f7f7f7",popupBorderColor:"#d4d4d4",popupTitleColor:"#2d2d2d"};var xf=()=>(0,o.jsx)("svg",{style:{position:"absolute",width:0,height:0},children:(0,o.jsxs)("defs",{children:[(0,o.jsxs)("linearGradient",{id:"snapcallLogoSmall",x1:"34.5",y1:"2",x2:"34.5",y2:"66.334",gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#D4D4D4"}),(0,o.jsx)("stop",{offset:"1",stopColor:"#979797"})]}),(0,o.jsxs)("linearGradient",{id:"microphoneBottom",x1:"15",y1:"12.5",x2:"15",y2:"28.75",gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#9A9A9A"}),(0,o.jsx)("stop",{offset:"1",stopColor:"#969696"})]}),(0,o.jsxs)("linearGradient",{id:"microphoneTop",x1:"15",y1:"1.25",x2:"15",y2:"18.75",gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#D4D4D4"}),(0,o.jsx)("stop",{offset:"1",stopColor:"#BFBFBF"})]}),(0,o.jsxs)("linearGradient",{id:"cameraRight",x1:"24.531",y1:"8.438",x2:"24.531",y2:"21.563",gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#9A9A9A"}),(0,o.jsx)("stop",{offset:"1",stopColor:"#969696"})]}),(0,o.jsxs)("linearGradient",{id:"cameraLeft",x1:"11.875",y1:"7.5",x2:"11.875",y2:"22.5",gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#D4D4D4"}),(0,o.jsx)("stop",{offset:"1",stopColor:"#BFBFBF"})]}),(0,o.jsxs)("linearGradient",{id:"screenTop",x1:"15",y1:"3.75",x2:"15",y2:"21.25",gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#D4D4D4"}),(0,o.jsx)("stop",{offset:"1",stopColor:"#BFBFBF"})]}),(0,o.jsxs)("linearGradient",{id:"screenBottom",x1:"15",y1:"21.25",x2:"15",y2:"26.25",gradientUnits:"userSpaceOnUse",children:[(0,o.jsx)("stop",{stopColor:"#9A9A9A"}),(0,o.jsx)("stop",{offset:"1",stopColor:"#969696"})]}),(0,o.jsx)("clipPath",{id:"hangup",children:(0,o.jsx)("path",{fill:"#fff",transform:"translate(.5)",d:"M0 0h24v24H0z"})}),(0,o.jsx)("clipPath",{id:"pip",children:(0,o.jsx)("path",{fill:"#fff",d:"M0 0h24v24H0z"})}),(0,o.jsx)("clipPath",{id:"greetingSnapcallLogo",children:(0,o.jsx)("path",{fill:"#fff",d:"M0 0h72v72H0z"})})]})});const _f=yr.div`
|
|
1889
1889
|
display: flex;
|
|
1890
1890
|
justify-content: center;
|
|
1891
1891
|
align-items: center;
|
|
@@ -1894,7 +1894,7 @@ to {
|
|
|
1894
1894
|
height: 100%;
|
|
1895
1895
|
background-color: rgba(0, 0, 0, 0.75);
|
|
1896
1896
|
z-index: 999;
|
|
1897
|
-
`,
|
|
1897
|
+
`,Sf=yr.div`
|
|
1898
1898
|
display: flex;
|
|
1899
1899
|
flex-direction: column;
|
|
1900
1900
|
align-items: flex-start;
|
|
@@ -1903,17 +1903,17 @@ to {
|
|
|
1903
1903
|
max-width: 300px;
|
|
1904
1904
|
border-radius: 10px;
|
|
1905
1905
|
box-sizing: border-box;
|
|
1906
|
-
`,
|
|
1906
|
+
`,kf=yr.h2`
|
|
1907
1907
|
font-size: 16px;
|
|
1908
1908
|
font-weight: 700;
|
|
1909
1909
|
color: #242324;
|
|
1910
1910
|
margin: 0 0 10px 0;
|
|
1911
|
-
`,
|
|
1911
|
+
`,Cf=yr.p`
|
|
1912
1912
|
font-size: 12px;
|
|
1913
1913
|
font-weight: 500;
|
|
1914
1914
|
color: #2d2d2d;
|
|
1915
1915
|
margin: 0 0 15px 0;
|
|
1916
|
-
`,
|
|
1916
|
+
`,Ef=yr.button`
|
|
1917
1917
|
align-self: flex-end;
|
|
1918
1918
|
color: #242324;
|
|
1919
1919
|
background-color: transparent;
|
|
@@ -1929,7 +1929,7 @@ to {
|
|
|
1929
1929
|
color: #fff;
|
|
1930
1930
|
background-color: #242324;
|
|
1931
1931
|
}
|
|
1932
|
-
`;var
|
|
1932
|
+
`;var Rf=({close:e})=>{const{t:t}=Li();return(0,o.jsx)(_f,{children:(0,o.jsxs)(Sf,{children:[(0,o.jsx)(kf,{children:t("notifications.blockedMicrophonePopupTitle")}),(0,o.jsx)(Cf,{children:t("notifications.blockedMicrophonePopup")}),(0,o.jsx)(Ef,{onClick:e,children:"Dismiss"})]})})};const Pf=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),Tf=URL.createObjectURL(Pf);let jf;const Of=()=>{jf?.getTracks().forEach((e=>{e.stop()})),jf=void 0},Mf=async e=>{try{const e=new Audio(Tf);await e.play()}catch(t){console.warn("User interaction is required, asking audio GUM"),jf=await navigator.mediaDevices.getUserMedia({audio:!0,video:!e.audioTiles}),jf.getVideoTracks().forEach((e=>e.stop()))}},If=gr`
|
|
1933
1933
|
::-webkit-scrollbar {
|
|
1934
1934
|
display: none;
|
|
1935
1935
|
width: 0;
|
|
@@ -1972,7 +1972,7 @@ to {
|
|
|
1972
1972
|
src: url('https://cdn.snapcall.io/fonts/Gazpacho/Bold.woff2') format('woff2'),
|
|
1973
1973
|
url('https://cdn.snapcall.io/fonts/Gazpacho/Bold.woff') format('woff');
|
|
1974
1974
|
}
|
|
1975
|
-
`,
|
|
1975
|
+
`,Lf=yr.div`
|
|
1976
1976
|
display: flex;
|
|
1977
1977
|
flex-direction: column;
|
|
1978
1978
|
width: 100%;
|
|
@@ -1993,7 +1993,7 @@ to {
|
|
|
1993
1993
|
font-size: 16px;
|
|
1994
1994
|
font-family: Lato;
|
|
1995
1995
|
}
|
|
1996
|
-
`,
|
|
1996
|
+
`,Df=(()=>{try{const e=localStorage.getItem("stream_ui_theme");return e||"dark"}catch(e){return console.warn(e),"dark"}})(),Af=Di();let Nf=-1;var Bf=({options:e})=>{const[t,n]=(0,Ie.useState)(void 0),i=(0,Ie.useRef)(null),a=(0,Ie.useRef)(null),s=(0,Ie.useRef)(null),[c,l]=(0,Ie.useState)("streaming"),[d,u]=(0,Ie.useState)(!1),[h,f]=(0,Ie.useState)(!1),[m,v]=(0,Ie.useState)(!1),[y,b]=(0,Ie.useState)(!1),[w,x]=(0,Ie.useState)(!1),[_,S]=(0,Ie.useState)(Df),[k,C]=(0,Ie.useState)(e.language||Af),[E,R]=(0,Ie.useState)({}),[P,T]=(0,Ie.useState)(!0),[j,O]=(0,Ie.useState)(!1),[M,I]=(0,Ie.useState)(!1),[L,D]=(0,Ie.useState)(!1),[A,N]=(0,Ie.useState)(!1),[B,F]=qs(i.current),[z,U]=(0,Ie.useState)(!1),V=(B||window.screen.width)>(F||window.screen.height)?"landscape":"portrait",H="dark"===_?wf:bf,$=e=>{"localVideoAvailable"===e.type?O(!0):O(!1)},W=e=>{"screenshareEnabled"===e.type?I(!0):I(!1)},q=e=>{"microphoneMute"===e.type?T(!0):T(!1)},G=e=>{const t=e.detail.label;Dr(`Connected to ${t}`,{duration:3e3,icon:(0,o.jsx)(Ks,{}),messageStyle:{fontWeight:600}})},Z=e=>{const{profile:t}=e.detail;R(t)},K=()=>{Of(),l("ended"),T(!0),O(!1),I(!1),N(!1)},Y=()=>{Of(),l("terminated")},Q=()=>{l("expired")},J=e=>{const{success:t,email:n}=e.detail;t?(D(!0),n&&p.identify(null,{email:n})):r(g)("An error occured while trying to join the room as an agent",{className:"error"})},X=e=>{const t=Date.now();"USERLIMIT"!==e.detail.code?-1!==Nf&&Nf+2e4>t||(Nf=t,Dr(`A critical error has occurred (error ${e.detail.code}).`,{icon:Gl,button:{text:"Reload",action:()=>{window.location.reload()}},duration:2e4})):l("full")};return(0,Ie.useEffect)((()=>{try{localStorage.setItem("stream_ui_theme",_)}catch(e){console.warn(e)}}),[_]),(0,Ie.useEffect)((()=>{try{localStorage.setItem("stream_ui_language",k),Bi.changeLanguage(k)}catch(e){console.warn(e)}}),[k]),(0,Ie.useEffect)((()=>(ns.addEventListener("localVideoAvailable",$),ns.addEventListener("localVideoUnavailable",$),ns.addEventListener("screenshareEnabled",W),ns.addEventListener("screenshareDisabled",W),ns.addEventListener("microphoneEnabled",q),ns.addEventListener("microphoneMute",q),ns.addEventListener("microphoneUnmute",q),ns.addEventListener("defaultAudioDeviceChange",G),ns.addEventListener("selfProfileUpdate",Z),ns.addEventListener("terminateRoom",Y),ns.addEventListener("leaveRoom",K),ns.addEventListener("invalidRoom",Q),ns.addEventListener("agentIdentity",J),ns.addEventListener("criticalError",X),()=>{ns.removeEventListener("localVideoAvailable",$),ns.removeEventListener("localVideoUnavailable",$),ns.removeEventListener("screenshareEnabled",W),ns.removeEventListener("screenshareDisabled",W),ns.removeEventListener("microphoneEnabled",q),ns.removeEventListener("microphoneMute",q),ns.removeEventListener("microphoneUnmute",q),ns.removeEventListener("defaultAudioDeviceChange",G),ns.removeEventListener("selfProfileUpdate",Z),ns.removeEventListener("terminateRoom",Y),ns.removeEventListener("leaveRoom",K),ns.removeEventListener("invalidRoom",Q),ns.removeEventListener("agentIdentity",J),ns.removeEventListener("criticalError",X)})),[]),(0,Ie.useEffect)((()=>{const t=async t=>{const r=t.detail.peerId;n(r);try{await Mf(e),N(!0)}catch(e){U(!0),console.error("User interaction trigger failed",e)}};return ns.addEventListener("enterRoom",t),()=>{ns.removeEventListener("enterRoom",t)}}),[e]),(0,o.jsx)(is.Provider,{value:{selfPeerId:t,streamUIContainerRef:i,videosContainerRef:a,remoteTilesContainerRef:s,streamState:c,setStreamState:l,isQuickConnectPopupVisible:d,setIsQuickConnectPopupVisible:u,isSettingsMenuVisible:h,setIsSettingsMenuVisible:f,isYoutubePopupVisible:m,setIsYoutubePopupVisible:v,isLinksharePopupVisible:y,setIsLinksharePopupVisible:b,isVirtualBackgroundPopupVisible:w,setIsVirtualBackgroundPopupVisible:x,theme:_,setTheme:S,language:k,setLanguage:C,options:e,profile:E,muted:P,streaming:j,screensharing:M,isAgent:L,userInteractionTriggered:A,orientation:V},children:(0,o.jsxs)(ur,{theme:H,children:[(0,o.jsx)(If,{}),(0,o.jsx)(xf,{}),(0,o.jsxs)(Lf,{ref:i,children:[(0,o.jsx)(yf,{}),(0,o.jsx)(uf,{}),z&&(0,o.jsx)(Rf,{close:()=>{N(!0),U(!1)}}),"streaming"===c&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(ds,{children:[(0,o.jsx)(Ws,{}),(0,o.jsx)(ed,{}),(0,o.jsx)(kd,{}),(0,o.jsx)(Xh,{})]})}),("ended"===c||"terminated"===c||"full"===c||"expired"===c)&&(0,o.jsx)(of,{})]})]})})};window.hj=window.hj||function(){(hj.q=hj.q||[]).push(arguments)};Ie=a("85Hg2");var Ff=()=>(0,o.jsx)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsxs)("g",{clipPath:"url(#greetingSnapcallLogo)",children:[(0,o.jsx)("path",{d:"M0 36C0 6.354 6.354 0 36 0s36 6.354 36 36-6.354 36-36 36S0 65.646 0 36Z",fill:"#000"}),(0,o.jsx)("path",{d:"M36.225 57.428c2.367 0 4.35-1.964 3.62-4.215a13.38 13.38 0 0 0-3.133-5.203c-2.432-2.498-5.73-3.902-9.17-3.902-3.44 0-6.74 1.404-9.172 3.902a13.381 13.381 0 0 0-3.132 5.203c-.731 2.25 1.252 4.215 3.62 4.215h17.367ZM35.775 14.572c-2.367 0-4.35 1.965-3.62 4.216a13.381 13.381 0 0 0 3.133 5.203c2.432 2.498 5.73 3.901 9.17 3.901 3.44 0 6.74-1.403 9.172-3.901a13.375 13.375 0 0 0 3.132-5.203c.731-2.252-1.252-4.216-3.62-4.216H35.776ZM44.459 53.143c0 2.367 1.971 4.352 4.204 3.566a12.924 12.924 0 0 0 4.967-3.182c2.432-2.498 3.799-5.886 3.799-9.419 0-3.533-1.367-6.921-3.8-9.42a12.923 12.923 0 0 0-4.966-3.181c-2.233-.786-4.204 1.2-4.204 3.566v18.07ZM27.541 18.857c0-2.367-1.971-4.352-4.204-3.566a12.923 12.923 0 0 0-4.967 3.182c-2.432 2.498-3.799 5.886-3.799 9.42 0 3.532 1.367 6.92 3.8 9.418a12.923 12.923 0 0 0 4.966 3.182c2.233.786 4.204-1.2 4.204-3.566v-18.07Z",fill:"#fff"})]})});const zf=yr.div`
|
|
1997
1997
|
height: 100%;
|
|
1998
1998
|
display: flex;
|
|
1999
1999
|
flex-direction: column;
|
|
@@ -2002,7 +2002,7 @@ to {
|
|
|
2002
2002
|
padding-top: 76px;
|
|
2003
2003
|
font-family: Lato;
|
|
2004
2004
|
box-sizing: border-box;
|
|
2005
|
-
`,
|
|
2005
|
+
`,Uf=(yr.div`
|
|
2006
2006
|
display: flex;
|
|
2007
2007
|
align-items: center;
|
|
2008
2008
|
justify-content: center;
|
|
@@ -2021,31 +2021,31 @@ to {
|
|
|
2021
2021
|
font-weight: 700;
|
|
2022
2022
|
font-family: Gazpacho;
|
|
2023
2023
|
text-align: center;
|
|
2024
|
-
`),
|
|
2024
|
+
`),Vf=yr.div`
|
|
2025
2025
|
display: flex;
|
|
2026
2026
|
align-items: center;
|
|
2027
2027
|
gap: 10px;
|
|
2028
|
-
|
|
2028
|
+
`,Hf=yr.div`
|
|
2029
2029
|
position: relative;
|
|
2030
2030
|
width: 350px;
|
|
2031
2031
|
height: 350px;
|
|
2032
2032
|
display: flex;
|
|
2033
2033
|
align-items: center;
|
|
2034
2034
|
justify-content: center;
|
|
2035
|
-
|
|
2035
|
+
`,$f=yr.video`
|
|
2036
2036
|
width: 300px;
|
|
2037
2037
|
height: 300px;
|
|
2038
2038
|
background-color: black;
|
|
2039
2039
|
border-radius: 15px;
|
|
2040
2040
|
object-fit: cover;
|
|
2041
|
-
`,
|
|
2041
|
+
`,Wf=yr.div`
|
|
2042
2042
|
display: flex;
|
|
2043
2043
|
position: absolute;
|
|
2044
2044
|
top: 8px;
|
|
2045
2045
|
left: 8px;
|
|
2046
2046
|
gap: 8px;
|
|
2047
2047
|
z-index: 15;
|
|
2048
|
-
`,
|
|
2048
|
+
`,qf=yr.div`
|
|
2049
2049
|
display: flex;
|
|
2050
2050
|
justify-content: center;
|
|
2051
2051
|
align-items: center;
|
|
@@ -2054,7 +2054,7 @@ to {
|
|
|
2054
2054
|
border-radius: 50%;
|
|
2055
2055
|
background-color: rgba(28, 32, 36, 0.25);
|
|
2056
2056
|
z-index: 2;
|
|
2057
|
-
`,
|
|
2057
|
+
`,Gf=yr.div`
|
|
2058
2058
|
position: absolute;
|
|
2059
2059
|
width: 300px;
|
|
2060
2060
|
height: 300px;
|
|
@@ -2064,7 +2064,7 @@ to {
|
|
|
2064
2064
|
display: ${({webcamEnabled:e})=>e?"none":"flex"};
|
|
2065
2065
|
align-items: center;
|
|
2066
2066
|
justify-content: center;
|
|
2067
|
-
`,
|
|
2067
|
+
`,Zf=yr.div`
|
|
2068
2068
|
position: absolute;
|
|
2069
2069
|
bottom: 45px;
|
|
2070
2070
|
display: flex;
|
|
@@ -2072,7 +2072,7 @@ to {
|
|
|
2072
2072
|
justify-content: center;
|
|
2073
2073
|
gap: 13px;
|
|
2074
2074
|
z-index: 2;
|
|
2075
|
-
`,
|
|
2075
|
+
`,Kf=yr.button`
|
|
2076
2076
|
display: flex;
|
|
2077
2077
|
align-items: center;
|
|
2078
2078
|
justify-content: center;
|
|
@@ -2100,7 +2100,7 @@ to {
|
|
|
2100
2100
|
width: 24px;
|
|
2101
2101
|
height: 24px;
|
|
2102
2102
|
}
|
|
2103
|
-
`,
|
|
2103
|
+
`,Yf=yr.div`
|
|
2104
2104
|
display: flex;
|
|
2105
2105
|
flex-direction: column;
|
|
2106
2106
|
align-items: flex-start;
|
|
@@ -2109,17 +2109,17 @@ to {
|
|
|
2109
2109
|
h3 {
|
|
2110
2110
|
margin: 0;
|
|
2111
2111
|
}
|
|
2112
|
-
`,
|
|
2112
|
+
`,Qf=yr.h3`
|
|
2113
2113
|
font-size: 20px;
|
|
2114
2114
|
line-height: 24px;
|
|
2115
2115
|
font-weight: 700;
|
|
2116
2116
|
margin: 0;
|
|
2117
2117
|
font-family: Gazpacho;
|
|
2118
|
-
`,
|
|
2118
|
+
`,Jf=yr.p`
|
|
2119
2119
|
font-size: 16px;
|
|
2120
2120
|
line-height: 22px;
|
|
2121
2121
|
font-weight: 400;
|
|
2122
|
-
`,
|
|
2122
|
+
`,Xf=yr.input`
|
|
2123
2123
|
width: 100%;
|
|
2124
2124
|
border: 1px solid #c9c9ca;
|
|
2125
2125
|
border-radius: 8px;
|
|
@@ -2128,7 +2128,7 @@ to {
|
|
|
2128
2128
|
box-sizing: border-box;
|
|
2129
2129
|
margin-top: 40px;
|
|
2130
2130
|
font-size: 16px;
|
|
2131
|
-
`,
|
|
2131
|
+
`,em=yr.button`
|
|
2132
2132
|
width: 100%;
|
|
2133
2133
|
background-color: #1d1c20;
|
|
2134
2134
|
color: white;
|
|
@@ -2142,7 +2142,7 @@ to {
|
|
|
2142
2142
|
line-height: 19px;
|
|
2143
2143
|
font-weight: 500;
|
|
2144
2144
|
cursor: pointer;
|
|
2145
|
-
`,
|
|
2145
|
+
`,tm=yr.footer`
|
|
2146
2146
|
display: flex;
|
|
2147
2147
|
flex: 1;
|
|
2148
2148
|
justify-content: flex-end;
|
|
@@ -2151,20 +2151,20 @@ to {
|
|
|
2151
2151
|
align-items: center;
|
|
2152
2152
|
text-align: center;
|
|
2153
2153
|
width: 300px;
|
|
2154
|
-
`,
|
|
2154
|
+
`,rm=yr.h5`
|
|
2155
2155
|
font-weight: 700;
|
|
2156
2156
|
font-size: 16px;
|
|
2157
2157
|
line-height: 19px;
|
|
2158
2158
|
margin: 0;
|
|
2159
2159
|
font-family: Gazpacho;
|
|
2160
|
-
`,
|
|
2160
|
+
`,nm=yr.p`
|
|
2161
2161
|
font-weight: 400;
|
|
2162
2162
|
font-size: 12px;
|
|
2163
2163
|
line-height: 14px;
|
|
2164
2164
|
color: black;
|
|
2165
2165
|
margin-bottom: 0;
|
|
2166
2166
|
margin-top: 10px;
|
|
2167
|
-
`,
|
|
2167
|
+
`,im=yr.div`
|
|
2168
2168
|
display: flex;
|
|
2169
2169
|
flex-direction: column;
|
|
2170
2170
|
align-items: center;
|
|
@@ -2172,4 +2172,4 @@ to {
|
|
|
2172
2172
|
background-color: #fff;
|
|
2173
2173
|
color: #1d1c20;
|
|
2174
2174
|
height: 100%;
|
|
2175
|
-
`;var
|
|
2175
|
+
`;var am=({onGreetingDone:e})=>{const{t:t}=Li(),[r,{width:n,height:i}]=Zs(),a=(0,Ie.useRef)(null),s=(0,Ie.useRef)(null),[c,l]=(0,Ie.useState)(void 0),[d,u]=(0,Ie.useState)(!1),[p,h]=(0,Ie.useState)(!1),f=n>=i,m=async e=>{try{const t=await navigator.mediaDevices.getUserMedia(e),r=t.getVideoTracks()[0],n=t.getAudioTracks()[0];r&&l(r),n&&u(!0),n?.stop()}catch(e){console.error("Get User Media Failed: ",e)}},g=(0,Ie.useCallback)((async()=>{c?(c.stop(),l(void 0)):await m({video:!0})}),[c]),v=(0,Ie.useCallback)((async()=>{d?u(!1):await m({audio:!0})}),[d]);if((0,Ie.useEffect)((()=>{s.current&&(s.current.srcObject=c?new MediaStream([c]):null)}),[s,c,n,i]),(0,Ie.useEffect)((()=>{m({audio:!0,video:!0})}),[]),!0===p)return(0,o.jsx)(im,{children:(0,o.jsx)("img",{src:"https://stream-assets.snapcall.io/animations/snapcall-logo-animation.gif",alt:"Snapcall logo animation",height:40})});const y=Boolean(c);return(0,o.jsxs)(zf,{ref:r,children:[(0,o.jsx)(If,{}),(0,o.jsx)(Ff,{}),(0,o.jsx)(Uf,{children:t("greeting.mainTitle")}),(0,o.jsxs)(Vf,{children:[f&&(0,o.jsxs)(Hf,{children:[(0,o.jsx)($f,{webcamEnabled:y,ref:s,autoPlay:!0}),(0,o.jsxs)(Gf,{webcamEnabled:y,children:[(0,o.jsxs)(Wf,{children:[!d&&(0,o.jsx)(qf,{children:(0,o.jsx)(Ks,{status:!d})}),!y&&(0,o.jsx)(qf,{children:(0,o.jsx)(Ys,{status:!y})})]}),(0,o.jsx)(Kf,{children:(0,o.jsx)(ic,{})})]}),(0,o.jsxs)(Zf,{children:[(0,o.jsx)(Kf,{onClick:v,danger:!d,children:(0,o.jsx)(Ks,{status:!d})}),(0,o.jsx)(Kf,{onClick:g,danger:!y,children:(0,o.jsx)(Ys,{status:!y})})]})]}),(0,o.jsxs)(Yf,{children:[f&&(0,o.jsx)(Qf,{children:t("greeting.sideTitle")}),(0,o.jsx)(Jf,{children:t("greeting.sideDescription")}),(0,o.jsx)(Xf,{ref:a,name:"displayName",type:"text",placeholder:t("greeting.namePlaceholder"),autoFocus:!0}),(0,o.jsx)(em,{onClick:()=>{const t=a.current?.value,r=Boolean(c);c?.stop(),h(!0),setTimeout((()=>{e({cameraEnabled:r,micEnabled:d,displayName:t})}),4e3)},children:t("greeting.nameSubmit")})]})]}),(0,o.jsxs)(tm,{children:[(0,o.jsx)(rm,{children:t("greeting.footerTitle")}),(0,o.jsx)(nm,{children:t("greeting.footerDescription")})]})]})};const om=new URL(window.location.href),sm="0"!==om.searchParams.get("microphone-enabled"),cm="1"===om.searchParams.get("camera-enabled"),lm={sharedURL:window.location.href,showMenuButton:!0,settingsShortcuts:[{id:"pip",displayType:"icon"}],controls:{microphone:{available:!0,enabled:sm},camera:{available:!0,enabled:cm},screenshare:{available:!0}},streamApiURL:String("https://apistream.snapcall.io"),tracking:!1},dm={init:({element:e,...t})=>{if(e?.nodeType!==window.Node.ELEMENT_NODE)throw new Error('The "element" property must be a valid element!');const r=f(lm,t);(0,s.render)((0,o.jsx)(Bf,{options:r}),e),r.tracking&&p.init(3111933,6)},initGreeting:(e,t)=>{(0,s.render)((0,o.jsx)(am,{onGreetingDone:t}),e)},setExtraSettingsOptions:e=>{const t=new CustomEvent("streamUISetExtraSettingsOptions",{detail:{extraOptions:e}});window.dispatchEvent(t)},sendNotification:Dr,joinRoom:ns.init.bind(ns),leaveRoom:ns.endCall.bind(ns),terminateRoom:ns.terminateRoom.bind(ns),generateToken:ns.generateToken.bind(ns),addEventListener:ns.addEventListener.bind(ns),dispatchEvent:ns.dispatchEvent.bind(ns),getState:ns.getState.bind(ns),setProfile:ns.setProfile.bind(ns),setConfig:ns.setConfig.bind(ns),setLogLevel:e=>po.setLogLevel(e)};window.streamUI=dm,window.snapcallAPI={join:(...e)=>(console.warn("snapcallAPI.join is deprecated, please use streamUI.joinRoom instead!"),dm.joinRoom(...e)),endCall:(...e)=>(console.warn("snapcallAPI.endCall is deprecated, please use streamUI.leaveRoom instead!"),dm.leaveRoom(...e)),terminateRoom:(...e)=>(console.warn("snapcallAPI.terminateRoom is deprecated, please use streamUI.terminateRoom instead!"),dm.terminateRoom(...e)),generateToken:(...e)=>(console.warn("snapcallAPI.generateToken is deprecated, please use streamUI.generateToken instead!"),dm.generateToken(...e)),setDisplayName:(...e)=>(console.warn("snapcallAPI.setDisplayName is deprecated, please use streamUI.joinRoom options instead!"),ns.setDisplayName(...e))}})();
|